Live data from Hacker News

"14 Years of Go" by Rob Pike

codereliant.io

41–50 of 75 posts

Re: "14 Years of Go" by Rob Pike

#41
post #18

[dead]

> Performance is good enough, it's not the intellectual masturbation of Scala or Rust. As we know, any technology that would require experienced programmers to learn something is a crime against engineering.

It's more what you can afford to learn. Most of the domains I've worked in are so thick to grok that also loading in a programming language like scala or rust becomes intractable.

Re: "14 Years of Go" by Rob Pike

#42
post #19

Earlier quoted context omitted.

I know C, python, Go and Rust reasonably well and Go is usually my default choice for a new projects. Well unless it's just a quick script, in which case Python will do just fine. Tried Scala while learning Chisel and hate it from the bottom of my heart. It's like Kotlin on bad drugs. My point is, people are different.

> Well unless it's just a quick script, in which case Python will do just fine. Weirdly Go has made me enjoy Python even less and compilation is so fast it's turned into my go-to for quick "scripts."

I have not written a single python script since I learned Go in 2015. But I still prefer Java for work. Dealing with databases is just completely asinine in Go.

Re: "14 Years of Go" by Rob Pike

#43
post #17

Lack of support for operator overloading is a bit sad. As a result, Go can't get used in numerical applications, unless you like writing `matrix_plus(A, B)` instead of `A + B`. Is there a programming language that has a "simple" design like Go but which supports some operator overloading?

I once had a hard time finding a bug, and it turned out someone had overloaded assignment to the boolean member dbIsOpen in some inherited monstrosity class to open/close a database connection. Since then, I prefer functions with clear names. They may still not do what their name says, but it doesn't lull you into thinking local.

Re: "14 Years of Go" by Rob Pike

#45
post #22

Earlier quoted context omitted.

I'm really not a fan of small qol features like this. I think it really hurts readability for the general audience. The function itself is minimal overhead and is clearer to the reader.

That's true, we should get rid of operators for primitives too.

Operators for primitive types are fine, they are well defined by the language and consistent across programs. Operator overloading is going to change behavior between programs which puts extra cognitive load on the reader.

That said, Go sticks to the most basic operator implementation (strings, numbers etc...). Go doesn't support `+` on slices for instance.

Re: "14 Years of Go" by Rob Pike

#46
post #18

Earlier quoted context omitted.

> Performance is good enough, it's not the intellectual masturbation of Scala or Rust. As we know, any technology that would require experienced programmers to learn something is a crime against engineering.

It’s also really gross how we want ultra prescriptive tools that force you to write things certain ways because we can’t trust our own coworkers to write decent code. Or learn things for that matter. I guess people don’t do code review at all? This was tried before and it was called Java. But there’s always an eager generation of naive programmers willing to believe the lie that this time is different.

I'm sure this depends on engineering culture, but at Google, where Go was born, there is "one way to write C++" and that is dictated by the style guide.

You have to learn many restrictions, a number of which feel arbitrary/highly subjective, and follow that. Of course, the style guide evolves over time so it's not like legacy code is consistent with new code.

The end result is that I much prefer the Go way of having fewer options in the language, instead of having those options in the language but restricting them via policy.

Re: "14 Years of Go" by Rob Pike

#47
post #38

Earlier quoted context omitted.

Your last sentence seems fishy to me. Are you suggesting that support for C++ like operator overloading is a necessary condition for, say, autodiff? I thought Go is a Turing complete language.

Operator overloading is about syntax and type safety. Brainfuck is Turing complete.

I agree it is about syntax. But how is it about type safety?

Re: "14 Years of Go" by Rob Pike

#48
post #14

Earlier quoted context omitted.

I was with you until you slagged on the other options. Rust and Scala are designed for other use cases than yours. That doesn’t trivialize their worth.

> Rust and Scala are designed for other use cases than yours This has become a sort-of gotcha for any discussions that involve comparing programming languages, but I think it has been over-extended beyond what is reasonable. It is true that some languages are much better at certain use cases than others, and especially if you consider their ecosystems when making this determination. For example, I don't feel Go makes…

Wow comments like this keep me coming back to HN. Thank you. Super thoughtful.

Re: "14 Years of Go" by Rob Pike

#49
post #18

[dead]

> Performance is good enough, it's not the intellectual masturbation of Scala or Rust. As we know, any technology that would require experienced programmers to learn something is a crime against engineering.

experienced programmer often wants to learn just enough to take project from point A to point B as decided by business needs, and not spend nights of debugging cool stuff.

Re: "14 Years of Go" by Rob Pike

#50

Earlier quoted context omitted.

Adding matrices with A+B looks nice. But then you'll soon want to do A*B+C, and you'll find that fused multiply/add is a much faster operation than doing a multiplication and then addition, and soon you'll either be writing mul_add(A, B, C) anyway, or you'll overengineer a complex solution to make A*B return some kind of object that can recognize the subsequent + operation etc. Update: corrected * representation

You can have your cake and eat it. E.g. C++ expression templates allow you to fuse application of multiple operators.

Plenty of people are choosing Go because they neither have nor want the C++ cake. The OP was explicitly looking for a simple language, and C++ is the very opposite of that concept.

So yes, you can have efficient nice abstractions, but only at the cost of an extraordinarily complex base language.

Post reply on HN