News for hackers. Stuff that matters.
Re:Inheritance is evil, and must be destroyed: part 1 by mdemare on Friday October 12, 2007 @11:23PM (#67175)
The last couple of years my programming style has changed a lot. I've noticed that I've been using inheritance less and less. When I was still doing Java, I only used (implementation) inheritance when the API forced me to, and now in Ruby I hardly use inheritance at all.

I even use objects a lot less - prefering to pass around hashes until they've blossomed into fairly well defined types. To me, a class is a data structure that provides a namespace for the functions that manipulate it, and little more.

In any case, I think nearly empty classes with nothing but accessors have no use in dynamic languages (in static languages they provide at least code completion support.)

I also increasingly dislike local variables and if-statements (preferring case statements). I like my methods having flow, and if-statements and local variables break that flow, like a caesura in music.

What bothers me is that I don't know if this is my progress towards becoming a zen-like programmer, or just me being bored with the old way of doing things, and discovering a new fad. It seems there is no way to tell.

There are no comments on this comment yet.