So I am trying to move away from NodeJs for my next project and I can't decide between Elixir and Go. Can't decide what to choose, any idea if there is any advantage for a noob to learn one or the other?
I’d say it depends on what you want to build (disclaimer: I have written a lot of Go but have only read Elixir source). If full stack monolith, use Elixir because of Phoenix; if microservice arch, use Go with gRPC protobufs for messaging. IMO, both languages seem to result in very readable source code; and many examples of how to do either exist on GitHub.
Learning Go as a Node.js Developer
21–30 of 82 posts
Re: Learning Go as a Node.js Developer
#22So I am trying to move away from NodeJs for my next project and I can't decide between Elixir and Go. Can't decide what to choose, any idea if there is any advantage for a noob to learn one or the other?
Do both and and then make an educated decision on which languages fits best for the project goals. They are different tools. But to be honest, I'm an Elixir fan :-)
Re: Learning Go as a Node.js Developer
#23The biggest difference I see: the author immediately reached for a framework instead of checking out the standard library. In Node, the standard library is effectively non-existent, so Node devs get trained and acclimatised to dependencies. In Golang, dependencies are minimised. Everyone tries to stick to the standard library as much as possible. Because the standard library is so good, for most projects this is perf…
>In Golang, dependencies are minimised. Everyone tries to stick to the standard library as much as possible. i don't understand this. yes net/http is nice but there's no router, there's no orm (yes i know that's not really possible at all because of strong typing), yes database/sql exists but you know most everyone uses at least sqlx and e.g. lib/pq. yes html/template is nice but we're all doing SPAs now anyway. okay…
You don't need an ORM. Mapping database tables to objects directly is a really bad idea. Write SQL, it's easy, simple and cheap. Yes, you'll repeat yourself. Golang generally prefers some repetition to some dependency.
You don't need middleware. Once you get used to handling routes as logic, then the need for middleware kinda vanishes.
You can use the semi-official google websockets package [0]. It's borderline whether this could be considered part of the standard library or not (I use the google uuid package all the time for the same reason). I believe there's an intention to include these packages in the standard library at some point, probably Go v2.
Try it out, it's liberating.
Re: Learning Go as a Node.js Developer
#24Earlier quoted context omitted.
> they don't need a dependency manager. For not needing a dependency manager, Go sure has developed an amazing number of them! https://github.com/golang/go/wiki/PackageManagementTools https://github.com/avelino/awesome-go/blob/master/README.md#... In fact, Go probably has the most package managers of any language I've ever seen.
Perhaps everyone coming from other languages who can't imagine a world with a good standard library!
And of course, standard library APIs age with time. Perl and Python are good examples. Both ship with packages that were really good in their day, but have long since been superceded by community-created tools. But the core has to keep shipping the old thing for backwards compat and the maintainers are reluctant to add yet another package that does the same thing.
Dependencies have their downsides, but being able to assemble the best of what's out there rather than relying on the best of what was available at some point in the past has a lot of advantages too. Languages with good dependency management seem like the best possible option.
Go's refusal to embrace this is a huge pain point. Dep is a decent start, but without a community actually doing things like releases, changelogs, and all the other things that go into a solid ecosystem, it's a half measure at best.
Re: Learning Go as a Node.js Developer
#25Re: Learning Go as a Node.js Developer
#26Earlier quoted context omitted.
I’d say it depends on what you want to build (disclaimer: I have written a lot of Go but have only read Elixir source). If full stack monolith, use Elixir because of Phoenix; if microservice arch, use Go with gRPC protobufs for messaging. IMO, both languages seem to result in very readable source code; and many examples of how to do either exist on GitHub.
Awesome, one thing, what is the advantage of microservices, to lets say, modular monolith?
Re: Learning Go as a Node.js Developer
#27So I am trying to move away from NodeJs for my next project and I can't decide between Elixir and Go. Can't decide what to choose, any idea if there is any advantage for a noob to learn one or the other?
I try to do it with them and then decide.
So, in short, build a mental "benchmark" that is representative to help to decide if X is right for you
Re: Learning Go as a Node.js Developer
#28Earlier quoted context omitted.
Perhaps everyone coming from other languages who can't imagine a world with a good standard library!
I wouldn't exactly call Go's standard library _good_. It's got a lot of stuff in it, which is nice, but the API design ranges from excellent (net/http) to "how much crack?!" (time.Format and .Parse) to not-quite-sufficient (various packages). And of course, standard library APIs age with time. Perl and Python are good examples. Both ship with packages that were really good in their day, but have long since been super…
Go has indeed embraced it and is working on `dep` the officially sanctioned dependency manager.
It's under the official golang github repository.
Re: Learning Go as a Node.js Developer
#29Earlier quoted context omitted.
Perhaps everyone coming from other languages who can't imagine a world with a good standard library!
Good is _really_ subjective. While its definitely better than JS/Node it has some warts. For example, I find the "time" builtin package to be pretty terrible. Specifically how it does formatting[0]. This method makes the format look like a magic string rather than being an obvious template like other languages would use. I've found some legitimate bugs[1] in simple functions that don't give me a ton of confidence in…
It's sure not perfect, and it's impossible to please everyone but I think it was worth the experiment.
Re: Learning Go as a Node.js Developer
#30Earlier quoted context omitted.
Perhaps everyone coming from other languages who can't imagine a world with a good standard library!
Good is _really_ subjective. While its definitely better than JS/Node it has some warts. For example, I find the "time" builtin package to be pretty terrible. Specifically how it does formatting[0]. This method makes the format look like a magic string rather than being an obvious template like other languages would use. I've found some legitimate bugs[1] in simple functions that don't give me a ton of confidence in…