Steve Dix...Comedian?

Raptus Regaliter

Stop Hitting Reload and Get On With Your Work.


17.08.2004 13:57 - Object Orientation

Those of you who don\'t work in computer programming might as well sit this one out.

Object-orientation has been one of the major innovations in computer programming in the past 20 years.  I was first taught object-orientation using ADA, which turned out to be the worst possible way to learn it.  I subsequently didn\'t get a handle on the methodology until much later.  I didn\'t really need to.

However, having now got a reasonable idea of what object-orientation is about, I\'m beginning to realise that an awful lot of people who say they write object-oriented code, don\'t.  For example : I have recently come across a system where all database queries are done via objects.  You want a new query, you write an object to do it.  So far, so good.  I\'ve written a similar system in the past.  However, the problem is the structure of these objects.  You see, instead of writing one base class and then using inheritance, so that all you have to do is write a class stub altering a variable or two or changing a function slightly during the inheritance, each class is fully written from scratch, and each object just contains one function.  No inheritance is done, other than that inherent in \"copy and paste\" coding, which, correct me if I\'m wrong, IS EXACTLY THE BLOODY THING OBJECT-ORIENTATION IS SUPPOSED TO STOP!!

Look; it\'s quite simple, folks.  Object-orientation allows you to write a block of code which can have its component parts changed, instead of copying-and-pasting code, which means that you don\'t have twenty different copies of slightly-different functions lying around, all requiring updating when you discover a bug.  This means that the computer keeps track of all the different versions and uses the right version at the right time, and you don\'t have to go around re-inventing the wheel every time you find a problem that would be fixed by function x, but which is subtly different.  This means that you don\'t go around WASTING MY FUCKING TIME by creating x copies of the SAME FUCKING SOURCE CODE. 

If you cannot get this major feature of object-oriented programming through your head, then I humbly suggest you seek employment in some other area.


Copyright © 2003-2011 Steve Dix