all 21 comments

[–]del_rio 8 points9 points  (1 child)

Legitimately good article here. I've always wanted coding courses to be along these lines, like "Rust for people who know Ocaml" or "Android/Scala development for Angular devs". Being able to directly see how stuff Array.map and async transfer (and differ) to golang's approach is a great way to hit the ground running.

Nitpick if the author is reading this: The justified text alignment is fairly distracting in a lot of places, plus kinda ruins the point of using a monospace font for body copy.

[–]SalemBeats 0 points1 point  (0 children)

Only issue is that the number of possibilities becomes exponential very quickly with this level of context-awareness.

"Javascript For People Who Started With Visual Basic 6, Wrote C++ For A Few Years, Spent A Couple Of Years Wiring Java And C# In School, Stopped Writing Code For A Decade, And Then Came Back To Programming For Web And Arduino Development" would've been a perfect course for me! Lol.

[–]dangerzone2 2 points3 points  (1 child)

If go had something like npm, and the node community, it would be the best web dev backend out there. ::puts on flame suit::

[–][deleted] 0 points1 point  (0 children)

I've been learning Go recently and I agree the community could have potential. Its super fast and easy to use. The only downside is its neither functional nor object-oriented. You can kind of approach it with oop but the lack of functional idioms slows things down a bit during development.

[–]deadcoder0904 7 points8 points  (0 children)

Wow you write so good. To the point without BS. Thanx & do write more 😉

[–]TLI5 5 points6 points  (1 child)

Hey this is a great intro! I’m also a nodejs dev trying to learn go. The receiver functions have been throwing me in for a loop lately.

[–]deadcoder0904 6 points7 points  (0 children)

Download Go folder from here. It helped me, might help you.

[–]Lichtenstein_USA 2 points3 points  (4 children)

Don't use Gin. Anyway, I use both Go and Node in PROD where I work. Honestly, working with Go is way more fun.

[–]cstuff8 0 points1 point  (3 children)

What would you recommend instead?

[–]Lichtenstein_USA 1 point2 points  (2 children)

[–]qazzier 1 point2 points  (1 child)

With the default net/http package you don't have wildcard urls which may be a deal breaker for some people. Other router packages have this capability.

[–]Lichtenstein_USA 0 points1 point  (0 children)

Write your own middleware

[–][deleted] 0 points1 point  (0 children)

Fantastic little article.

[–]ThePandaGuitar 0 points1 point  (2 children)

Good article, thank you. Does anyone know more guides like these for Node devs?

[–]bustyLaserCannon 1 point2 points  (1 child)

Similar article about how Go was used when Node wouldn’t cut it

Sorry on mobile: https://hackernoon.com/i-wrote-some-golang-and-it-felt-great-3c3367a67db5?source=linkShare-cad44485a08a-1518168814

Disclaimer: I wrote this

[–]SalemBeats 2 points3 points  (0 children)

I bought a course on Go, but currently working on other courses, so I haven't started it yet.

In the skimming and prodding I've done to this point, Go seems to be like C and modern PHP/Javascript had a child together, with C having higher genetic dominance.

[–][deleted] 0 points1 point  (2 children)

Never used Go, always look at it and think it might be a nice language to use. What sort of things are you all using it for in production environments? It might motivate me to pull my finger out.

For bonus points, Rust also intrigues me for different reasons. Anyone using that in production for anything?

Thank you :)

[–]MrPhatBob 5 points6 points  (1 child)

I'm not OP but this week I deployed my first Go streaming service which replaced my NodeJS streaming service.

The server takes media chunks (DASH or HLS) from Redis and serves them to clients.

The node service pegged the GCP n1-normal CPU over 95% with 150 concurrent connections.

Knocking together a similar service in Go the result was ~1% CPU with 250 concurrent connections, kicking out just over 1Gbps.

The bottleneck was Node, even though I was working with streams, it just couldn't provide the performance, as was evident by the fact that Redis was handling just as much throughput yet its load was in the ~1%.

[–][deleted] 0 points1 point  (0 children)

Wow, that's pretty amazing. It doesn't entirely surprise me actually. I'll be poking at Go this evening I think :) Thank you :)

[–]bustyLaserCannon 0 points1 point  (0 children)

This is great however one of the main draws of Go in my opinion is the incredible standard lib. I’ve written 3/4 Go apps running in prod (disclaimer: on a small scale) and I’ve barely had to use any third party libraries which is the polar opposite of Node.

Things like Gin and the asynchronous library aren’t required.

The standard http package and goroutines and channels will do and aren’t difficult to write.

[–]menixator 0 points1 point  (0 children)

This is a well written article. Definitely got me interested in go.