Readit News logoReadit News
_will_cham_23 commented on Half a million lines of Go   blog.khanacademy.org/half... · Posted by u/nickcw
paul_e_warner · 5 years ago
I've written a bit of code in Go, and the problem I have with it is primarily it feels really outdated for a "modern" language - every time I use it I feel like I'm dealing with something written by someone who really hated Java in 2005. There are features that could be added to the language that would make it more readable and less error-prone without compromising the simplicity of the core language. Generics are the famous example, but the one that really gets me is the the lack of nullable type signatures. This is a great way to avoid an entire class of bugs that nearly every modern language I've used has evolved a solution for except Go.

Another issue I have is the reliance on reflection. In general, I think if you have to rely on reflection to do something, that usually means you're working around some inherent limitation in the normal language - and the resulting code is often far less readable than the code would be in a more expressive language. Lots of Go libraries and frameworks are forced to use it in a lot of cases because there's just no other way to express some really basic things without it.

I really want to like Go. There's a lot I like - the "only one way to do something" approach means that code always feels consistent. Errors as values is a far superior approach to exceptions. I had to write some for a job interview project a while back and it felt really refreshing, but every time I try to use it for a personal project, I don't feel like I'm getting anything out of it that I couldn't get out of say, Rust, or modern, typed Python.

_will_cham_23 · 5 years ago
>> the problem I have with it is primarily it feels really outdated for a "modern" language

It's mostly not about the language. An exception is of course when moving from a dynamically typed interpreted language to a statically typed compiled language.

The success of projects depends much more on other things than the programming language. It's about

- Processes and standards, like following a well defined structure, testing, documentation, ...

- Maintainability of code. It must be easy to read, to understand syntactically and to build a mental model of the code

- Long term reliability and stability of the eco system

- Easy and reliable tooling

- Developer efficiency, e.g. compile times

Go shines in many of the aspects. Especially in maturity, stability, amazing standard lib and tooling. As you mention Rust: This is exactly where Rust falls short. Rust is a great language with amazing people behind it. But there are reasons why its adoption in the broad real world is very, very small. The reasons are not the language. So I always feel it's a bit invasive when Rust promoters enter Go or Java threads by telling how much better Rust as a language is.

In this example Go has additional benefits being statically typed and compiled, very fast and with build in concurrency support.

u/_will_cham_23

KarmaCake day8May 17, 2021View Original