News for hackers. Stuff that matters.
Re:Learn Go in five minutes by murukesh_s on Tuesday January 05, 2021 @12:24PM (#25647959)
I have used Go in production. I found it roughly takes 2-3x additional time it takes to develop the same functionality in Node.js (with typescript). But it runs faster. If you want to write code that is probably not going to be thrown away it may be wise to invest the additional time in Go. However can't recommend that for building experimental code/APIs etc which are time bound and may/can get replaced (or split into micro services) in future if it becomes massively successful..
Re:Learn Go in five minutes by H1Supreme on Tuesday January 05, 2021 @12:38PM (#25648213)
This is purely anecdotal, and simply suggests you know Node.js better than Go.
Re:Learn Go in five minutes by murukesh_s on Tuesday January 05, 2021 @10:57PM (#25654521)
Could be, but it could also be that Node.js have much more libraries compared to Go, especially for databases, can escape typing if necessary using any, promise/async programming are much more easier with es6 (you can do a try catch without repeating etc)..array operations like map, reduce makes much easier to do quick and dirty functional programming etc. I can get much cleaner libraries for concurrent programming in Node.js lots of things you can do in Node.js takes roughly twice or more number of lines. Could be anecdotal, but say if I try another language such as Python I found it is more or less same as Node.js. Java is another language I can think that can slow you down. Of course the stricter typing, error handling etc can make for much more robust code in long run, but for someone who can afford to trade development time.
Re:Learn Go in five minutes by erik_seaberg on Tuesday January 05, 2021 @02:18PM (#25649717)
If I’m willing to take a productivity hit because I can’t afford the footprint of Scala/Java (or Typescript), I’d be thinking Rust. Go seems to fall somewhere in between without a clear advantage in either perf or clarity.
Re:Learn Go in five minutes by jtdev on Tuesday January 05, 2021 @12:38PM (#25648208)
Any examples of Node being faster to write than Go? Did this have anything to do with the plethora of npm packages available?
Re:Learn Go in five minutes by murukesh_s on Wednesday January 06, 2021 @11:26AM (#25659138)
Several use cases, of course more number of npm packages also easier concurrency, much more shorter syntax for async/promises, with ES6 you get closer to functional programming like map reduce etc. Also you can add or escape typing using Typescript. Single threaded architecture is a boon and good fit for web app middlewares. In golang sometimes you have to work too hard to get typings correct, concurrency is not straight forward in my view and error handling requires lot of repetitive code etc and of course lesser number of packages and difficult to hire developers.
Re:Learn Go in five minutes by jtdev on Thursday January 07, 2021 @12:18PM (#25673914)
> "easier concurrency"

In Node??? Have you actually written any Go code?

Re:Learn Go in five minutes by AlchemistCamp on Tuesday January 05, 2021 @12:31PM (#25648085)
And that's saying something give that neither Node nor TypeScript have ever had productivity as a main selling point!

Imagine evaluating the time to market for an experimental back-end written in Rails, Laravel, Phoenix, etc vs Go! The difference is staggering.

Re:Learn Go in five minutes by konart on Tuesday January 05, 2021 @02:59PM (#25650232)
>Rails, Laravel, Phoenix, etc vs Go!

Comparing frameworks and a language, really?

Re:Learn Go in five minutes by AlchemistCamp on Wednesday January 06, 2021 @02:08AM (#25655326)
Absolutely! There are obvious productivity differences between the languages themselves and frameworks can make it even more apparent.

Different languages make writing the DSLs used in Rails-like frameworks easy, difficult or impossible. Much of my professional career was spent working on Node back-ends with a variety of frameworks and none of them were even close in terms of succinctness or productivity.

Re:Learn Go in five minutes by murukesh_s on Wednesday January 06, 2021 @11:51AM (#25659447)
Agree with that. However none of the frameworks comes closer to visual programming environments (nowadays called low code).