Open milelo opened 2 weeks ago
Thank you for the report. There is a pretty thorough discussion of this behavior on Issue #60. I also have a comment on this Clojureverse thread that is relevant.
The tl;dr is: use a comma ,
to "hold" the parens on the next line in cases where you think it is important to keep this formatting. This explicitly communicates developer intent that "these comments are important, and they should be located right here".
I often temporarily comment out lines during development for alternative implementations
Standard Clojure Style is a tool that is primarily designed for "code at rest" as opposed to "code in flight". In the examples above, is this the desired final state for this code? Or something where the developer is still playing around with things and exploring options? IMO, it looks like the latter.
I am not suggesting "this code is bad", or "you're doing or wrong", or anything of that nature. If we were working on a team of ~20 developers and I saw this code on a Pull Request, I would probably say something like "Can we clean this up a little bit before merging?". And maybe in that context Standard Clojure Style might nudge the author to do that without intervention.
Ok thanks for the comments. My assumption was, as a proposed standard, it would be desirable to use all the time including during development, likely run on save and by all Clojure users no matter their proficiency or desired code quality. As such I think this policy would potentially be annoying for many who are unlikely to know these tricks; incidentally the "," trick doesn't work in Calva. It would seem more intuitive for users who would like the comments after the closing brackets to put them there and not force this on all users. I've no desire to enter the debate but this is my contribution and opinion as a more casual user.
I often temporarily comment out lines during development for alternative implementations etc. standard-clj moves some of these comments which is very unhelpful for me:
Before
After
Also:
After:
I also find this formatting unhelpful, if I want to add an extra parameter to the end I will have to relocate the comment as well which is likely to get missed.