3 ms·
Totally agree with this article. An Emperor-has-no-clothes situation which baffles me that more programmers don't see as obviously as I do is the following seq
by phaedrus 9y ago
Totally agree with this article. An Emperor-has-no-clothes situation which baffles me that more programmers don't see as obviously as I do is the following sequence of logic:
1. If the code format check can be automated, then the code format change can be automated.
2. If the code format change can be automated, then the change could be applied as you type, or as the code is loaded.
3. If the format change is applied as the file is loaded, it could just as easily be an editor view-setting, much like syntax highlighting or font size.
4. QED we're collectively wasting time on a lot of pointless B.S. that should just be a checkbox on the Tools... Options menu.
Or to put it another way: the fact that editor background colors, font, and text coloration are not part of plaintext files, but whitespace and line breaks are (and that plaintext files, as opposed to databases, are used to store program code) is an historical accident. One could easily imagine an alternative history in which things played out differently in terms of what is and is not a "view option" vs intrinsic to the source text.
For example, a lot of developers seem to like the white-on-black or "midnight" theme for their IDE; personally, I hate it, and prefer black text on paper-white background. I just thank goodness that that is an editor option, rather than that being encoded by the source file. If it were, maybe we'd have requirements like every source file needs to be on a black background, except for viewmodels which need to use a purple background, etc.
When I'm not forced to use a coding standard, I use line breaks, spacing, etc. to communicate whatever I think is important about a particular section of code, rather than following a prescribed format mechanically. Indeed, breaking style in a particular section can be used to show "hey, something different is happening here".
However, if people are going to get pedantic about style choices which have no effect on compiler parsing or output, I would gladly trade away this freedom of expression in return to gain freedom from code-formatting-busywork by making all of these formatting choices be part of the editor view options. Then if a busybody has an opinion about non-functional source formatting, let him change the settings on his own IDE.