Re:The use of `class` for things that should be simple free ...
by hamandcheese on Thursday May 28, 2020 @04:14AM
(#23334801)
The benefit is encapsulation.
[ Parent
| on HN ]
Re:The use of `class` for things that should be simple free ...
by _0ffh on Thursday May 28, 2020 @04:59AM
(#23335039)
Don't need a dedicated OOP lang for that benefit.
It's an age-old discussion. As old school software engineering became sufficiently advanced, some people bundled their favorite "state of the art" concepts, and called it OOP. (Also: Multiple people, multiple different concepts of what "OOP" actually precisely means.) It became a horrible hype, and from then on out everyone was taught to see all these concepts as "OOP concepts" that elevate OOP over other programming paradigms.
But they're not and they don't.
The only real "advantage" is, OOP languages are opinionated and will try to force their interpretation of these concepts on the coder. Which is nice, if you happen to like it that way. Just not everybody does.
Re:The use of `class` for things that should be simple free ...
by fnord123 on Thursday May 28, 2020 @05:18AM
(#23335149)
Encapsulation's a weird one. It's a cornerstone of OO but most/all OO languages have rubbish support for ABIs so changing your object in one library means you need to recompile your code using the library. This is the opposite situation that encapsulation seems to promise (in my view).