108 Days of Elixir: My Journey to Mastering Functional Programming

Venkat Annangi
Venkat Annangi
20/09/2024 14:39 5 min read 42 views
#phoenix-framework #functional-programming #elixir #concurrency #108 days of elixir

Introduction: Why I’m Doing This

As a developer, I’m always looking to expand my skill set and dive into new paradigms that challenge me. After working with several languages and frameworks, I realized it was time to explore the world of functional programming, and what better language to start with than Elixir? Known for its concurrency, scalability, and its roots in Erlang’s robust ecosystem, Elixir offers the perfect blend of power and elegance.

So, I’ve decided to take on the 108 Days of Elixir challenge, where I’ll commit to learning and building with Elixir every day for the next 108 days. This structured learning approach will not only help me become proficient in the language, but also give me the opportunity to document my journey, share the lessons I learn, and (hopefully!) inspire others to embark on their own Elixir adventure.

In this post, I’ll outline my plan and what the next 108 days will look like. By breaking down Elixir’s core concepts and exploring real-world projects, I aim to become comfortable with the language, especially its standout feature: the concurrency model.


What You Can Expect in the Next 108 Days

Here’s a rough breakdown of what my journey will look like. Each day, I’ll spend time coding, learning new concepts, and applying them in small projects. The plan is broken down into phases, starting with the fundamentals and leading up to more advanced topics and real-world projects.

Day 1-10: Elixir Basics

To kick off my journey, I’ll focus on the essentials. I’ll set up my environment, explore the syntax, and understand basic data types, variables, and functions. During these first few days, I’ll also cover important concepts like pattern matching, which is a key feature of Elixir.

  • Installing Elixir and setting up
  • Data types and pattern matching
  • Functions and modules
  • Control flow with if, case, and cond

Day 11-20: Data Structures

Once I’m comfortable with the basics, I’ll dive into data structures such as lists, maps, and structs. This phase will be essential for building more complex applications.

  • Lists, tuples, and maps
  • Working with structs
  • Enum and Stream modules
  • Handling strings and binaries

Day 21-30: Recursion and Higher-Order Functions

Elixir’s functional nature shines through in its support for recursion and higher-order functions. Over these days, I’ll get a handle on recursive algorithms, anonymous functions, and core functions like map, filter, and reduce.

  • Recursion and tail-call optimization
  • Anonymous functions (lambdas)
  • Map, reduce, and filter patterns

Day 31-40: Mix and Project Structure

Next up, I’ll start building projects using the Mix tool, Elixir’s build and dependency manager. This will allow me to create applications from scratch and add external libraries (Hex packages). I’ll also learn how to write tests using Elixir’s built-in testing framework, ExUnit.

  • Creating projects with Mix
  • Dependencies and project structure
  • Writing tests with ExUnit
  • Generating documentation with ExDoc

Day 41-50: Concurrency and OTP

Elixir is known for its concurrency, so this phase will be dedicated to exploring the power of the Actor model and the OTP (Open Telecom Platform). I’ll experiment with processes, message passing, and learn to build fault-tolerant systems.

  • Processes and message passing
  • GenServer basics
  • Supervisors and fault tolerance
  • OTP application structure

Day 51-60: Advanced OTP and Fault Tolerance

I’ll take a deep dive into advanced OTP topics. Understanding GenServers in depth, how supervision trees work, and how Elixir enables fault-tolerant applications will be crucial at this stage.

  • Advanced GenServer patterns
  • Task, Agent, and Dynamic Supervisors
  • Error handling strategies
  • Let-it-crash philosophy

Day 61-70: ETS, Mnesia, and Data Storage

For data storage, I’ll explore ETS (Erlang Term Storage) and Mnesia, two powerful in-memory and distributed storage systems built into Elixir. I’ll also start using Ecto to work with relational databases.

  • Working with ETS for in-memory storage
  • Mnesia for distributed storage
  • Ecto basics: querying and manipulating databases

Day 71-80: Web Development with Phoenix

The moment I’m looking forward to the most: building web applications with Phoenix, Elixir’s full-featured web framework. I’ll create my first Phoenix web app and learn how LiveView can simplify building real-time applications.

  • Introduction to Phoenix framework
  • Building a basic web app
  • LiveView for real-time features
  • Phoenix Channels for websockets

Day 81-90: Advanced Phoenix Topics

At this point, I’ll have a solid understanding of Phoenix, and I’ll focus on more advanced topics like authentication and API development. I’ll also explore Absinthe, the GraphQL framework for Elixir, to build powerful APIs.

  • Authentication with Pow or Guardian
  • Building GraphQL APIs with Absinthe
  • Deploying Phoenix apps to production

Day 91-108: Real-World Projects

Finally, I’ll put everything I’ve learned to the test by building a real-world application or contributing to an open-source Elixir project. This will be a great way to wrap up the challenge and cement my Elixir skills.

  • Build a real-world project (chat app, eCommerce store, etc.)
  • Refactor and polish
  • Deploy the project to production

Conclusion: Join Me on This Journey!

Taking on the 108 Days of Elixir challenge is about more than just learning a new language. It’s about deepening my understanding of programming concepts, pushing myself to create meaningful projects, and, hopefully, contributing back to the Elixir community along the way.

I’ll be documenting my journey through daily blog posts and project updates, so feel free to follow along! Whether you’re curious about Elixir or a seasoned developer wanting to learn a new language, I encourage you to join me on this exciting journey!

Comments