Hacker News new | past | comments | ask | show | jobs | submit login

Yea, when people try to rebuild all the fanciful embellishments of classic OOP GUI programming in JS, they're going to have a hard time. Unfortunately I've had to maintain this kind of code in the past. Don't use 'this'. I'm afraid that the addition of the 'class' keyword in es6 will make this tendency worse in some programmers. Along with block scoping, it's a feature lobbied for by people who don't actually code much JS.



And that's JavaScript's fundamental problem: it's full of attractive nuisances that have the nasty property of silently doing the wrong thing. 'this', 0=='0'==false==[]!=[], global variables by default, objects that are almost-but-not-quite maps, for-in-oops-forgot-hasOwnProperty, etc, etc.




Applications are open for YC Winter 2020

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: