DEV Community

Discussion on: Abbreviations in code: yay or nay?

Collapse
 
moopet profile image
Ben Sinclair

I steer clear of it unless it's an already existing convention in a project.

I've seen too many codebases with inconsistent names like _txt vs. _text, and really, if you think in 2019 that you're doing good work by saving one character in something that's almost certainly been autocompleted for you then you're missing the point.

Some people like being terse for the sake of being terse, perhaps because it makes them feel more clever.

I don't abbreviate without good reason, and if my variable name looks like it's going to be a 50-character sentence, I refactor.

Collapse
 
msamgan profile image
Mohammed Samgan Khan • Edited

I completely agree with ben, how much time can you save by skipping an "e" from a "user".

a variable named "user" sounds more clear than "usr".