News for hackers. Stuff that matters.
Re:Programming Languages Are Simply Not Powerful Enough by AnIrishDuck on Friday March 01, 2013 @12:45PM (#5305710)
Most of your peeves are addressed by correctness checkers like JSLint, or have been alleviated by community projects. There's a lot of hate here, so I'm going to address your points one by one:

> I'm talking about things like its extremely broken equality operators,

Don't use language features that are broken. Use === and !== instead. JSLint complains about this.

> its extremely broken array handling (especially the behavior of the length property),

You're going to have to elaborate here, I have no idea what you're talking about.

> semicolon insertion,

Put semicolons at the end of each line manually. Or don't use crazy multiline expressions. JSLint will flag this down for you. Other languages like C force you to do this, why the JavaScript hate?

> its broken scoping,

Never put things in the global scope. Always use var. Global-by-default is annoying, but very easy for static tools like JSLint to flag and nag about.

> its lack of support for proper class-based OO,

Javascript's objects are very minimal; they can easily emulate semantics of other OO languages. In my code I usually emulate the Python copy-superclass-on-class-creation semantics of subclassing.

> its lack of support for proper namespacing and modularity,

RequireJS has effectively solved this problem for me. As per above, you should never put things in global scope anyway.

> its lack of proper typing,

If you're looking for built-in static typing, you came to the wrong place. I think it's important to remember that JavaScript the language was designed to be very minimal (IIRC the entire initial language was created in a week); in that regard, it at the very least is not a good fit for static typing. I personally wish that it had stronger types, and can agree with you here that ideally this would be different.

> and so forth.

I guess I don't see your concerns here. I prefer writing JavaScript over C and Java; it allows me far more leeway for creating abstractions through closures and anonymous functions. Think of JavaScript's problem statement: create a simple minimal universal browser-based language. It's hard to imagine a better language in JavaScript's place (Scheme is the only realistic alternative I can think of). Here's a nightmare scenario for you: we could have ended up with Visual Basic instead.

JavaScript isn't perfect, but what language is?

Re:Programming Languages Are Simply Not Powerful Enough by KingMob on Saturday March 02, 2013 @02:27PM (#5310666)
While I don't quite agree with the parent poster, half of your points involve a) best practices, which require programmer discipline, not parser smarts, b) a lint-checker, which again, is not as good as the parser itself forbidding something, or c) using certain libraries, which is not as portable and easy as direct language support.

While I agree that these issues are surmountable, I don't think you've rebutted the point that they are issues with the language itself.

That being said, no language is perfect and for being whipped up in a day, Javascript's pretty nice.