News for hackers. Stuff that matters.
Re:The Value in Go’s Simplicity by BurningFrog on Saturday November 16, 2019 @11:27AM (#21553410)
As someone who thinks readability is the¹ most important quality of source code, that makes me less interested in learning Go.

¹ Yes, even over correctness.

Re:The Value in Go’s Simplicity by tfha on Saturday November 16, 2019 @12:42PM (#21553843)
That's really strange to me because I find go to be very readable. There are so few approaches to each of the basic programming building blocks in go that once you have read a moderate amount of idiomatic go, everything else just feels easy.
Re:The Value in Go’s Simplicity by dnautics on Saturday November 16, 2019 @01:41PM (#21554202)
There are far more readable languages in go. Go also encourages nested conditionals which can become a nightmare to trace when you're under duress.
Re:The Value in Go’s Simplicity by tfha on Saturday November 16, 2019 @01:54PM (#21554252)
Maybe I'm missing something but Go _discourages_ nested conditionals. There are even static analysis tools in the idiomic toolkit which tell you when your conditionals can be simplified.
Re:The Value in Go’s Simplicity by thiht on Saturday November 16, 2019 @01:59PM (#21554275)
No it doesn't, quite the opposite actually. Go favours "exit early" strategies
Re:The Value in Go’s Simplicity by BurningFrog on Saturday November 16, 2019 @11:24PM (#21556559)
I'm only responding to my parent post's arguments. I don't know much about Go myself.
Re:The Value in Go’s Simplicity by tensor on Saturday November 16, 2019 @03:56PM (#21554894)
This philosophy is about as far from what I value as it's possible to get. An easily understandable program that doesn't solve the problem is worth absolutely nothing. In fact, if it's code someone is depending on it's probably worse than no code at all. In some applications it could even cost people their lives.

Correctness is a basic starting point. It's the minimum viable offering.

Re:The Value in Go’s Simplicity by BurningFrog on Saturday November 16, 2019 @11:28PM (#21556564)
That's the most common opinion, and the one I used to hold.

Here is my counter argument.

Readable code that has some bugs is fixable. Because you can understand what it's doing and how to change it.

Working code that is unreadable is basically dead. No one can make changes to code they don't comprehend. The only thing it's good for is running it as is, much like a compiled binary.

Re:The Value in Go’s Simplicity by acheron9383 on Saturday November 16, 2019 @04:51PM (#21555214)
That old adage, the best code is the code not written. Programs have to solve a problem to be worth anything.
Re:The Value in Go’s Simplicity by zer01 on Saturday November 16, 2019 @03:02PM (#21554611)
I'm firmly in this camp as well. A strong code quality metric is how easily understood something is - we write code in all sorts of states of minds at all hours of the day. If others can read your code and understand it, it means you can too when it's time to extend/modify it. This is also why things like Ruby's over reliance on metaprogramming bugs me - sometimes duplication is fine, and I'd much rather have some duplication than a wrong (or hard to discover) abstraction.

The argument that "all code gets sloppy so let's just have very verbose code from the get-go" is pretty insane to me.

Re:The Value in Go’s Simplicity by teunispeters on Saturday November 16, 2019 @01:50PM (#21554235)
aesthetics are relative, not absolute.
Re:The Value in Go’s Simplicity by BurningFrog on Saturday November 16, 2019 @03:08PM (#21554640)
Readability to me is about clarity, not aesthetics.

How easily can people understand what this code does and how?

This is at least conceptually objectively measurable, though I don't know of any actual attempts to do so.

Re:The Value in Go’s Simplicity by teunispeters on Sunday November 17, 2019 @03:42AM (#21557103)
That's important. But why I say relative - is because the structure and language of readability is dependent on the code culture one is working within, not an outside measure.

That's why things like C coding style is so variable - sometimes within the same body of code (see net-snmp ....)

I'd rather have consistent coding standards but I daily deal with different team projects with different conventions, so I'm used to adapting my own reading conventions as I switch contexts.

Keep a common aesthetic within a project. It's worth it - by measure of success of a project.

Re:The Value in Go’s Simplicity by BurningFrog on Sunday November 17, 2019 @05:07PM (#21560339)
This might be bad for maintaining a lively argument in this thread, but I fully agree with that.