I have to disagree with a lot of this, or at most give you that you are splitting some fine hairs. I can't argue that class prototyping takes some getting used to, but most programming languages have some quirk that takes awhile to grok (for me it was indentation in Python).Xenoveritas said:Not quite. JavaScript does support something similar to normal OO style, but it's actually prototype based and it takes a bit of getting used to. It's closer to Lisp than Java.argonaut05 said:Javascript is actually a pretty versatile language that includes many OOP concepts like encapsulation, polymorphism, inheritance, etc. Objects can have private, public and protected members and methods just like any other OO language. With JS, I can tell you the voltage going through your northbridge -- so, it is more useful than just a HTML add-on.
And no, all members are public unless you're doing something really evil with closures. Which, while it works, isn't quite the same thing as true data protection.
As for "telling the voltage going through your northbridge" you're obviously using some third-party library, since you can't do that directly through JavaScript. (And if you're reading something from, that still counts as "some third-party library:" in this case, the kernel.)Code:/proc
There is nothing inherently "evil" about using closures to define the scope of members or methods to an object, since this is basically what is done in Java. There are tons of blogs over on MSDN addressing it.
As for using third-party software (in the northbridge case, operating system hooks), this is essentially the same thing C++ developers are doing by using DirectX or Allegro. If you were ambitious enough, you can use Jscript.NET to write low level libraries to take the place of the OS hooks.
My original point, however, was that JS is a lot more useful and powerful than an HTML plug-in used by kindergarden kids. That's turtle. We use a lot of JS in our company's enterprise level applications, where it buddies up nicely with our C++/C# code and in many cases is desirable because it allows us to deploy quickly.