DEV Community


Discussion on: The PIE concept of OOP.

greenroommate profile image
Haris Secic • Edited

Sadly to really start with OOP, the real idea behind it, one would have to ditch class-based programming and focus more on functional ones. Yes, functional ones as in Erlang because of it's actor-based style. You can use something like Scala with Akka to get all features in a single language but classes are deeply troublesome. Here's a link with the AK that coined the term OOP. And here's another one. So all in all JavaScript might be closer to OOP without using classes than Java or C#. Don't get me wrong I mainly focus on Java because I started with it and it has great ecosystem (as in many things are written so you don't have to :D) but in all fairness given the chance I would switch to Scala and try more "actor" based approach. The thing is that data structures that guarantee type safety are good for me personally and I do mutate stuff in certain ways but not simple data just flowing between HTTP and DB with some minor validations. I think having "modules" that contain functions or static methods or whatever you call it would be good and also allowing classes and some mutations. Scala and Kotlin have tried it but I don't really like how they did it. So, for now, I still end up using class keyword but I rather think of it as better encapsulated package or module... Whatever the keywords are Objects in OOP should be looked upon as microservices then we will see wrongdoings in class classes based approach.

enakshi_pal profile image
Enakshi Pal Author

Thanks for sharing the resources! :)
Also, your points are good about the class-based approach. I liked it. :))