DEV Community

Discussion on: Static Typing or Typescript

 
kayis profile image
K

Could be.

But I really think JS OOP is the right way and chipping away from it goes in the wrong direction.

Thread Thread
 
peerreynders profile image
peerreynders • Edited

Javascript is very much OOP and Typescript is not like C#.

From the horses mouth: TypeScript began its life as an attempt to bring traditional object-oriented types to JavaScript so that the programmers at Microsoft could bring traditional object-oriented programs to the web.

Java and C# implement (traditional) "class-based object-orientation" - class membership is static for the lifetime of the class instance (object). In JavaScript classes are a mere "template for creating objects", i.e. during its lifetime an individual object's spec can be changed to align with completely different classes without changing its identity.

JavaScript's "prototype-based dynamic object-oriented programming" is based on Self. I tend to think of JavaScript as Function-Oriented (Yes, JavaScript is a Lisp).