Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

How much JS have you actually written?

It is a crap language designed in an afternoon and nowhere near good enough to solve the problems we currently use it for.

Just a few things of my head: 'this', 'var', no integers, semicolons, no block scope.



I have written a lot of JS since my humble beginnings in 1997 where I wrote an "ajax" chat system running down to Netscape 2 and IE3.

There's no point in dismissing JS due to simple lexical issues; those have in no way prevented us from maturing the language use through idioms, patterns, tools and collective knowledge.

JS is more than good enough as a basis for CoffeeScript and Emscripten - so why should we care whether scope context or a lack of block scope can be initially confusing?


"var" and "no block scope" are horrible.

"No integers" is bad.

"this" can swing either ways. It provides some cool possibilities.

"semicolons" however (either the presence or the removal of) is a totally inconsequential and trivial syntactic thing.

Removing semicolons doesn't even buy you what a small amount of syntactic sugar buys you. You saved a few keystrokes. Big fucking deal.


I'ver never understood how the "this" thing actually brings possibilities. If anything, it introduces unnecessary confusion about scoping/binding. Python and Ruby don't have "this" and do just fine.


Well, Python has "self", that you have to explicitly pass. Not the best example.


But Python's methods already have self curried in. Class.foo(self, x) takes two arguments, but instance.foo(x) already has self bound, and only takes on argument.

This lets you do bar = instance.foo; bar(x) and it'll still work. Much more consistent.




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

Search: