r/Clojure • • Nov 02 '21

Everything is Wrong

https://metaredux.com/posts/2021/11/02/everything-is-wrong.html
77 Upvotes

26 comments sorted by

View all comments

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.

4

u/TheLastSock Nov 02 '21 edited Nov 02 '21

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.

10

u/InternationalCod3155 Nov 02 '21

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

6

u/[deleted] Nov 02 '21 edited Nov 02 '21

[removed] — view removed comment

0

u/[deleted] Nov 02 '21

[deleted]

1

u/deaddyfreddy Nov 03 '21

and this makes the first 2 slightly easier

I wouldn't be so sure, I've seen a lot of aligned Clojure code which made my eyes bleeding

0

u/[deleted] Nov 04 '21

[deleted]

1

u/deaddyfreddy Nov 04 '21

It's just a half assed way of reintroducting tabs

definitely!