5 ms·
There's no need to be snarky towards the person you are replying to. Just because you don't like using plain Javascript, that doesn't mean others aren't allowed
by ihuman 8y ago
There's no need to be snarky towards the person you are replying to. Just because you don't like using plain Javascript, that doesn't mean others aren't allowed to, or that their feelings are worth less than yours.
- sametmax 8y agoIf somebody comes to a DIY expert forum and says it's a joy to use a rusty screw driver to hit a nail just because that's the only thing in his toolbox, that person is bound to get a few snarky comments.
- ihuman 8y agoThis isn’t that hypothetical forum. Here, just because someone has a controversial option, that doesn’t mean your allowed to be snarky towards them. https://news.ycombinator.com/newsguidelines.html https://news.ycombinator.com/newsguidelines.html > Be civil. Don't say things you wouldn't say face-to-face. Don't be snarky.
- wwweston 8y agoA more apt metaphor might be hand tools vs power tools, in case you someday arrive at a place where you're actually trying to explore the point, but I suppose the intentionally stacked metaphor choice is a convenient signal to onlookers.
- z3t4 8y agoYou can use Object's as name-spaces, it's somewhat common to use var global = {}; and then put all global variables in it. But I'm a big fan of scoped imports aka. require in Node.JS. Scoped import is like a global variable, but with the complexity of a local variable. I prefer function scope as it lets me declare variables where ever I want, but others prefer block scope, so either choose var or const and stick to it. JavaScript was not the only contender for the browser, Microsoft tried with vbScript, and Google tried with Dart. Then there was ActionScript (flash) and Java (applets). And also ActiveX. Then there are various compile to JS languages, like CoffeeScript, yet plain old JavaScript still seem to be the most popular. My own pain point with JavaScript is that it's getting more and more complicated. Personally I like to use the bare minimum when it comes to language features. And work with the language instead of against it, eg. I make use of null==undefined, I almost never use === unless I need to be explicit. Learn the Equality-Table! Also learn regular expressions! (but don't over-use them). Learn how to use closures, learn how to use callbacks. Then it becomes enjoyable. Bonus: Learn how to program without global variables, then use them when it's convenient. Learn how to program with only pure functions, then use impurity for convenience. Learn test-driven-development, but only write tests where they're needed. Learn how to program without an IDE (just plain text editor and command prompt), then go back to the IDE. All the great tools that exist today make you not feel the pain when writing unmaintainable code.