In my case, it has to be pattern matching. I have never seen a language with this feature before Elixir.
Pattern matching is so powerful, it completely removes conditionals from most of my functions. You can pattern match on function parameters for christ’s sake! I mean wow, WOW.
It’s like a super power and I love using it. Elixir has made me love writing code again.
If you had to choose one single feature in Elixir, what would you pick?
Even though it looks small (and wrong, for real FP people) I would take pipe…
It reminds me so much of bash piping, which I use all the time
Pattern matching too I guess - but, from erlang/elixir, other high contenders, GenServer’s, message passing, Pipe
Pattern matching for sure. Really changes the way I write code.
Can I say all of the above
Something that hasn’t been mentioned yet, and something I really REALLY love is how Elixir and Phoenix make things like the Replaceable Component Architecture (where you can build your app as a series of components) not just possible, but easy - to the point where it feels like a very natural fit. I think in time this is going to be a huge draw.
I also love how you can have more than one Phoenix layer in your app (yup, my mind was blown when I discovered that too!!)
There’s so many things like this that I’m really excited about. The funny thing is, it was the speed and scalability that drew me to Elixir, yet it’s all this other stuff that I never really gave much thought to that has got me really hooked.
Thank you Chris and José and all of you who have contributed to pushing Elixir and Phoenix towards these awesome things and of course for everything else you do too
Do you have a good reference article/video/what-have-you for that? It sounds quite interesting
Yup, PragDave’s course
The hairs on the back of my neck stood up at least three or four times while doing that course if I could force everyone who’s into Elixir to do one thing, I would make them do that course - it really is awesome
He starts of the section by saying “Phoenix isn’t a web framework… it’s much more than that!”
Assuming that was implied, I’d say the fact that the language design basically forces you to write modular and maintainable code. You have to really put in effort to write Elixir code that’s hard to figure out. It’s the result of a combination of things, but it’s definitely my favorite aspect.
There are lots of elements to Elixir I am enjoying, but I must say the setup and administration of projects is very straightforward and seems less fraught with danger & frustration than my previous experiences with other languages. Being only new to Elixir, I really enjoyed the process of getting started.
I like that you have chosen brunch.io to be part of your asset pipeline as opposed to the configuration nightmare that I have experienced with webpack. I realise that it doesn’t have all the bells and whistles that webpack has, but I think the nuts and bolts are that will give you the majority of time savings that automating your asset building delivers. There seems to be a lot of rational decisions that have been made when putting elixir together that I feel pay off especially when getting started.
Moving into a functional frame of mind is enough of a challenge without having to screw around with getting the environment running
Oh, did I mention the built in websocket support? I don’t believe I did
mix - such a pleasant tooling experience.
Definitely pattern matching. Its the number one thing I wish I had when using other languages.
I do love the pattern matching, but I’d have to give it a close 2nd place to the concurrency model. It’s the first sane one I’ve seen.
Of Elixir itself (ignore the BEAM parts), hmm, the macro’s probably.
Of the BEAM, the CPS, most definitely. It performing CPS allows for the magical actors that we have now. ^.^
For me, beyond doubt the most important feature of Elixir is the fact that it’s powered by BEAM
Putting BEAM aside, I’d pick the convention of passing the main data (aka “object”) as the first argument, which I personally prefer much more than the Erlang convention (object as the last arg, except exceptions ).
Protocols! Really don’t know why but I just love making me structs and protocols
Pattern matching specifically in the function head (also my fav feature in haskell/idris/purescript). I have never been a fan of if statements/expressions in any language because of the friction of attaching a label to WHY you are doing conditional logic (which would be the name of the function that is patterned matched in the function head).
It’s a simple dispatcher, if you are curious in arbitrary Protocol’s over any ‘shape/type’ and not just ‘type’ I have a protocol_ex library on hex that outperforms Elixir’s even on basic type tests. ^.^
This is a big thing regardless of the language, if it supports this then it is a huge boon to productivity!