DEV Community

Discussion on: Javascript var, let and const

Collapse
 
calvintwr profile image
calvintwr

A good starting thought, except you will run out of generic namespaces like key or name very soon 😂. So the thinking behind “should I const it?”, should be whether is it generic? If so, use let over const.

Collapse
 
chiubaca profile image
Alex Chiu

my other convention is to never allow generic namespaces haha . My code is scattered with long descriptive variable names.

Thread Thread
 
calvintwr profile image
calvintwr • Edited

Actually so are mine. I tend to be a little verbose.

However, I'm quite drawn by Ryan Dahl's (guy behind Node and Deno) style.

So nowadays I'm a little bit of both.

The other trick I learnt is that your eyes can read text with missing characters in-between, as long as the start and the end characters remains the same. So you can start to shorten using this trick.

var nvrAllow, gnrcNmspaces