4 ms·
unfortunately, 'readability' is fairly subjective. I was part of a group recently that spent a good couple hours every week arguing whether 'ctxt' or 'context'
by convolvatron 5y ago
unfortunately, 'readability' is fairly subjective. I was part of a group recently that spent a good couple hours every week arguing whether 'ctxt' or 'context' was more readable.
when confronted, they explained to me as one would a child, that they cared deeply about code quality
- _nhynes 5y agoThat's ridiculous. Obviously `ctx` is the most readable.
- maze-le 5y agoIts obvious from the context that "c" is the only variable name that should represent a context.
- deleted 5y ago[deleted]
- deleted 5y ago[deleted]
- mpalczewski 5y ago> when confronted, they explained to me as one would a child, that they cared deeply about code quality these people sound useless. Readability as it applies to code is how easy it is to read the code and understand it in relation to how complicated the problem domain is.
- Bjartr 5y agoThe best choice is whichever is more consistent with the surrounding codebase. For an outsider to the codebase, you could argue for 'context' being better, But to someone familiar to the codebase, if contexts are always in a variable 'ctxt', then 'ctxt' will instantly parse correctly without a hitch since it'll be interpreted as a single symbol.
- TheCoelacanth 5y agoThere's a simple test for readability. Someone familiar with the codebase reads the code and tries to understand what it does (a.k.a. a code review). If it takes a low effort, then it's high readability. If it takes a high effort, then it's low readability.