2 ms·
I’m a big proponent of verbose naming, but I suppose I should say in this context that I generally have a negative preference for terse naming. There are some e
by eyelidlessness 5y ago
I’m a big proponent of verbose naming, but I suppose I should say in this context that I generally have a negative preference for terse naming. There are some exceptions to that preference, usually deferring to idiomatic usage, e.g.:
- i or idx is often preferred over index
- fn or fun is often used where function is a reserved word
That said, I’m also cognitively sensitive to column width. I’m not “80 columns or fight”, but I definitely find longer lines of code challenging to follow. As such I prefer to balance verbosity by deferring to the context (lexical scope, imported module name/hierarchy, file name/path, general contextual assumptions that you’d already need to be effective in the codebase).
I find both extremes jarring, and there’s usually an opportunity to optimize for both local understanding and reading without reaching those extremes (of course at the expense of keystrokes/autocomplete pitfalls, but once you’ve embraced verbosity at any level that’s assumed).
- Koshkin 5y agoIndeed, the use of standardized mnemonics and abbreviations rather than this kind of extreme verbosity is the key to code readability.
- eyelidlessness 5y agowhen it’s commonly understood!