top | item 7477288

(no title)

mantrax3 | 12 years ago

And a bunch of people coming out of their caves to tell us how JavaScript's quickly cobbled up hacky prototype system is a design by God himself, and everything else is the Devil trying to trick us into his Java ways... Sigh.

Which is why the next versions of JS (ES6 and ES7) will have:

1) Modules (namespaces)

2) Classes

3) Member visibility

Whoops. Ignore the cognitive dissonance and continue with the flame!

Now. While the library linked here isn't the prettiest thing I've seen, I immediately get it. And I can immediately start coding in it and get the expected behavior.

This, in itself, is a huge feature compared to the awkward incantations one has to do in barebones JS to do OOP (of any kind). Even the fact it's string based doesn't make it inferior to some of the other unreadable stuff I've seen by people doing JavaScript "properly" (or so they think).

So, I say kudos about that. Here we have an implementation solving a practical problem in a practical way. No plot twists and surprises.

I prefer TypeScript, but this one doesn't require a parser, so it has its benefits.

discuss

order

TheZenPsycho|12 years ago

I assume this message is aimed at me. I'm not worried about ES6. ES6 classes are just syntactic sugar over prototypes, so it'll still confuse the FUCK out of java, c#, c++ and flash developers, because they are still SEMANTICALLY weird and confusing to people used to classical inheritence.

So I'm happy about that. As long as Java developers are unhappy with something, I likes it.

The awkward incantations you speak of are indeed awkward, I will admit.

I mean, how fucking confusing is

    Object.create({ your prototype here });
am I right? This is much better:

    MySpecialFramework.extend({ my prototy.. .*ahem* class here! })