Live data from Hacker News

Python Is Easy. Go Is Simple. Simple != Easy

preslav.me

291–300 of 313 posts

Re: Python Is Easy. Go Is Simple. Simple != Easy

#291
post #180

Earlier quoted context omitted.

I think the key question is how robust a type system can be while keeping compilation extremely fast. Slow compilation absolutely destroys developer productivity.

Yep this is one of the reasons lots of my friends switched to Go: short compilation time (like good old Pascal days). Rust & Haskell is a big no :p

Additionally, codegen and templated metaprogramming is very fast in go. Gen + Compile + Lint + Test on Save with line-by-line coverage overlay in <10s.

Re: Python Is Easy. Go Is Simple. Simple != Easy

#292
post #271

Earlier quoted context omitted.

This roughly lines up with my feelings. Go is a solid improvement over many languages that we inherited from the 70s, 80s and 90s. But it also retains a certain "we don't need a robust type system; weak-ish static typing is good enough" ethos that made sense in back then, when compilers were hard enough to write that it was easier to justify making the programmer handle more things manually for the sake of simplifyin…

Language design is always easier in retrospect. It is harder than it looks, and often harder than the people designing a language realize before it is too late. I think it was a good choice to take smaller steps and try to not be too ambitious too soon. Sure, Go isn't the most sexy language from an academic point of view, but it has a certain conservative and pragmatic approach that does work. It does generally resul…

> Go is an engineering language - not an academic exercise.

Great summary. I personally think Scala is the antithesis to Go, it being an academic exercise - with complexity and tooling to boot.

re: Java generics, I've got this comment from 2015 bookmarked, it's a great explainer about the decision process behind adding generics to Go and the problem(s) with Java's implementation: https://news.ycombinator.com/item?id=9622417

Re: Python Is Easy. Go Is Simple. Simple != Easy

#293

Earlier quoted context omitted.

This roughly lines up with my feelings. Go is a solid improvement over many languages that we inherited from the 70s, 80s and 90s. But it also retains a certain "we don't need a robust type system; weak-ish static typing is good enough" ethos that made sense in back then, when compilers were hard enough to write that it was easier to justify making the programmer handle more things manually for the sake of simplifyin…

I think the key question is how robust a type system can be while keeping compilation extremely fast. Slow compilation absolutely destroys developer productivity.

I'm wondering if there will be a language that compiles to Go, like Typescript is for Javascript, that adds a stricter type system (and fixes other issues) and adds a compiler step, but still has all the other benefits of Go.

Re: Python Is Easy. Go Is Simple. Simple != Easy

#294

Earlier quoted context omitted.

I think the key question is how robust a type system can be while keeping compilation extremely fast. Slow compilation absolutely destroys developer productivity.

Conversely I could go longer between compiles if the type system caught more.

It doesn't even have to affect compile times per se, it could be a linter/checker task running separately from the main compiler; most type errors are only relevant during development in my experience. Said experience lately is a lot of Typescript, where all type information is no longer relevant at runtime because it's compiled out or just bluntly removed to make it valid JS (I dunno how the TS compiler works).

Re: Python Is Easy. Go Is Simple. Simple != Easy

#295
post #273
post #67

Earlier quoted context omitted.

I tried Go for about a day, and the exception handling and null-pointer issues were exactly the things that made me lose interest.

One day is not enough to even get a superficial understanding of any language. People tend to always exaggerate how little time it takes to learn a language to a meaningful degree. Sure, the first day I tried Go I was able to accomplish something useful, but it took me a few months to develop a basic understanding of how you use Go in an idiomatic manner. I'd say it took at least a couple of years before I could say…

I disagree; you can learn 90% of Go in an afternoon. However, you also do have a point; the power of Go is not apparent in an afternoon, but in longer term and larger projects spanning years or decades, and hundreds or thousands of developers. It was made by and for Google to solve Google's problems, which include millions of LOC written and read by thousands of engineers over the span of decades.

So while at first you think "eww, err != nil everywhere", at least in a decade of reading your own or someone elses' code you'll know exactly what's going on.

How many languages are similar? I feel like a lot of languages in the past decade have had a steady migration in things like error handling, so 10 year old Java code is incomparable to today's Java. Whether that's a good thing (the language has evolved and is now more ergonomic) or a bad thing (I no longer know what's going on here) is the big debate.

Re: Python Is Easy. Go Is Simple. Simple != Easy

#296

Earlier quoted context omitted.

I feel like the pointer stuff you could handle safely in a modern language. Because I think pointer and array notation are convertible so one isn't scarier than the other. But yeah not being able to tag pointers as 'can't be null' and have the compiler enforce that ignores everything we've learned in the last 40 years. You shouldn't be able to pass a potentially null pointer to a routine that can't deal with it. You…

Using pointers just to get a 'null' is just an annoying hack reflective of poor design. Instead, "no value" should be able to be directly represented.

In Go that's the zero value, which is usually things like empty string, 0, [], etc; in most cases that's good enough.

Re: Python Is Easy. Go Is Simple. Simple != Easy

#297
post #37

Earlier quoted context omitted.

I used Go for many years. My issue is that it's _almost_ a great language, but in its current version it's just a collection of foot guns that makes it difficult to get shit done. Go doesn't have some of the most library functions, so large codebases shared between teams end up with a dozen different implementations of functions like "minimum" or "filter". Good luck debugging a bug in one of the implementations. The…

A general "min/max" function could be implemented with Generics?

And has, since Go 1.21, but that's very recent so everything written before August this year may have the problem of a min/max utility and the like: https://go.dev/blog/go1.21

Re: Python Is Easy. Go Is Simple. Simple != Easy

#298
post #181

Earlier quoted context omitted.

Haha you're spot on. In the codebase I inherited that was everywhere.

You can do crazy things in any language if you try hard enough.

The trick to efficient Go is to not try hard, lol

Re: Python Is Easy. Go Is Simple. Simple != Easy

#299

Earlier quoted context omitted.

> geniuses That's very strong language. Go was created by some smart people that have completely ignored programming language developments that happened after the 70's.

Ironically, we had more advanced languages than Go in the 70s.

Yeah, but advanced languages are also a problem for long-term maintainability.

Remember, Go was developed at Google - jokingly, while waiting for stuff to compile. They deal with tens of millions of lines of C++ written by thousands of engineers with varying skill levels and career paths. The advancedness of C++ did not reduce the compile times or readability of the code. At those scales you can't rely on being familiar with a particular section of code; you need to be able to drop in anywhere and know what's going on, without having to learn which subset of the advanced language they used for that particular feature.

Go is not advanced by design.

Re: Python Is Easy. Go Is Simple. Simple != Easy

#300
post #5

No matter what your opinion is about Go (as a language), but they nailed it for bigger projects. Go code always looks the same, performance is predictable and fast enough for most programs, and its really, really easy to be productive. When i picked up Go i basically got shit done without ever having written a single line of Go. Its statically typed (with generics yey!) and compiles very fast. Its easy to create smal…

Don't forget the fact that it doesn't have this overbloated concept of inheritance and polymorphism of let's say Java where you have to look through 6 files to understand what's even going on. Even generics in Go were a heated debate because they make the language more complex. All in all Go was created by geniuses and it shows.

They may be geniuses, but some - mainly Ken Thompson - are also luddites, eschewing things like syntax highlighting. I mean they have a point - if you need colors to make your code readable, your code isn't readable.

But yeah, I love how everything is well thought out and they just say "no" a lot.

Post reply on HN