
Introduction
Programming is much like building a city. You don’t throw bricks, cement, and metal randomly together, instead you carefull...
For further actions, you may consider blocking this person and/or reporting abuse
Great write-up, Henry! The real-world analogies (especially the car system example) made the OOP concepts much clearer and relatable. I also like how you broke down encapsulation, abstraction, inheritance, and polymorphism in a beginner-friendly way. This will definitely help a lot of learners approach JavaScript OOP with more confidence. Looking forward to more tutorials from you. Cheers
Thank you very much
Great write-up, Henry! 👏
The real-world analogies (especially the car system example) made the OOP concepts much clearer and relatable. I also like how you broke down encapsulation, abstraction, inheritance, and polymorphism in a beginner-friendly way. This will definitely help a lot of learners approach JavaScript OOP with more confidence. Looking forward to more tutorials from you. Cheers
Thanks a lot
This is the best OOP in JavaScript article I’ve ever seen. This article is both enthralling as well as educative with key concepts well explained in a simplified manner. Thanks for sharing this great piece
Thank you very much
When it comes to programming nobody does it better.
Thank you for the eye opener.
I'm learning every day
Thanks for the nice comments
Great piece of work
Thanks
I always look forward to reading great write-up from this fellow. Keep up the good work. Cheers
Thank you very much
Very impressive and carefully written…
👍👍
Thanks
Very interesting write up, thanks for sharing Henry.
Thanks man
Thanks for posting this! While I mostly recommend against OOP in JavaScript, I think it's an important paradigm to understand.
I think your Abstraction section isn't ideal. The way you define
_balance
and the related methods inside theconstructor
mixes actual OOP with closures. ThegetBalance
anddeposit
methods are not members of the class this way, they are redefined for each instance.This was how we managed private values prior to ES2022 when Private elements were added to the spec.
Using the private elements simplifies the design makes use of class-level methods.
Not the car analogy...
Also a lot of the "importances" are just really good weather sort of ideas. It does not guarantee reusability at all, for example, and with something like the "car analogy", it even guarantees that scalability will suffer. We should not model the code after the domain of the real world idea, but we should model it after the domain of concerns. Rather than making a car and "have the steering wheel take care of physics", make a physics class (or module). make subsystems that concern themselves with one technical concern, not with a domain concern.
Overall this article advertises the same tired way of doing things that has been making our applications slow and bad to maintain for a long time now. As a beginner of course someone would be impressed by it...
Uncle bob would be proud
what you should honestly do is watch this talk on the topic and maybe see what's going on youtu.be/wo84LFzx5nI
Thanks for your input.
Nice Article