3 ms·
const x = ... it's usual to read code to understand it "helps overcome JavaScript's dynamic nature", you say that like it's a good thing
by zanethomas 5y ago
const x = ...
it's usual to read code to understand it
"helps overcome JavaScript's dynamic nature", you say that like it's a good thing
- tgv 5y agoWeren't class and const introduced in the same version? > like it's a good thing I think so. If you have full control over your own code, and you write in e.g. TypeScript, you don't need it. Otherwise, it can prevent errors that take forever to debug.
- zanethomas 5y agoThe utility of const does nothing to support adding classes to javascript. TypeScript, also unnecessary and often just a pita. I've written very much javascript and have never had a bug that took "forever to debug'. Programmers who like classes, and type-checking, and all the other syntactic sugar should, imo, just use languages that support such things and leave javascript alone. I learned a lot about programming from the SICP when it first came out. I appreciate and use the good things Scheme inspired in javascript. And with very rare exceptions, such as const, let, and enhancements to builtin objects such as arrays, I still use vanilla js. I create new objects using factory functions and have zero use for classes. However adding Map, Set, and similar objects to what is essentially the javascript library is fine with me as they do not impact the core syntax of js.