News for hackers. Stuff that matters.
Re:Ask HN: Who regrets choosing Elixir? by alex55 on Saturday May 23, 2020 @02:00PM (#23284980)
I work for a Ruby on Rails shop and we used Elixir for two projects about a year or two ago when it was getting a lot of good press.

The first project was an API that was intended to serve as a middleman between a few legacy services. Basically the company that hired us was building a new JSON API but didn't want to rewrite all their old code and our job was to consume the output from their ugly legacy APIs and produce nice JSON.

Elixir/Phoenix worked for the first service, but after that we ran into problem after problem. One of the legacy services used HMAC authentication and Phoenix (at the time?) didn't really support that. We were eventually able to hack around it without too much pain. Another service used XML and we had a lot of trouble finding XML libraries. There were some but nothing remotely as nice as Nokogiri. While all of this was happening, adding to our frustrations, a new version of Phoenix was released with a lot of changes. The only documentation for how to migrate an existing app was a typo laden GitHub Gist by the author of Phoenix. The final straw was when we got a call from the client about another service we had to integrate. This one used JSON but the order of the keys was important (please for the love of whatever god you believe in never do this). When we had to decide whether to write a custom JSON parser or move to Ruby, we rewrote the thing in Rails.

The second project was already a few thousand lines of code when we started working on it. It was a dumpster fire of a project but the devs who built it praised Elixir to the skies and said it was way better than their old Rails version. So take that for what it's worth.

We've decided not to do any new projects in Elixir for now but we're leaving it open for the future. It is a nice language to work with and, as you can see from the other comments, there are some projects where it shines.

I have two suggestions for you:

1. Talk to people in real life about Elixir/Phoenix. Most other devs I talk to in person at other agencies that tried Elixir have (surprisingly) neutral or slightly negative feelings about Elixir/Phoenix. Some percentage of people on Hacker News absolutely love Elixir (and often hate Ruby/Rails) and they usually flood the comment section of any Elixir article.

2. If you don't fully know the problem domain, use something with good library support. I don't know what your project is, but if you control the front and back ends or if you know exactly what features you'll need, there will probably be no problems choosing Elixir. Plus, it's always fun to learn something new. If your project is "some kind of API that needs to do X and maybe some other things we don't know yet" I would stick with Rails (or Python/Java/something with a lot of libraries). The worst place to be is not being able to do something simple because of a lack of library support and having to explain to your client/manager/coworker that it's because you read on Hacker News that writing "a |> b" instead of "a.b" is the future.

Re:Ask HN: Who regrets choosing Elixir? by PopeDotNinja on Saturday May 23, 2020 @02:53PM (#23285415)
> If you don't fully know the problem domain, use something with good library support.

I think this is completely fair. As my friend says, "I don't know what library I'll need for every project, but I know where will be one for Python."

Re:Ask HN: Who regrets choosing Elixir? by nikofeyn on Saturday May 23, 2020 @08:45PM (#23288069)
just because there is one doesn't mean it's quality. so then it's a worse scenario because you thought there was a solution, planned on it, but then once you use it you see it doesn't work the way you expect.
Re:Ask HN: Who regrets choosing Elixir? by PragmaticPulp on Saturday May 23, 2020 @06:55PM (#23287333)
> Elixir/Phoenix worked for the first service, but after that we ran into problem after problem.

> Most other devs I talk to in person at other agencies that tried Elixir have (surprisingly) neutral or slightly negative feelings about Elixir/Phoenix. Some percentage of people on Hacker News absolutely love Elixir (and often hate Ruby/Rails) and they usually flood the comment section of any Elixir article.

This mirrors our experience, albeit with Erlang.

Every time I try to talk about negative experiences with Erlang online, people come out of the woodwork to pick apart my stories and assume we were just incompetent. Erlang/Elixir have an almost mythical reputation in online communities. A lot of people have completed some basic Erlang or Elixir tutorials and assume they're just a few steps away from running a massive WhatsApp-style backend, but it's not that simple.

If a company wants to go all-in on Erlang/Elixir and maintain a staff of multiple Erlang/Elixir devs for the lifetime of the service, that's one thing. However, decisions to write core features in these less popular languages should not be taken lightly.

Re:Ask HN: Who regrets choosing Elixir? by kenhwang on Saturday May 23, 2020 @11:34PM (#23288863)
You experience pretty much match mine.

My boss really wanted to use Elixir. Our CTO said he could only if he could convince 3 senior engineers and one ops person to agree to work on and support it. So he flew a whole team of us to ElixirConf. He organized a hackathon team around it. We rewrote some non-critical some services in it. All on company time and money.

At the end, none of the engineers could sign off on using it professionally at the company. Elixir is a cool language and it was a fun learning experience, but it's such a shoddy abstraction over Erlang and that's not a pleasant language. The operational complexity is really high, and it didn't solve our problems better than our current core languages did. The ecosystem was also really lacking in unavoidable ways for us, which meant we spent more time developing libraries that would've existed in any other ecosystem than actually writing application logic.

Re:Ask HN: Who regrets choosing Elixir? by p_l on Tuesday May 26, 2020 @12:08AM (#23307321)
I'd say that it sounds like you made an informed choice, with proper upfront research on it. That's commendable, even if my fanboying over Erlang would like to steer elsewhere :)

My big problem is with companies that don't do any exploratory work like that. Write a prototype in new language/framework with the explicit idea enforced in project management that it's going to be a throwaway. Do a study through hackathon etc like your team did.

Don't just go on meme-driven development, which covers "CTO read a fancy shmancy content marketing piece in colourful magazine while on the flight"

Re:Ask HN: Who regrets choosing Elixir? by BubRoss on Saturday May 23, 2020 @06:48PM (#23287288)
Treating language choices like celebrity popularity contests and being afraid to wrap C or C++ libraries to get them into your non native language is a brutal combination.
Re:Ask HN: Who regrets choosing Elixir? by tuxcall on Saturday May 23, 2020 @04:37PM (#23286184)
It sounds like the parsing you needed would not need to be generalized, as you were working on projects for which you knew the requirements. In this case, writing the custom parsers should have been a simple task, and not something that would have stopped or even deterred me from using a language. Frankly, in general, writing a JSON, or even an XML parser, is not challenging and should take little time.

These days there's a multitude of both XML and JSON libs for Elixir.