3 ms·
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.
by BurningFrog 7y ago
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.
- tfha 7y agoThat'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.
- dnautics 7y agoThere are far more readable languages in go. Go also encourages nested conditionals which can become a nightmare to trace when you're under duress.
- BurningFrog 7y agoI'm only responding to my parent post's arguments. I don't know much about Go myself.
- teunispeters 7y agoaesthetics are relative, not absolute.
- BurningFrog 7y agoReadability 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.
- teunispeters 7y agoThat'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.
- BurningFrog 7y agoThis might be bad for maintaining a lively argument in this thread, but I fully agree with that.
- zer01 7y agoI'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.
- tensor 7y agoThis 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.
- acheron9383 7y agoThat old adage, the best code is the code not written. Programs have to solve a problem to be worth anything.
- BurningFrog 7y agoThat'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.