DEV Community


Discussion on: React is finally JavaScript

arizonatribe profile image
David Nunez

Well said. I would even recommend doing a js-benchmark comparison of invoking multiple methods on a class instance vs the same methods composed into an object directly (individual functions as fields in an object directly). The syntactic sugar of post-ES2015 classes can't make up for such a drastic performance drop. But this is one big reason (in JavaScript) to favor composition over inheritance.

Languages like Java are built on top of a JVM highly optimized for object oriented programming (C# too, although it isn't as bare metal fast these days as Java). JavaScript meanwhile is a LISP/Scheme/SmallTalk clone with some "C"-like syntax.

Lots of people spend their week tinkering with the many compile-to-JS solutions and I wish them great enjoyment in their efforts. I just hope they don't spend their entire careers coding JavaScript from their favorite abstraction layer and never get the opportunity to see all the low-level tricks and simplicity of vanilla js.