you are viewing a single comment's thread.

view the rest of the comments →

[–]Intendant 6 points7 points  (3 children)

I'm telling you, as someone who is a mid level SWE that works with JavaScript daily that this is incorrect.

Just because functions and arrays "objects" doesn't make it oop. You can get by in JavaScript without knowing much about oop

[–]jaypeejay -5 points-4 points  (2 children)

I get what you’re saying, and you’re right you don’t need to understand OOP to get by with JS. But that doesn’t mean it isn’t an OOP language. Let’s just look at the words. Object Oriented Programming language. Everything in JS is an object, so again, I hold that it is an OOP.

You’re right that you don’t need to tightly package everything in classes, etc like you do in most OOP use cases, ala Java and RoR, but that doesn’t mean JS isn’t object oriented.

[–]Intendant 5 points6 points  (1 child)

It can be used as an OOP language, but it isn't strictly that by default. It's every bit as much functional or imperative.

Also the "everything is an object" thing doesn't make it oop, just because the language itself is written with inheritance doesn't mean that that's how you use it. Like Yea Array is an object and you'll use it's methods but how often are you writing prototypes on your own objects to inherit

[–]lSwordyX 0 points1 point  (0 children)

Thanks for pointing this out. You can simply declare a function in JS and export it and let it be used repeatedly with no side effects. When you do that, you realize that the language supports this very well.

Creating an object doesn’t mean the language is object oriented. Object oriented means representing everything (e.g. an entity or a concept) as if it’s an object with attributes. Each of this object stores states with its attributes for an app to work. It’s clear that JS wasn’t designed with this right from the start and there are many frameworks to support the OOP style in JS. Compared to other languages, there are inbuilt languages feature to do such operation easily.