Hacker News new | ask | show | jobs
by parthdesai 1058 days ago
> It also requires a different way of exploring code as you can't do the familiar `.` and see what happens, you can't just do `price.toCentsValue` but need to do `price |> Price.toCentsValue` and so you need to know the existence of the `Price` module, which might not exist and be buried in `Cart` or as an helper in some controller because you did not understand clearly the domain and the modules responsibilities. Attaching behaviour to data is powerful, explorable, and most people are used to it, even if it's the wrong place in principle, with modules this is flipped, it's now data that must thread through operations, and it's not super easy to grasp.

Not sure, I think you're picking and choosing things to ramble about. While you can't just do `price.toCentsValue`, and have to call `Price` module, in a OO language, you would need to instantiate `price = new Price(amount 10)` or something before calling `toCentsValue`. This means you're aware of the Price class, same as being aware of the Price module. If anything being aware of the module infact is better IMO since it allows you trace through explicitly what the code is going to do. Your point is correct if you're working through macros though.

1 comments

I'm not really picking anything, just sharing how it went with elixir in my org. I'm sure we could have done better, but the pit of success was not there for the polyglot teams. the elixir-only teams did a bit better, but mostly they just learned the ecosystem and then GTFO'ed out to greener pastures since they just wanted to write elixir and only elixir.

about your specific counterpoint, I think it's partially valid; I don't instantiate modules, I might not have named structs but just operate on Maps so I don't know the supposed module name, I might have misplaced the function in another module (while it's very intuitive to stick it to the object in oop)...and a million other things that are way too different for the average joe.

Thanks for sharing!

We could certainly debate the objective merits of Elixir vs other languages (which seems to be the primary discourse in this thread and elsewhere) but hearing subjective developer experiences is also critical.

It doesn't matter if Elixir is objectively better or not, if lots of devs who are exposed to it are having a hard time it's worth asking why.

In addition to developers not wanting to expend additional effort to learn a new language or paradigm, I believe there are gaps in the ecosystem especially around medium-advanced topics.

I'd be interested to hear what some of those gaps are from your perspective, as they represent opportunities for community creators.

In other words, what resources do you wish existed?