4 ms·
> My guess is that gofmt is a huge factor in this It really is. My code looks like your code and the next person's code. Go is opinionated and strict and that
by nkozyra 7y ago
> My guess is that gofmt is a huge factor in this
It really is. My code looks like your code and the next person's code. Go is opinionated and strict and that makes reading other people's code so much easier
- thatswrong0 7y agoI wish gofmt would let you set a desired line length and break it for you.. prettier has me spoiled in that regard
- mcbits 7y agoIf a tool is going to enforce line length limits, I'd rather have it spit a warning/error than silently try to guess a good place to break the line automatically. Otherwise, an editor tool that soft-wraps long lines at the (often poorly) guessed location without touching the code would be better.
- thatswrong0 7y agoBut that’s the thing about prettier - it wraps exceptionally well because it actually parses the AST. I never think about how I space my JavaScript anymore because it always does it correctly.. it’s one less thing to get in my way when I code
- mcbits 7y agoThe number of options that prettier exposes (despite boasting about being "opinionated", i.e. disregarding the user's opinions) suggests that there are people with different aesthetics or accessibility needs who would not consider one style to be always correct. IMHO we're about 10 years overdue for committing a canonical representation of that AST to version control instead of treating a particular serialized visualization of it as the single source of truth (and spending countless hours debating which format is "good enough" for everyone in every situation).
- hacknat 7y agoYou can always set your defaults for your editor.
- erik_seaberg 7y agoExperts' code should be clearer and more concise than novices' code. If that's not true, there's no payoff for getting more proficient with the language, and it's not doing enough to help you.
- nkozyra 7y agoThis is about readability. There are many other attributes of code (idiomatic? design? efficiency?) that differentiate. But I should be able to grok anyone's code within reason.
- oftenwrong 7y agogolang is not primarily designed for experts "The key point here is our programmers are Googlers, they’re not researchers. They’re typically, fairly young, fresh out of school, probably learned Java, maybe learned C or C++, probably learned Python. They’re not capable of understanding a brilliant language but we want to use them to build good software. So, the language that we give them has to be easy for them to understand and easy to adopt." – Rob Pike
- pjmlp 7y agoIronic in a company that prouds itself of PhD hiring games.