3 ms·
> 4 is as you say purely opinion I mean sort of opinion, it’s a pretty solid fact that there is less TO read, maybe you can argue that doesn’t make it more rea
by hitpointdrew 4y ago
> 4 is as you say purely opinion
I mean sort of opinion, it’s a pretty solid fact that there is less TO read, maybe you can argue that doesn’t make it more readable.
Go
package main
import "fmt"
func main() {
fmt.Println("Hello, World")
}
Python
print(“Hello World”)
Seems like a no brainer to know which one would be easier and faster to develop sysadmin scripts in from the above alone.
- kcartlidge 4y agoWhat you've shown is that Go takes 5 times as many lines of code, but this is a trivial example based on boilerplate. Once you scale your codebase up beyond a handful of lines the percentage which is actual boilerplate becomes negligible and this example ceases to be valid. As an aside, I can't deny that on a per-line or even per-scope basis Python is often more readable. But at the meta level where you're dealing with an entire codebase, which to me is more relevant, the structural aspects come into play and that's where it devolves into pure opinion. In other words, comparing for readability across a handful of lines is not valuable unless you're only dealing with codebases which are also only a handful of lines. Of course the main driver of this thread is script files, and for readability Python probably does win as they tend to be short. But I'd argue that as long as something is readable enough (which Go is) then other factors like performance may need to come into the decision.