Earlier quoted context omitted.
> He wasn't bad as an engineer, but he had this crazy OCD to a point that even keys in YAML file should be ordered alphabetically. Eh, I am guilty of that (for myself, I don't run around other people's code). I don't know if it's OCD but I clearly remember the moment I decided to order keys (in yaml, json, etc.): after a debugging session where I lost time because I was scanning whole lists with my eyes, looking for…
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 -…
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.