DEV Community

Discussion on: Abbreviations in code: yay or nay?

Collapse
 
curtisfenner profile image
Curtis Fenner

Changes like abbreviate to abb are bad because there is no "standard" way to alleviate. Whatever you might save in typing/reading speed from going over a shorter word, you lose in the cognitive effort of matching the shortened version to an actual word.

IDEs (or advanced text editors) obviate most of the need to abbreviate -- you have auto complete and can find all references to a name with a click.

At a certain point, though, things can get too wordy, and you can establish a standard abbreviation, and usually use that form (eg ctx for context) -- but only do this if the word comes up a lot unavoidably, but doesn't mean anything.