News for hackers. Stuff that matters.
Re:Kay on the Meaning of "Object-Oriented Programming" by gnaritas on Tuesday June 07, 2011 @11:29AM (#2629510)
It's bad, in the sense that it leads you to write tightly coupled code that depends on it. The whole point of objects are to hide data and instead expose behavior so other code is coupled to the objects behavior rather than its internal implementation on a specific set of chosen data. This leaves you free to fiddle with the internal implementation without breaking the external API, which leads to modular loosely coupled code.
Re:Kay on the Meaning of "Object-Oriented Programming" by shasta on Tuesday June 07, 2011 @02:47PM (#2630363)
But note that this is an argument for encapsulating data and not necessarily bundling it with methods as objects. You can hide data reps with functions.
Re:Kay on the Meaning of "Object-Oriented Programming" by protomyth on Tuesday June 07, 2011 @12:01PM (#2629648)
It also allows the substitution of internal data structures due to profiling / runtime usage of the data.
Re:Kay on the Meaning of "Object-Oriented Programming" by gnaritas on Tuesday June 07, 2011 @12:04PM (#2629663)
Which is the point of modular code, to be able to fiddle with the internals for whatever reason you like without affecting clients.
Re:Kay on the Meaning of "Object-Oriented Programming" by protomyth on Tuesday June 07, 2011 @12:14PM (#2629699)
agreed, I was pointing out (badly) that it could be a runtime / compiler decision and not the programmer.