|
|
|
|
|
by kubami
1889 days ago
|
|
IMHO having this as a rule that keys in dictionaries are sorted alphabetically can be a valid rule.
But this should be enforced in tooling, not "rules", and not through micromanagement.
Much like using opinionated code formatters - like `prettier` you mention. It makes lives of everyone easier down the line. Sometimes this comes from years of experience (mostly pain ;)). Some leaders, while coming from a good place - I want to help you, and others, avoid pain in the future - communicate it very badly - do it like that... because I say so! |
|
Ordering keys to prevent randomness is very helpful to spot changes when using "git diff", doing code reviews, comparing files side by side.
Often it helped me spotting bugs due to a missing or unwanted element.
I wish code linters had enabled by default with the ability to disable it with some simple syntax.