3 ms·
Autoformatters got popular was because a lot people don't care about formatting, and those who do care can't win against the auto part of autoformatters. It wo
by omoikane 2y ago
Autoformatters got popular was because a lot people don't care about formatting, and those who do care can't win against the auto part of autoformatters.
It works for go because gofmt was there from the start, so even if you are returning a multi-dimension array and elements come out unaligned, that's just accepted as how it is and nobody cares. For other languages, people will have to either accept "not caring" as becoming the norm, or actively fight the autoformatter from steamrolling over their code.
For people who would give more thought to how their code would be read, autoformatters were often more frustrating than "nice".
- YZF 2y agoInteresting enough people still find things to argue about even with gofmt and goimports. The order of imports and maximum line length are two examples. I imagine if those were done by gofmt/goimports then people would argue about other things. It's why we can't have nice things... Autoformatters do help though.
- freedomben 2y agoYes precisely this. I worked on a team in C++ that vertically aligned things, and at first it seemed like extra work but once I started seriously reading the code, I had an epiphany of realization that it is an amazing improvement in readability, but also makes it super easy to find certain bugs, and also do block editing in tools like vim. After leaving that team, I found that everywhere I tried to introduce this people just shrugged and rolled an auto-formatter over and told me that it's not worth thinking about. IMHO autoformatters are awesome until there's something you care about that the implementers didn't care about, then they are horrible. Problem is, the people who put a lot of thought into those decisions are often in the minority and tend to lose the argument.