3 ms·
> You are assuming every language is as shitty as Java. Perhaps. Java, C#, C++, PHP, Python, Ruby, etc. > Yes you can, there is absolutely nothing stopping y
by wvenable 14y ago
> You are assuming every language is as shitty as Java.
Perhaps. Java, C#, C++, PHP, Python, Ruby, etc.
> Yes you can, there is absolutely nothing stopping you from making a dozen different doThingToCustomer functions/methods scattered across a dozen different classes.
If Customer is a class, it's pretty difficult to doThingToCustomer() that the Customer itself doesn't allow.
> And how on earth does this bizarre notion address the class of errors you were complaining about, which are type errors?
Just as I said above, it's difficult to alter the contents of an object in a way that an object doesn't allow. In "pure" Alan Kay style OOP an object is something that responds to messages. In loose languages like Python you can reach into an object and mess with it but that is discouraged.
- papsosouid 14y ago>If Customer is a class, it's pretty difficult to doThingToCustomer() that the Customer itself doesn't allow. That applies just as much to functional programming as it does to object oriented programming. If you don't want people to mess with the internals, then don't export them.