DEV Community

Discussion on: TypeScript?.. or JavaScript?

Collapse
 
stereoplegic profile image
Mike Bybee

We've all heard the Kyle Simpson quote (usually parroted without understanding) that "ES6 classes are syntactic sugar."

I've long taken it further than that. ES6 classes are a CONCESSION on the part of the ECMAScript committee to (TypeScript and) developers coming from class-based OOP languages who couldn't be bothered to properly understand the what and why of a prototype-based (also OOP) language.

Collapse
 
f1lt3r profile image
F1LT3R • Edited

That's interesting. When I wanted to learn OOP back in 2007, I started learning JavaScript Prototypal Inheritance. I didn't understand a thing I was reading. I had to switch over to Java to learn OOP, which was much clearer. Then once JavaScript Prototypes began to make sense to me, I started to realize that I was not really learning OOP in the traditional sense; JavaScript's composition model was meant to be different, but people were not getting it.

Prototypes are awesome, and I used them for a long time before discovering cleaner alternatives. I was giving a presentation on Web Audio at the Wakanday Conference in Boston, in 2013, where Douglas Crockford, the inventor of JSON, introduced the audience to the power of JavaScript Closures. That was the end of OOP for me.

If I remember correctly, this is the video of Douglas Crockford's talk here: youtube.com/watch?v=gz7KL7ZirZc