You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In light of that definition, Does this look right to you?
(the way Latest Safari handles const .)
Should you be relying on const to write error free code when its behaviour is inconsistent across "Modern Browsers"...?
But I can still use const in my Node.js Code because V8 has "consistent" behaviour, right...?
Why are you writing Node.js (JavaScript) code in the first place?
Is it because JS is a "better" programming language (for servers) than Go or Rust? (hint it isn't!)
Or because Node.js offers us the chance to write One Language Everywhere...? (and thus only have to learn one thing to be productive on a development team ...)
Writing "full-stack" or "universal" (what used be called "isomorphic") JS is the whole point of using Node.js in the first place. So if you're going to write code for the server that cannot run in browsers without "transpilation", you are totally defeating the objective and might as well be using "Rails".
If we have to keep context-switching between server and client code (i.e. remember when we can/can't use const) we're losing the benefit of writing code that "_Works Everywhere_TM" ... why not type fewer characters (i.e. var) and just write better (fewer lines of) code where it's obvious if someone is trying to re-assign or re-define a variable that should not be changed? we even have a convention for values that should not be altered: var CONFIG = 'don't change this' a declaration in ALLCAPS is one you shouldn't modify. see: http://nodeguide.com/style.html#constants i.e. it's obvious to your team members what your intention is and you can still write 100% portable code.
At the time-of-writing const has good support in most browsers (on the surface) http://caniuse.com/#feat=const suggests that 96% of browsers (in use) support the feature.
Depending on your target audience you may need to still be supporting Internet Explorer 10 ... 😞
in which case you will need to "transpile" const to var ... unless you are already using a "transpiler" in your project, it can be quite "expensive" to download/adopt one: dwyl/learn-closure-compiler#1 (comment)
The text was updated successfully, but these errors were encountered:
const
the most missused / missunderstod feature of ES6...?The MDN description is:
In light of that definition, Does this look right to you?
(the way Latest Safari handles
const
.)Should you be relying on
const
to write error free code when its behaviour is inconsistent across "Modern Browsers"...?But I can still use
const
in my Node.js Code because V8 has "consistent" behaviour, right...?Why are you writing Node.js (JavaScript) code in the first place?
Is it because JS is a "better" programming language (for servers) than Go or Rust? (hint it isn't!)
Or because Node.js offers us the chance to write One Language Everywhere...? (and thus only have to learn one thing to be productive on a development team ...)
Writing "full-stack" or "universal" (what used be called "isomorphic") JS is the whole point of using Node.js in the first place. So if you're going to write code for the server that cannot run in browsers without "transpilation", you are totally defeating the objective and might as well be using "Rails".
If we have to keep context-switching between server and client code (i.e. remember when we can/can't use
const
) we're losing the benefit of writing code that "_Works Everywhere_TM" ... why not type fewer characters (i.e.var
) and just write better (fewer lines of) code where it's obvious if someone is trying to re-assign or re-define a variable that should not be changed? we even have a convention for values that should not be altered:var CONFIG = 'don't change this'
a declaration in ALLCAPS is one you shouldn't modify. see: http://nodeguide.com/style.html#constants i.e. it's obvious to your team members what your intention is and you can still write 100% portable code.At the time-of-writing
const
has good support in most browsers (on the surface)http://caniuse.com/#feat=const suggests that 96% of browsers (in use) support the feature.
Depending on your target audience you may need to still be supporting Internet Explorer 10 ... 😞
in which case you will need to "transpile"
const
tovar
... unless you are already using a "transpiler" in your project, it can be quite "expensive" to download/adopt one: dwyl/learn-closure-compiler#1 (comment)The text was updated successfully, but these errors were encountered: