Live data from Hacker News

Learning Golang – From Zero to Hero

milapneupane.com.np

11–20 of 76 posts

Re: Learning Golang – From Zero to Hero

#11
post #8

Earlier quoted context omitted.

Your opinion is fine, but you need to tell us why. A single sentence adds nothing to the discussion.

I agree. I would guess the "why" is that Rust is capable of everything that Golang is capable of, except more and better. Not to mention that Rust has a very supportive community to help each other.

I would disagree. Rust and Go occupy very different spaces. This is like saying "skip the car, take a rocket ship." Sure, Rust will go faster in some circumstances, but it's a hell of a commitment.

Re: Learning Golang – From Zero to Hero

#12

skip Golang, go straight for Rust EDIT: as my time for learning new programming languages is limited, I would invest it in learning Rust, rather than learning Golang or learning both of them. IMO the only reason to learn Golang is if your already have a legacy Golang codebase or if you want to contribute to various open source projects written in Go, like for example Kubernetes (my first experience with Golang was tr…

Please don't post unsubstantive comments or do programming language flamewars here.

Re: Learning Golang – From Zero to Hero

#13
post #4
post #2

Info about workspace is outdated. Go modules allows you to to work outside GOPATH

I recently hastily put together a "Learn Go in 10 days" program for my team, where I only used go modules: https://github.com/hliyan/learn-golang/blob/master/day-08/ma... Feedback welcome.

Thanks so much for sharing. Very helpful to me.

Re: Learning Golang – From Zero to Hero

#14
post #8

Earlier quoted context omitted.

Your opinion is fine, but you need to tell us why. A single sentence adds nothing to the discussion.

I agree. I would guess the "why" is that Rust is capable of everything that Golang is capable of, except more and better. Not to mention that Rust has a very supportive community to help each other.

Everything but being easy to learn, and having low complexity. Don't get me wrong, rust is an amazing alternative for C++, but golang is not targeted at that problem space. It's aimed at highly concurrent networked applications with a high feature turnover and large teams with varying seniority. In those areas development speed is more important than execution speed, and I'd take a few GC pauses over fighting the borrow checker any day. Plus rust ist still lacking a good concurrency story, which is spot on for golang.

Re: Learning Golang – From Zero to Hero

#15
Go's not existent standard library is almost a deal breaker for me.

The lack of even a dynamic array (c++ vector, Java arraylist) means you write a lot of 2-3 lines of slice notation phrases that require stopping and thinking about indices you wouldn't need to in other languages (and creating a lot of zero length slices for boundary conditions that shouldn't be needed). Also no balanced tree is a big issue (googles side implemention sucks in that the comparator cannot be passed in).

I recently tried to write some small library functions using sqlx to do arbitrary sql queries and then some munging of the results before returning it. It was extremely difficult.

The language feels half done at times. I find it hard to believe that Google used it much internally before releasing it. So many unfinished corners.

Generics would go a long way to fixing some of these issues.

While the ahead of time compilation is nice and had lead to me using it for things that need fast startup (some shell like scripts and literally old school cgi), it often seems like a worse Java.

If you don't like Java's verbosity, go's from my small use is about twice as bad. 300 lines of go does surprisingly little - part of this is gofmt's fault though.

Also, does anybody know of good performance tests between Java and go? I mean like well written and optimised. Most tests over I've are very poorly written and do dumb things like include hotspot startup and compilation times. Hotspot can generate some very slick code, but it just takes 10k passes to get up that point.

Re: Learning Golang – From Zero to Hero

#16

Go's not existent standard library is almost a deal breaker for me. The lack of even a dynamic array (c++ vector, Java arraylist) means you write a lot of 2-3 lines of slice notation phrases that require stopping and thinking about indices you wouldn't need to in other languages (and creating a lot of zero length slices for boundary conditions that shouldn't be needed). Also no balanced tree is a big issue (googles s…

> The lack of even a dynamic array

Are go slices not dynamic arrays? They grow automatically when necessary.

Re: Learning Golang – From Zero to Hero

#17

Go's not existent standard library is almost a deal breaker for me. The lack of even a dynamic array (c++ vector, Java arraylist) means you write a lot of 2-3 lines of slice notation phrases that require stopping and thinking about indices you wouldn't need to in other languages (and creating a lot of zero length slices for boundary conditions that shouldn't be needed). Also no balanced tree is a big issue (googles s…

I (and seemingly other people) consider https://www.techempower.com/benchmarks to be a good set of performance benchmarks for use cases many people around here would be facing. I guess they haven't been updated in nearing a year though. Go does reasonably well but apparently gets beat by Java.

More generally. I like the idea of community driven benchmarks where each community tries to make representative, performant samples to realistic problems. All too often you get an expert in one language making a benchmark against a language they are not experienced with and getting really improper results.

Re: Learning Golang – From Zero to Hero

#19

Go's not existent standard library is almost a deal breaker for me. The lack of even a dynamic array (c++ vector, Java arraylist) means you write a lot of 2-3 lines of slice notation phrases that require stopping and thinking about indices you wouldn't need to in other languages (and creating a lot of zero length slices for boundary conditions that shouldn't be needed). Also no balanced tree is a big issue (googles s…

> The lack of even a dynamic array Are go slices not dynamic arrays? They grow automatically when necessary.

I think the dynamic array in this context means an array with multiple / any types as value. Example: [1, "hello", true]

Re: Learning Golang – From Zero to Hero

#20
post #10
post #8

Earlier quoted context omitted.

I agree. I would guess the "why" is that Rust is capable of everything that Golang is capable of, except more and better. Not to mention that Rust has a very supportive community to help each other.

Clearly there's more to it otherwise Go and other languages would be a thing of the past. This is really not a topic for language flamewars and it's even against HN guidelines. I don't understand why people need to scream rust in every other language post like if it was a religion.

Devil’s advocate here : i think it’s due to the promise rust makes that borrow checkers prevent you from writing unsafe code or race conditions, as well as high level abstractions with zero performance cost.

That set of promises really would make any programmer go crazy i think, and become a zealot.

Rust is definitely on my todo list, i’m just waiting for the language to mature a little bit more, because some edges still seem a git rough. But i am extremely enthusiastic about it.

Post reply on HN