Live data from Hacker News

Learn Go in five minutes

gist.github.com

41–50 of 137 posts

Re: Learn Go in five minutes

#41
It glosses over a lot of nuance, which I can tell by not explaining that you can't use the implicit assignment := operator outside a function.

And since this has turned into another "referendum on golang" argument, I'll say that I appreciate what it has to offer on my team at work. We historically write in Python, and we are a team of system engineers writing 100-500 line automation code that uses APIs.

Static typing helps. Our enterprise has tooling that makes importing 3rd party code a lot easier in our bureaucracy. The linting and checks are more robust.

From a language perspective, forcing linting and conventions makes the code a lot easier to write with a team. I may not like camelCase, but damnit if everyone doesn't learn how to read it quickly when the language/linter forces us to use it.

The VSCode plugin is completely essential. Being able to type an import, and then quickly hop to the complete API documentation and expected inputs/outputs of everything, is so much help that I, a Python "skilled tradesman", gladly hopped on the golang train.

My only gripe is that a lot of documentation seems to be third party, or very strictly an API reference. Nuanced, helpful docs are scattered in gobyexample, stackoverflow, etc.

---

Bottom line, it is a great language/ecosystem for reasonably self-documenting, readable code for novice/intermediate "scripters" and coders who are not CS majors. Tooling is amazing.

Re: Learn Go in five minutes

#42

Go can be understood as an improved C that keeps much of C's simplicity but adds small, powerful features like interfaces and channels and garbage collection Go fixes C's well-understood flaws (declaration resembling use, unintuitive operator precedence, unrestricted address math, silent casting, zero-terminated strings, etc.) Go puts essential C idioms directly into the language (pointer/length is formalized as slic…

I like C but I would prefer Rust over Go. Go may be simple but I really hate using conventions like init(), comments working like syntax, captial letter means published etc.

init() is not a convention and it's not used that much. For comments I don't understand what you're saying. And for caps I think it's better than public / private keyword.

Re: Learn Go in five minutes

#43
post #18

Earlier quoted context omitted.

I agree. Go feels like it's aimed at creating applications that run at a level above where C traditionally runs while keeping the pared down feature set of C, and it just doesn't work well imo. I loved playing with Go, but eventually it feels like you're conditioning yourself to be ok with a lot of "bad" code. Tons of repetition, tons of boilerplate by other names. It's like the simplicity gets in the way of itself.…

Meanwhile the place I work writes all microservices in go and all of my team's (DevOps) tools are also written in go...

I explicitly added the "ps" to avoid the situation where all the replies are fairly empty comment saying "Well we use it!"

I get that you can use it for real work, I'm not saying you can't. I'm saying, even by design to some degree, it's not particularly enabling compared to other languages.

That's meant to be a strength if anything, but I did not find the tradeoff of simplicity was able to overcome the additional effort it took to deal with what was missing

There's an implicit ymmv here of course, because I'm not saying no one can find Go useful, I can see how in certain worlds with certain teams with certain priorities it'd all work out.

It's just not for me.

Re: Learn Go in five minutes

#44

Learn linear algebra ... in just 5mins! Learn the lambda calculus ... in just 5mins! Learn how to write a novel ... in just 5mins! Learn how to be a stand up comedian ... in just 5mins! Learn kung fu ... in just 5mins! Learn how to be a world class lover in bed (or out!) ... in just 5mins! Man, that was the best half-hour I've ever spent in my life. Sorry, I couldn't fit in Go, though.

This seems like a good place to recall Peter Norvig's article "Teach Yourself Programming in Ten Years"

https://norvig.com/21-days.html

Re: Learn Go in five minutes

#45
post #20

Go can be understood as an improved C that keeps much of C's simplicity but adds small, powerful features like interfaces and channels and garbage collection Go fixes C's well-understood flaws (declaration resembling use, unintuitive operator precedence, unrestricted address math, silent casting, zero-terminated strings, etc.) Go puts essential C idioms directly into the language (pointer/length is formalized as slic…

My main small day-to-day usability gripes with C are lack of type inference, lack of destructors and terrible ergonomics for error handling. Go solves two out of three, but it really dropped the ball hard on error handling which is very disappointing IMO. Things like generics and garbage collection involve some deep tradeoffs, so I get Go's take on them, even if I don't necessarily agree with it. On the other hand IM…

I agree that the error handling is terrible, but I'm not sure how much better it could be without generics.

For me, the gold standard in error handling is Rust, where the type system simply does not allow you to ignore errors. This means that the existence of error handling is checked at compile time. Of course, this doesn't mean your error handling is _good_, but I think that's beyond any language design to enforce.

But the Rust system is entirely built around a generic Result type, where both the non-error result (an int, string, struct, etc.) _and_ the error type itself are both generic.

Re: Learn Go in five minutes

#47

My 2 cents without seeming harsh with the author. Articles with a title `Learn in 5 minutes` are misleading. They should be renamed `Discover in 5 minutes`. Replace the verb Discover by Introduce or something similar if you like. There is a lot of difference between learning a new programming language and discovering one. You will not learn any programming language in 5 minutes. This introduction to Go is quite nice,…

Remember when we used to yell at 21 day books (Learn C++ in 21 Days) as being mis-leadingly short? It's becoming a meme now.

Re: Learn Go in five minutes

#48

Learn linear algebra ... in just 5mins! Learn the lambda calculus ... in just 5mins! Learn how to write a novel ... in just 5mins! Learn how to be a stand up comedian ... in just 5mins! Learn kung fu ... in just 5mins! Learn how to be a world class lover in bed (or out!) ... in just 5mins! Man, that was the best half-hour I've ever spent in my life. Sorry, I couldn't fit in Go, though.

Remember "Learn C++ in 21 Days" and the furor around how silly it was to try and learn a programming language in less than a year?

It's become a meme now.

Re: Learn Go in five minutes

#50

Is this a response to that "learn rust in half an hour?" ;) https://fasterthanli.me/articles/a-half-hour-to-learn-rust

If only we had known that all of these Rust vs Go arguments could be resolved by learning both languages in 35 minutes.
Post reply on HN