Javascript has taken over. The V8 engine makes it as fast as machine code. People are using it all over the place on the server-side as well as in web browsers. But the thing that many developers miss is that Javascript is actually a very different kind of language than its predecessors. Instead of being class-based, it is prototype-based and dynamically mutable, making it far more organic and wild. Instead of deferring to a strict hierarchical tree of class definitions like in Java, JS objects defer to other objects when calling a missing field. This makes for a structure that's more like a switching network of train lines than a branching tree limbs. (I'm a visual thinker.)
What's more, variables and functions can be easily added and removed at runtime, which has given rise to the notion of "mixins". You like the glow-in-the dark features of your jellyfish object and the hoppity-hop or your rabbit object? You can use the mixin pattern to blend these two objects into a new glowInTheDarkBunny object. It's not hierarchy, it's hybridity.
To get a sense of what all this means, check out this decent book on modern Javascript:

0 comments:
Post a Comment