4 ms·
Has anyone used both Elixir and Go enough to give a comparison of the feel/productivity for backend web dev? (I know it's apples to oranges... but for some tas
by nnq 10y ago
Has anyone used both Elixir and Go enough to give a comparison of the feel/productivity for backend web dev?
(I know it's apples to oranges... but for some tasks, like backend / high concurency microservices etc., both an apple and an orange are perfect fit, so it's worth comparing. I've heard of Ruby or Python people jumping to Go or Elixir, but not of any comparison.)
- brightball 10y agoI'm actually in the process of writing a detailed blog post on that subject. Just trying to make sure I cover all of the bases. Both are very similar in their underlying approaches. The biggest difference is that you have to write a lot more error handling code for Go. The other thing is interfaces. With Go if you want to be able to pass multiple different types of structs to a function you have to define an interface that fits with both by showing each have a field named X of type Y. Because of that you end up needing to define a lot of interfaces. Elixir accomplishes the same thing with pattern matching. You can define a function that shows parts of a nested hash in the argument and in order to call that function the hash you pass has to have those keys. It's much more flexible and less clunky IMO. The other thing is Go's compiler strictness about making you remove any library from the import that not in use. When doing development or experimenting with a new library it gets really old having compiler yell at you about this because you commented something out. With Elixir, the compiler WARNS you about it. You still get a great big "get rid of all this stuff that isn't used" on compile, but it doesn't interrupt your development workflow. Details like that, better package management, etc make me significantly more productive with Elixir. Phoenix is excellent and it's view layer is extremely fast and flexible - probably my favorite view layer that I've ever dealt with across many languages. Contrast that with Go templates, which to me felt a lot more like JSP.
- FlyingSnake 10y agoI've used Go sparingly so please take this with a grain of salt. I got productive quickly with Go and loved the simplicity and ease of development. The speed of compilation is amazing, and the programs run at a blazing speed. Then hit the wall and found myself repeating myself again and again. The lack of generics, pattern matching was really a deal breaker for me. I chose Elixir for another API backend, and I really loved it. Hex, the package manager, Phoenix framework, the rock solid Erlang/BEAM and the Elixir language itself was a breeze from Go. Even though it compiles slower, and sometimes Hex package would fk up package hierarchy, the whole experience was great. The IDE support is bit flaky, and I used ST3. I would highly recommend Elixir over Golang.
- zzzcpan 10y agoThey are worlds apart from each other to compare. But if you can use Elixir for your project, you should, because you are going to be way more productive.