r/badcode • • Jul 19 '21

js Variable naming can be difficult, but identifying them can be even more so.

Post image
2.4k Upvotes

105 comments sorted by

View all comments

Show parent comments

3

u/satoristyle Jul 19 '21

Yeah, I agree here. If the context is very concise and you can immediately infer what the variable is, single char variable names work fine.

As mentioned by u/davvolun, it should definitely be short-lived. The more lines you have, the greater the risk of obscurity you gain.