News for hackers. Stuff that matters.
Re:A Healthy Hatred of OOP, or the principles of my message-... by jasode on Tuesday April 12, 2016 @02:57PM (#11482481)
>At the end of the day, you need to get values from your class,

Yes, you eventually have to <scarequote>"get"</scarequote> values from the class but you don't literally have to mindlessly create a one-to-one set of "get()" for every private member variable.

The author's example and my response to it were talking about a literal thin wrapper of public getX() for a private int x. This practice deceptively looks like OOP (I "hid" that private member with a public method) but it's not really OOP.

Instead of gets() & sets(), the programmer should find the higher level concepts to turn into higher-level methods. This way, the gets()/sets() is kept to a bare minimum.

There are no comments on this comment yet.