3 ms·
The hypothetical discussion about readability is pointless. Let's make it specific. Read https://google.github.io/styleguide/cppguide.html https://google.githu
by btilly 5y ago
The hypothetical discussion about readability is pointless.
Let's make it specific. Read https://google.github.io/styleguide/cppguide.html https://google.github.io/styleguide/cppguide.html for readability for a language, namely C++. All the things that can be automated, automatic tools have been written for. But, for example, you can't automate "Prefer to use a struct instead of a pair or a tuple whenever the elements can have meaningful names." Because what does it mean for a name to be meaningful?
- StillBored 5y ago"Because what does it mean for a name to be meaningful? " Are you optimizing for someone who already knows all the project lingo, or someone who doesn't know any of it? Are your engineers native English speakers? There are a whole bunch of things which make the perfect variable name frequently less than perfect, and putting project insiders in charge likely yields the opposite result. Take: https://elixir.bootlin.com/linux/latest/source/mm/khugepaged.c#L601 https://elixir.bootlin.com/linux/latest/source/mm/khugepaged... If you don't know what a vma, pte, pfn, compound_page, young pte, huge page, lru, etc your going to be unable to even begin to understand what that code is doing, despite those all being pretty reasonable variable names and actually fairly industry standard concepts. It gets worse as you move to more esoteric topics. Expanding pte to PageTableEntry might help some subset of users, but at the expense of those that work on the code daily. So who do you optimize for? Is it readable if the only people that can read it already know what it does?