Live data from Hacker News

Learning Golang – From Zero to Hero

milapneupane.com.np

41–50 of 76 posts

Re: Learning Golang – From Zero to Hero

#41
post #24

Earlier quoted context omitted.

No language is a thing of the past, since there are lots of projects and codebases written in it. Hell, people still using PHP and Perl. But they are not the first choice for starting a new project. What will happen is that with time no greenfield project will be started with Golang and it will gradually become a legacy language.

Vague statements like this contribute nothing to the conversation. Specially when they go against data https://www.jetbrains.com/lp/devecosystem-2019/ > Go - The most promising programming language. Go started out with a share of 8% in 2017 and now it has reached 18%. In addition, the biggest number of developers (13%) chose Go as a language they would like to adopt or migrate to. And this https://research.hackerrank…

Not really defending the vague statements of the person you're replying to, but I'd take those surveys with a giant grain of salt. There's just too much selection bias at work. I for one struggle to imagine how any company could ever induce me to take one of these surveys, and I doubt I'm that special a snowflake. 49% of devs have used python in the last 12 months? And 50% java? Huh? Who are these people?

Probably the best we can do is analyses such as github's [1], which doesn't rely on people responding to marketing emails to reach a conclusion - but I'd say even that is very far from the big picture. Most large IT organisations still run their version control, for example. Hell, I'm still coming across PHP and JS programmers in 2019 that don't use any source control. Professionals. At agencies. Yeah.

None of this is to rain on golang's parade - it's a solid language IMO, despite the hype around it encouraging many people to, again IMO, optimize prematurely. Just to remind that an output is only as good as its inputs.

[1] https://github.blog/2018-11-15-state-of-the-octoverse-top-pr...

Re: Learning Golang – From Zero to Hero

#42
post #24

Earlier quoted context omitted.

No language is a thing of the past, since there are lots of projects and codebases written in it. Hell, people still using PHP and Perl. But they are not the first choice for starting a new project. What will happen is that with time no greenfield project will be started with Golang and it will gradually become a legacy language.

Vague statements like this contribute nothing to the conversation. Specially when they go against data https://www.jetbrains.com/lp/devecosystem-2019/ > Go - The most promising programming language. Go started out with a share of 8% in 2017 and now it has reached 18%. In addition, the biggest number of developers (13%) chose Go as a language they would like to adopt or migrate to. And this https://research.hackerrank…

It's "vague", because it's a statement about the future.

Unfortunately I don't have data from the future, but I do have a good intuition about the future trends ;)

Re: Learning Golang – From Zero to Hero

#43

Earlier quoted context omitted.

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…

I don't do any a lot web stuff but most of my go code is quick hacks for data analysis or display but this is still really interesting. I had a feeling go was slow, but I didn't expect such poor performance numbers. Some of that is probably the heavy reliance in reflection. For example they json parsing you need to go to the bottom of the list to find a go program, and go's json library makes extensive use of reflect…

You can use alternative packages for when you need to do things more quickly. For JSON, check out fastjson, easyjson, gojay, and more.

In real code that I write, most projects never import reflect. Sometimes I import it in tests.

Re: Learning Golang – From Zero to Hero

#44

Earlier quoted context omitted.

They are, but also very difficult to work with. For example, removing an element is a copy, followed by a slice notation. Inserting is combination of appends and slice notation. You don't get simple methods like insert(index,item). Also if you are growing the slice in a function, you need to find a way to return the possibly new slice variable since append might need to realloc so you often have to resort to using po…

> You don't get simple methods like insert(index,item). This is by design, to lift the CPU and allocation costs to the foreground. You can argue that was a bad design decision, but it wasn't an oversight, as you imply in the OP.

So the AOT makes that more difficult I'm guessing? I think that go does heavy lto so shouldn't inlining at link time give the same opportunity for that?

Java's escape analysis has always been dodgy to rely on. I've had some very simple code when I couldn't for the life of me figure out why the allocations weren't being hoisted. So I don't know if gos is better or worse.

It most definitely was not an oversight, clearly intentional but I think the issues could have been solved in better ways. Better use of lto and intrinsifying some functions in slices would help a lot.

Vector operations are extremely common. Go's making them difficult to use and refusing to optimize them (lto, intrinsics, etc) just seems poor.

PS: because of the score of my top level comment I've been rate limited pretty aggressively and can't respond anymore.

Re: Learning Golang – From Zero to Hero

#47
post #18

Earlier quoted context omitted.

agree, newbie to golang, just started with go1.13beta1 which will make go-module preferred to GOPATH/workspace.

The default mode is already `auto`, which checks if you're within GOPATH (if GOPATH is set) and defaults to mod if you're not.

don't know this, thanks! I also assume you no longer need set GO111MODULE=on anymore

Re: Learning Golang – From Zero to Hero

#48
post #46

I wosh I had time to learn new languages as I used to... but with 2 kids, one being 4 months it is nearly impossible. How do others devs hungry for knowledge deal with situations like this one?

CV-driven development. AKA find an excuse to use it (and learn it) at work. At least that's what it seems my colleagues do.

Re: Learning Golang – From Zero to Hero

#49
post #46

I wosh I had time to learn new languages as I used to... but with 2 kids, one being 4 months it is nearly impossible. How do others devs hungry for knowledge deal with situations like this one?

With two young children, try to get enough sleep. All learning is more effective when you get enough sleep.

With that in mind, spaced repetition is a great technique that fits with having limited time in small blocks. Squeezing in some time here and there becomes a strength instead of a weakness.

https://en.wikipedia.org/wiki/Spaced_repetition

Re: Learning Golang – From Zero to Hero

#50
I love reading articles like this. I really want to find a good work related reason to learn Go, just not a thing right now.

My main concern with the article is the massive abundance of typos. Like more so than a normal article written by a programmer. They make me stop and double check if I read it wrong, it is a term or something I haven't seen before, or just a typo.

Post reply on HN