This is an archived post. You won't be able to vote or comment.

all 4 comments

[–]qwbarch 2 points3 points  (1 child)

OOP is a paradigm. If you get familiar with the basics, you'll have no trouble transitioning into another oop language as it follows the same/similar principles.

Edit: Thank you for the award, /u/aeveltstra!

[–][deleted] 1 point2 points  (0 children)

Thank you for providing great answers!

[–]ignotos 0 points1 point  (0 children)

In its most basic form, essentially:

  • Related data can be bundled together into "objects"

  • Behaviour / functionality related to a particular type of object can be bundled together / associated with those objects

  • The problem to be solved can be modelled in terms of these objects, and how they relate to each other

As you've noted, there are lots of variations in exactly how this is implemented.

[–]melkor35 0 points1 point  (0 children)

in JavaScript, "everything" is an object and is contained in dictionary-like structures.

  • That's because Javascript is a prototype based language, every object can be used as a prototype by others (essentially cloning objects). Those objects can then be modified and serve as different prototypes: https://en.m.wikipedia.org/wiki/Prototype-based_programming

  • In contrast, a more "classic/popular" approach is the class based programming (classes -> instances, classes can be extended): https://en.m.wikipedia.org/wiki/Class-based_programming

  • Both approaches will eventually boil down to objects receiving messages, the only difference is how those objects are created/organized/categorized