Mar 17
Everything You Know Is Wrong
I’m in Allen Holub’s talk this morning… “Everything you know is wrong: Inheritance and getters/setters are evil”.
I was excited to see this talk on the roster. Not only is it a topic I’ve harped on and have always been in agreement with Allen, but I have a similar talk submitted to SDBP this fall.
Allen started off with the classic “tell, don’t ask” talk. He makes on very good point that hadn’t occurred to me before. To really get benefit out of an Agile process (specifically XP) you NEED to be doing OO properly. If you aren’t, you will fail.
Quite a bit of time was spent discussing the problems with implementation inheritance and the advantages of interface inheritance and composition.
Next Allen moved to why encapsulation is so important and why getters & setters are such a problem. Don’t bother getting flustered about that idea.. he’s 100% on the money. If you disagree you need to learn what OO is.
One nice soundbite: “Doing it this way (interface based, using design patterns) lets me have to think less. Thinking is hard… I’d rather just program.”
The bottom line(s):
- There is no such thing as perfect
- Design is a series of trade-offs
- assess risk, then make reasonable decisions
- there’s often is a better way of doing things than the first way you think of
Comments Off
