Tuesday, 22 February 2011

Use the tools at your disposal

Sooo, I've had an interesting chat today, with a fellow programmer... and it got me thinking, the gist of the chat was that we had a series of interfaces all cobbled together and finally getting a review to replace them with a better structure... but this "better structure" was going from 8 to 12 modules all higgly-piggly put together.  During the conversation I described the stack of modules as "a pile of rickety plates".

So, I started to advocate the use of inheritance, so instead of splitting functionality out horizontally into 12 different modules, it would all boil down to one, or two, and then you would derive from them to inherit the base functionality and add new at each stage... meaning you didn't have to worry about coding, and testing, each module in one go, you simply have to test one the highest level abstraction...

And you know what, I got looked at like I was showing a dog a card trick:

"Inheritance, what is this inheritance of what you speak?"  I could murder some of the people in the programming game these days I really could...

I'm going to melt this guys brain tomorrow by showing him auto_ptr, instead of the risks of delete.

No comments:

Post a Comment