OOP - Object Oriented Programming

Discuss Programming

OOP - Object Oriented Programming

Postby Void Main » Thu Apr 22, 2004 5:49 pm

As many years as I have been programming I still rarely do it OO style. Here's a nice little beginners article on OOP using PHP:

http://www.osnews.com/story.php?news_id=6788

The purpose of this article is to give a novice programmer the basic idea of what OOP is, as implemented using PHP. Readers should have a basic knowledge of programming ie what variables are, variable types, basic methods of writing comments, and how to enter code into a text editor.
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby caveman » Sun Apr 25, 2004 2:32 pm

Hi.

Just a rock into the bush.

Years ago we had problems with people overusing pointers in c
that to this day makes me weep.
pointers to pointers to functions of pointers etc. etc.
Everything was done using pointers, and nobody thereafter could
understand and or maintain the code. Sometimes it was easier just to
rewrite.

Nowadays the new "in" thing is OOP and classes.
A crowd that I know now uses classes to the extreme, in Java, in C++
etc..
I have seen guys searching for "re-usable" code for hours to do something
simple, which if they sat down could have been written - really - in a hell
of a lot less time.
Now there are classes of classes etc. to the point where some
programmes is just one class, and everyone seems to spend their time
trying to find out whether a class is available somewhere before starting
the real coding. I have seen some really weird classes in what should
have been straight forward programmes.

Why all this bitching? Man most of those programmes are so complex
that nobody will ever be able to maintain them. The programmer goes
and it is easier to rewrite the code than trying to fix/amend/change or
update it. I have seen this over and over in the past few years...
Me - I am of the old school where I write/develop programmes that
are small, readable, maintainable and does not just use up all
the resources I can lay my hands on.
O yes - and how to document all these wonderfull classess - spread all
over in the shop?

Example - a full system with some hassles landed in my lap in 2002,
all using OOP classes etc and writen in C++. - The smallest compiled
program was 1.2MB! and everytime something went wrong, it took
forever plus 2 hours just to find the problem.
By just streamlining the code, removing all the excess OOP code,
doing the final compile manually ie. NOT using the ide etc. and some
six months later - the biggest compiled program was just over 120K!
(Ok! ok! - there were no graphics involved and no screens)
The main thing here was to make the code readable and maintanable,
which is critical at this point in time for that whole system, and a problem
can be very accuratly pinpointed with the minimum of effort.

So to end off - I have nothing against OOP and the rest, my problem
is with this "forced" idea that it is the only "correct" way to write
programmes. Even a good idea like OOP can be overused and is
sometimes an overkill.

My motto - a good system MUST BE maintainable, and allways think
about the poor guy that has to work with the code once you packed up
and left.
caveman
programmer
programmer
 
Posts: 130
Joined: Sun Feb 09, 2003 1:08 pm
Location: Midrand Gauteng, South Africa


Return to Programming

Who is online

Users browsing this forum: No registered users and 2 guests