The main formatting issue I often see is people aligning the values in maps, it has so many more disadvantages than advantages and although the style guide implies you shouldn’t do it, it would be good if it was stated more explicitly. Preferably at the very top. In size 100 font.
Anyway bikeshedding aside, the clojure style guide is a fantastic resource and it’s a shame that it’s not more widely adopted.
What are the disadvantages? Clearly in some cases an outlier key length will force the others to seem odd. But then ideally i could just disable the rule on that map. I haven't come across that case in 5 years so it's fairly rare.
It creates more conflicts, it makes diffs harder to read, it’s much harder to undo than it is to do in the first place and it’s painful to manage when working in an editor without support for it (like temporary using vim for some quick edits)
Also it really isnt that much easier to read, especially when the keys aren’t similar lengths and you have syntax highlighting.
I guess ideally there would be an editor plugin that could visualise the values as aligned but not actually changing the white space
8
u/InternationalCod3155 Nov 02 '21
The main formatting issue I often see is people aligning the values in maps, it has so many more disadvantages than advantages and although the style guide implies you shouldn’t do it, it would be good if it was stated more explicitly. Preferably at the very top. In size 100 font.
Anyway bikeshedding aside, the clojure style guide is a fantastic resource and it’s a shame that it’s not more widely adopted.