Design for readability – A primer on code typography
medium.com> Lexicographical sorting by class-name to make things easier to find
This is weird. I've never encountered (or noticed) ordering parameters by their type names. Semantic ordering (subject, object, adverb, optionals) makes more sense to me - especially if you see type names only once at declaration, but have to guess/deduce parameters order at every call site.
I agree, I think the most relevant arguments should be first and dilute out to less relevant arguments (eg. it’ll probably still work if you pass null or zero).
Then you can typically collate your useless short arguments on one line and you don’t get wierd formatting at the call sites, right?
It does make sense. I'll experiment with a combination of the two going forward (probably semantic first, lexicographical later)
Among other issues, it breaks down completely as soon as you have subclasses of any sort.
And it's even impossible to do in some cases, e.g. default arguments in C++, which must be at the end of parameter list
I really like the look of that right-aligned thing and I wonder if it works in practise. Any way to get Emacs to do that for me?
M-x align-regexp