I really want to love this language, a fast and simple garbage collected lang, but feel like they missed the spot a little. I just wish they did something different with error handling / nil, doesn't feel right for the language. Also whats up with stuff like unused imports being such a big deal?
I keep count in my own code of the number of bugs Go's "damnable use requirement" has caught for me, and I'm now up to 5. It's not a big number, but they were real bugs that would have annoyed the shit out of me if they'd made it into shipping code. I think this is one of the polarizing decisions Go made that is going to turn out to be universal orthodoxy 10 years from now. I think error handling is the thing about G…
Thirteen Years of Go
91–100 of 217 posts
Re: Thirteen Years of Go
#92Earlier quoted context omitted.
I honestly have no idea why so many hate the language but I guess the Bjarne Stroustrup rule applies. For me it's a language I always wanted to have: essentially C with a GC, small enough you can carry it in your head with most of the footguns removed. I honestly also have no idea why Rust always makes an appearance in a Go thread, I can't think of two languages with such a diametrically opposite learning complexity.
Simply because it's limiting. Which is good if you are inexperienced, but not so great once you grow and try to become more productive. A more expressive language is a must then or you'll be stuck. For some people it's this feeling of being stuck that they don't like - others can live with it more easily. > I honestly also have no idea why Rust always makes an appearance in a Go thread Both Rust and Go people are ver…
I've never been "stuck" with Go in the sense that I wasn't able to do something I wanted.
I've programmed in plenty of more expressive languages over the years, and I don't think there's much difference in terms of productivity. Sure, some more expressive languages allow you to do something very quickly and concisely, but it also increases cognitive load when writing and reading and in the end it seems to balances out. Sometimes I do find myself thinking "gosh, I wish I had $feature_x from $language_y" at times, but I have that with every language.
It's a "dumb" languages in that sense, I guess. Which is also why it's nice: you don't have to focus on the mechanics of what you're implementing, you just implement what you want, as per the "Zen of Python"; "There should be one – and preferably only one – obvious way to do it."
Re: Thirteen Years of Go
#93I've enjoyed writing Go for years. However, it's not been the language that does it for me. It's been the combination of features and ecosystem that makes it a default. It's hard to explain, but the language is one you can throw into a team of random developers and come out with benchmarks, tests, CI/CD pipelines, unified code formatting, and good parallel work models (via goroutines) almost every time. Builds are in…
Re: Thirteen Years of Go
#94Earlier quoted context omitted.
That's the FAQ. The official Language Specification says nothing about this little gimmick, at least in the if-else section: https://go.dev/ref/spec#If_statements You'd think one would want to look for it in that instead of an FAQ page.
If you looked at the spec which provides simple, valid examples that work, then why would you spend hours writing different code wondering why it doesn’t work? The section you linked does explain it, btw. IfStmt = "if" [ SimpleStmt ";" ] Expression Block [ "else" ( IfStmt | Block ) ] . Note there is no newline or semicolon between Block and the optional “else” clause, and a Block is thusly defined: Block = "{" Statem…
Re: Thirteen Years of Go
#95Why exactly is Go so special? For a compiled language it's not very fast and doesn't seem to be making much traction. I think people simply like it because of it's Bell Labs heritage and pretty syntax.
> doesn't seem to be making much traction What do you mean by this? By what metrics and what would qualify as making traction? Many companies use Go and many prominent and widely used open source projects are written in Go. > it's Bell Labs heritage I have never met a person (in person, offline) who has cared about this at all. > pretty syntax One of the most common things you hear as a knock against Go are things th…
> I have never met a person (in person, offline) who has cared about this at all.
People care about it because the language has the Bell Labs "feel". They don't care about it the way a dog breeder would care about a dog's ancestry.
(And of those who care about the "feel", some view it as a positive, others as a negative...)
Re: Thirteen Years of Go
#96Earlier quoted context omitted.
> Lack of docs, broken and confusing functionality, limited language features, bizarre operations. You are painting with a pretty broad brush, can you provide a concrete example of these?
I don't know how applicable this is, but even the basic if-else syntax can hit you with hours of frustrating struggles. The parantheses have to be arranged in a specific way that was never mentioned in the online language specs over at go.dev, otherwise the code will fail: if (cond) { return x } else { return y } works, but if (cond) { return x } else { return y } doesn't.
So your example gets transformed to:
if (cond) { return x };
else { return y };
So it is mentioned in the language specification, just as a non-obvious consequence of this.It's not my most favourite part of the language either, but at least the compiler message on it is better now (it used to complain about semicolons, which was confusing because they're not there in your source code; now it just says "unexpected else, expecting }", which is still a bit confusing but better).
I'm fairly sure The Go Programming Language book mentions this somewhere near the beginning, but some of the online tutorial/tour perhaps could be improved. There's always a bit of a balance in how much to mention.
Re: Thirteen Years of Go
#97I want to love Go, due to my background in C and UNIX sysadmin, but can't. Rust does it for me though.
This is an article about Go, not an article comparing Go to Rust. I'd say the same thing if the roles were reversed: don't start language debates. They spread like kudzu and choke everything else out of the threads.
Re: Thirteen Years of Go
#98Why exactly is Go so special? For a compiled language it's not very fast and doesn't seem to be making much traction. I think people simply like it because of it's Bell Labs heritage and pretty syntax.
> For a compiled language it's not very fast …really? Go seems blazing fast to me…
1.17 saw a major performance boost because of the switch from stack-based to register-based ABI for go function calls [1]. The release notes claimed a 5% average improvement, but benhoyt (in that discussion) has benchmarks showing much greater improvement for GoAWK.
Re: Thirteen Years of Go
#99Earlier quoted context omitted.
Docker and corresponding tools. https://github.com/abiosoft/colima And many others, really.
> Docker and corresponding tools. https://github.com/abiosoft/colima Neither sound like "applications I really enjoy". More like applications you suffer. > And many others, really. How about examples?
Sorry, I'm not here to tease or please you.
I'm pretty sure you can use google or github search to look for popular Go based projects and try them out.
Re: Thirteen Years of Go
#100Why exactly is Go so special? For a compiled language it's not very fast and doesn't seem to be making much traction. I think people simply like it because of it's Bell Labs heritage and pretty syntax.
Your comment has been good at generating some discussion around what makes Go special. Since the sibling comments already addressed everything else, I'll talk about this one: > For a compiled language it's not very fast This is essentially true, _but_ a lot of Go users are coming from Python, JavaScript, and maybe Ruby and Go is much faster. Additionally, it comes _close enough_ to Java while typically having a much…
But the memory footprint is amazing. I've got three servers plus up to 10 test environments running on one small VPS (Virtual Private Server), and everything runs as smooth as can be; memory usage stays below 1GB, leaving enough space for the db server. In a previous job, we had a Java/Tomcat server, and it was filling up memory without doing much. I've inherited a Python server in my current job, and if you don't take care, it slowly grows to 4GB. Go is really a blessing for the back-end.