Live data from Hacker News

Learn Go in five minutes

gist.github.com

31–40 of 137 posts

Re: Learn Go in five minutes

#32
post #11

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…

If I would have to replace C with anything, I would choose Rust and not Go.

To me Rust is more like "C++ done right". It's massively bigger, more complicated and slower to compile than C. The C ABI is also the de-facto lingua franca for language interop, something that's not easily achievable with Rust or C++ (or Go, for that matter).

Re: Learn Go in five minutes

#33
post #5

Earlier quoted context omitted.

I like C but strongly dislike Go. They share nothing other than having a small(ish) feature set.

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.…

I agree about becoming okay with bad code. But I think if you understand and embrace that, there’s a place for it and it can be quite powerful and easy to use at times. It’s a trade off that makes sense sometimes. I think the problem appears when people treat Go like it doesn’t have any problems. All languages do.

As I’ve mentioned recently though, I don’t think I’d ever want to use Go as a forever solution to a complex problem. I’m sure some people could do it and do a great job, but I’m not one of those people. I need the ability to abstract and ensure more safety, or I’ll never feel secure with what I’m building.

Re: Learn Go in five minutes

#34
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…

How would you design the error handling?

Personally I'm glad Go has stayed out of exceptions (panics don't count), at scale it's so much easier to reason about flow.

Re: Learn Go in five minutes

#35
post #12

This is neat, and a testament to the simplicity of Go. I normally point people to this tutorial if they want to learn Go quickly, it is interactive (able to navigate straight to go playground) and very well done in my opinion. https://gobyexample.com/

> testament to the simplicity of Go

Depends on who reads it I guess. Lispers would not see simplicity in Go, they would see all the different characters you need to use, how some things are statements and others are function calls, conditionals, type definitions and they all have different syntax for themselves, instead of being the same.

Both have their places for sure, but I wouldn't go so far to say Golang is simple because of this example.

At least it's not Rust, I give you that.

    pub fn metadata>(path: P) -> Result

Re: Learn Go in five minutes

#37
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…

The error handling feels deeply wrong to me too. I love the explicitness and how hard it is to ignore errors - all languages should make it so easy to expect and handle potential errors - but other features (or lack thereof) of the language make it so you can’t handle any of it in concise or sane ways. Code is plastered with the same boilerplate, everywhere, always. It makes up a significant mount of all Go code.

Re: Learn Go in five minutes

#38
post #5

Earlier quoted context omitted.

I like C but strongly dislike Go. They share nothing other than having a small(ish) feature set.

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.…

The last couple of years are showing that Go delivers, it's pretty easy to find dozen of "real" software written in Go that are weidly used.

Re: Learn Go in five minutes

#39

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.

Do Go comments work like syntax? Do you mean that they need to be formatted a certain way like they’re language syntax?

Re: Learn Go in five minutes

#40

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,…

> There is a lot of difference between learning a new programming language and discovering one.

Yeah, discover just lasts the moment you stumble upon it. Once you sit down to learn the syntax and basics, you're learning the language.

- discover - find unexpectedly or during a search.

- learn - gain or acquire knowledge of or skill in (something) by study, experience, or being taught.

I don't think anyone is reading the title and thinking "Huh, I can learn _all_ of Go in just 5 minutes?!". The time is an indicator that you'll just scratch the surface, not become a master gopher.

Post reply on HN