4 ms·
John Resig made a similar point in an article discussing using JavaScript as an intro language for the Khan Academy. http://ejohn.org/blog/introducing-khan-cs/
by philipwalton 14y ago
John Resig made a similar point in an article discussing using JavaScript as an intro language for the Khan Academy.
http://ejohn.org/blog/introducing-khan-cs/ http://ejohn.org/blog/introducing-khan-cs/
He argues (and I agree) that prototypal inheritance isn't complicated unless you're coming from a very classical inheritance background.
- Ovid 14y agoThe "classical inheritance background" frustrates the heck out of me at times. I strongly encourage developers to look at traits/roles -- http://en.wikipedia.org/w/index.php?title=Trait_(computer_programming) http://en.wikipedia.org/w/index.php?title=Trait_(computer_pr... -- for OO development and the first thing I have to do is to try to get them to "unlearn" class-based inheritance.
- bdg 14y agoFor me, the key bit of learning that unlocked my ability to switch between OO paradigms was actually assembly programming. Having an understanding of how C++ types, strings, structs and finally objects all impacted the stack and memory, then being able to actually create something in x86 let me 'see' how classes create objects, and also got me over the 'how do pointers work?!' hurdle. It might be entirely counter-intuitive, but learning assembly was the key to me being able to shift OO-gears. Today I write in PHP and JS, and the only thing that I find myself stumble over when moving back-and-forth are weird things like the `this` scope of setTimeout returning to global space when invoked locally.
- Ovid 14y agoInteresting. For me, I learned OO with Perl (scary, I know), but really started grokking it when I learned to Java. Finally, I started studying Smalltalk and when I found out that it doesn't have "if" statements (it creates boolean objects you can send ifTrue/ifFalse messages to said objects). Once I grokked that, it was like my eyes opened. I still have more to learn, but OO programming is so much easier and more pleasant after understanding how multiple languages approach it.