Hacker News new | ask | show | jobs
by kuchenbecker 982 days ago
I use classes as syntactic sugar to a pure functions. People like their objects, but if you treat them as immutable struct data everyone is happy.. well at least less unhappy.
1 comments

If you care about visibility control and minimalistic API design, then the most basic OOP features also provide a set of simple but powerful features: encapsulation, and contextual info on overload resolution (A.foo() is the foo() from A's type, no just any foo that can take A)