20 August 2014

Danger Will Robinson, Again

simple-talk has an interview with Bjarne Stroustrop just up. It's a better interview than most, by the way. Well worth the effort. Reading it reminded me of a quote from Stroustrop, but for which I cannot vouch, since I've long lost the cite. I've been looking to confirm it for years.
Object oriented programming is buzzword programming.

It may be C++. And it may never have been said by him. Or anyone. The Voices may have just assimilated me.

Anyway, the interview has me off looking, again. I did find this piece, which provides the quote which got me into so much trouble with the Indians at CSC:
As we have all learned, methods in good OO programs should be short and sweet. Lots of little methods are good for development, understanding, reuse, and so on. Well, what's the problem with that?

Well, consider that we actually spend more time reading OO code than writing it. This is what is known as productivity. Instead of spending many hours writing a lot of code to add some new functionality, we only have to write a few lines of code to get the new functionality in there, but we spend many hours trying to figure out which few lines of code to write!

One of the reasons it takes us so long is that we spend much of our time bouncing back and forth between ... lots of little methods.

This is sometimes known as the Lost in Space syndrome. It has been reported since the early days of OOP. To quote Adele Goldberg, "In Smalltalk, everything happens somewhere else."

Organic length of code, as organic normal form, is the ideal to be sought. The fascination with two or three line methods, tens or dozens of 'em, means only one thing: in order to understand the functioning of the object, one has to hold lots of stuff in one's immediate memory. Few can do that, so most OO code ends up being written in the (GUI) debugger. Unlike the Deming Dance (do it right the first time), this is pound the hammer until you bust the thing to pieces.

Not to mention the corrosive effect of the web: OOD/OOP has devolved back to function/data of FORTRAN, only we now adopt the terms ActionObject and DataObject. As Stein said about Oakland, "there's no there, there". OOD/OOP means that objects really are self-contained, and communicate with other objects with messages (which is to say, "do something, and I don't care how"), not data packets. Where did I park that DeLorean??

2 comments:

Adam Bradley said...

Reading it reminded me of a quote from Stroustrop, but for which I cannot vouch, since I've long lost the cite.

This interview, maybe?

C++ View: It's said that Java is purely object-oriented, while C# is even more. And many people say they are purely money-oriented. What's your opinion?

Bjarne Stroustrup: I like the term "money-oriented" :-) I also like Andrew Koenig's phrase "buzzword-oriented". C++ is neither.

Robert Young said...

That would be it. A tip of the Hatlo Hat. :)