Building Stella: a comprehensive Elixir toolkit for algorithmic adventures
- Authors
- Name
- Rafał Kostecki
- Author Poyters
Diving into creating Stella, this solid Elixir toolkit, wasn't just about coding—it was a chill journey of leveling up myself and tossing something cool into the Elixir community. This all-in-one library, packing quick algorithms, data structures, and math tricks, was basically my way of learning and sprinkling some goodness into the Elixir world.
Getting into Elixir: twisting mind with FP
Transitioning from my previous experiences with JavaScript, Ruby, and C++ to Elixir marks my introduction to the world of true functional programming. In my journey with JavaScript, I became familiar with its asynchronous nature and dynamic features. Ruby, on the other hand, introduced me to the elegance of object-oriented programming, while C++ provided a powerful, low-level perspective. However, diving into Elixir has been a game-changer
.
It's my first foray into a pure functional paradigm, and the shift is both enlightening and refreshing. Unlike object-oriented programming, where data and behavior are encapsulated within objects, functional programming emphasizes immutable data and pure functions.
The paradigm shift challenges me to think in terms of transformations rather than state, fostering a more declarative and concise coding style. Elixir's emphasis on concurrency and fault-tolerance, coupled with pattern matching and the actor model, adds a unique flavor to problem-solving.
The biggerst problem
in the beginning was to getting rid of mutability. You have to switch your mind to recurency only solutions, to achieve data manipulation in pure way - without side effects.
Firstly, it was very annoying and depressing, but after some time I realized how efficient this mechanism is. Of course, this does not apply to every case, but in some scenarios it's a lot easier and more efficient than imperative/object oriented way.
Guided by Cormen's Book (no, not like a GPS)
Stella's game plan? Totally inspired by Cormen's "Introduction to Algorithms." That book wasn't just a guide; it was like the coolest playlist for algorithmic adventures. Stella isn't just about throwing in some code; it's about following the beats of proven algorithms and sharing the rhythm with the Elixir crew. Rewriting a classical imperative algorithm in a functional way can be very difficult. It often requires a lot of rewriting and a departure from familiar forms.
Mixing math and coding
Stella isn't just about coding; it's my way of blending classroom math vibes with real-world code. It's like turning those abstract math theories into code that actually does stuff. Ever wanted to use calculus or linear algebra in your code? Stella's got your back.