3 ms·
When I write in Go I spend almost all my energy thinking about the thing I am writing, not the language. It's a breath of fresh air, like modern C with a safety
by api 7y ago
When I write in Go I spend almost all my energy thinking about the thing I am writing, not the language. It's a breath of fresh air, like modern C with a safety lock on the footgun.
I learned how to code "thin" low abstraction C++ and un-clever dynamic code in languages like Ruby and JS as I matured as a programmer, but it takes discipline. When I was younger I fell like so many others into the trap of showing off my command of languages instead of showing off my command of algorithms and ability to solve problems elegantly.
I don't find Go that ugly, especially with standard 'gofmt' formatting. It's so simple the brain learns to parse it as effortlessly as the compiler.
The brilliance of a program is its results / its complexity, with the greatest code ever written being simultaneously the simplest and most impactful.
Go makes that maturity natural and easy. I think it's a great influence on the programming zeitgeist as well as a nice language.
Haven't tried Rust yet but my impression is that its somewhere between C++ and Go. Can anyone comment on Rust's cognitive load?
- steveklabnik 7y agoRust has an interesting relationship with cognitive load. At first, it is fairly high. But then, at some point, stuff just clicks and it drops dramatically. How long that takes depends on the person, they’re background, how much support they have, etc. As a random anecdote, we had a team at work who started a Rust project, and it took them a month or two to get going. Now they’re sailing quite smoothly. (We have other teams as well but I’m only really familiar with the process for one of them.) The reason for this is that you have to learn to work with the compiler and its rules. At first, that’s a struggle. But later, it’s just helpful, and you have to think about things way less because the compiler is helping you keep track of them. It’s like a pair programmer.
- tfha 7y agoHave you used a lot of go? I'm a big fan of rust and definitely like rust devs and the rust community, but I find that people haven't used go enough to "get" it don't really understand just how much it can take away from cognitive load. Rust and go are not really comparable in this regard, even if rust is much better than most people realize. There are too many ways to approach a problem in rust. That said, definitely there are plenty of places where rust is a much better language choice than go
- steveklabnik 7y agoI’m not making any point about Go in my post, not trying to compare them, only to speak about Rust’s situation here, since that’s the question that was asked. I have written some, but not a ton, of go. It is opinionated in ways that are very different than my own opinions, and so I didn’t enjoy it very much. That said, I deeply respect the Go team, and am glad others really like it. I’m not really the best person to compare the two languages, which is why I try not to do it.
- api 7y agoThat sounds promising. Reminds me of C++ RAII memory management patterns.
- steveklabnik 7y agoYes, we use RAII extensively.
- takeda 7y agoIt's nothing like C, it is closer to Pascal or actually Algol.