473,395 Members | 1,863 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

What is/is not considered to be good OO programming

Several months ago I started a thread with the title "What is/is not
considered to be good OO programming" which started a long and
interesting discussion.

I have condensed the arguments into a single article which can be
viewed at
http://www.tonymarston.net/php-mysql/good-bad-oop.html

I fully expect this to be the start of another flame war, so sharpen
your knives and get stuck in!

Tony (you do it your way and I'll do it better) Marston
http://www.tonymarston.net/
Jul 17 '05
52 6348
Jochen Buennagel <za*********@buennagel.com> wrote in message news:<br*************@news.t-online.com>...
Tony Marston wrote:
Isaac Newton did not have to rediscover for himself a
thousand years of Science. He stood on the shoulders of giants.

He had giants, I have pygmies.


...he said, offhandedly dismissing 40 years of advancement in software
development...


Somebody out there may be making advancements, but not every "change"
is an "advancement". Some people think OOP is the best thing since
sliced bread while others think it as a pile of pooh. So who is right?
If you are just creating a few big classes that match each part of the
system, then you are right. All you have done is used the flexibility of
OO to recreate a paradigm you are familiar with. You could just as
easily have written it in Modula 2 or used structs and pointers in C.


Probably, but I chose to write it in PHP.


Whatever language you use: Using classes and objects doesn't make a
program object oriented.


OH YES IT DOES. If I utilise the OOP capabilities of a language to
create classes/objects which demonstrate encapsulation, inheritance
and polymorhism then that is all I need to claim that the program is
object oriented. The fact that my method of doing so is different from
your method is totally irrelevant.

As an example take Dick Fosbury who invented the "Fosbury Flop". Until
he came along all high jumpers used the same technique, which was one
leg first. He devised his own technique which was to jump backwards
over the bar. Did that make him any less of a high jumper just because
his technique was different?

He jumped over the bar, therefore he was a high jumper. My software
uses objects, therefore it is object oriented. Ipso Facto. Quad Erat
Demonstrandum. Quid Pro Quo. Et Cetera.
I like to take things easy as well, which is why I create development
environments which enable me to create working components in hours or
minutes instead of days or even weeks.


Anyone can create "working" components very quickly. That says nothing
about wether they can be easily maintained and adapted to changing
requirements, which is what most development time is spent doing.

If you have to rewrite half your system for every change, I'd rather
spend more time on the initial creation. Shortcuts make long delays...

Jochen


My software is designed for both ease of initial development and ease
of maintenance. After all, I have had 25+ years of practice.

Tony Marston
http://www.tonymarston.net/
Jul 17 '05 #51
Tony Marston:
What this means in practice is that if you by have this piece of software
which takes 1 week to develop, and 3 weeks to maintain, you're better off
if you can spend 2 weeks developing and only 1 week maintaining.


If you can write something from scratch in 1 week but take 3 weeks to
maintain it then you are doing something wrong. If the scale of
changes were that huge I would scrap the original program and rewrite
it.


I realize that maintenance probably isn't a fitting word. Evolution is.
Software systems tend to evolve, and most of the time will be spent
evolving the software. If the system is badly written from the start this
may become a painful process, and this very process will probably cause
more bugs to appear. In extreme case you may even have the situation where
minor changes to the system's behaviour requires massive changes to the
code. My main point is, in short, that I disagree when you say that "the
aim of the software developer is to produce software as quickly as
possible.". It's obviously desirable, but one should always focus on making
the system evolable.

André Næss
Jul 17 '05 #52
André Næss <an*********************@ifi.uio.no> wrote in message news:<br**********@maud.ifi.uio.no>...
Tony Marston:
What this means in practice is that if you by have this piece of software
which takes 1 week to develop, and 3 weeks to maintain, you're better off
if you can spend 2 weeks developing and only 1 week maintaining.


If you can write something from scratch in 1 week but take 3 weeks to
maintain it then you are doing something wrong. If the scale of
changes were that huge I would scrap the original program and rewrite
it.


I realize that maintenance probably isn't a fitting word. Evolution is.
Software systems tend to evolve, and most of the time will be spent
evolving the software. If the system is badly written from the start this
may become a painful process, and this very process will probably cause
more bugs to appear. In extreme case you may even have the situation where
minor changes to the system's behaviour requires massive changes to the
code. My main point is, in short, that I disagree when you say that "the
aim of the software developer is to produce software as quickly as
possible.". It's obviously desirable, but one should always focus on making
the system evolable.

André Næss


If a development environment is constructed properly then it should
make it easy to both create new components and maintain existing ones.
You have to create a reasonable balance between the two and not
concentrate too much on one aspect to the detriment of the other. I
have been creating development environments for 20+ years with both
these aims in mind, and I have succeeded. I have done it in COBOL,
UNIFACE and now PHP.

Making a system evolvable is not something you can guarantee as you do
not know what form this evolution will take. Simple changes such as
adding or removing fields, adding or removing tables, or modifying
business rules here and there is one thing, but if the nature of the
business changes in a drastic way then evolution is not possible - you
have to rewrite from scratch.

Take for example the steam engine. You cannot modify one piece at a
time and turn it into an internal combustion engine - you have to
throw the whole thing away and start from scratch.

But after you have built your internal combustion engine some smart
ass comes along and invents the gas turbine - so what then? It is
impossible to plan for the future as no-one knows what the future will
bring. It is only possible to plan for reasonable changes based on
past experience.

Tony Marston
http://www.tonymarston.net/
Jul 17 '05 #53

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

23
by: darwinist | last post by:
What PHP Represents There is no shortage of complaints one could make about php as a language, and although the list does shrink with each release, some of them are inherent to the origins and...
65
by: perseus | last post by:
I think that everyone who told me that my question is irrelevant, in particular Mr. David White, is being absolutely ridiculous. Obviously, most of you up here behave like the owners of the C++...
125
by: Sarah Tanembaum | last post by:
Beside its an opensource and supported by community, what's the fundamental differences between PostgreSQL and those high-price commercial database (and some are bloated such as Oracle) from...
8
by: Hermawih | last post by:
Hello , I want your opinion about this . In order to say it clearly , I think I have to describe it in long sentences . I could consider myself as Intermediate/Advance Access Developer ;...
28
by: Vishal Naidu | last post by:
i m new to the C world... i ve been told by my instructors not to use goto stmt.. but no one could give me a satisfactory answer as to why it is so.. plz help me out of this dilemma, coz i use...
669
by: Xah Lee | last post by:
in March, i posted a essay “What is Expressiveness in a Computer Language”, archived at: http://xahlee.org/perl-python/what_is_expresiveness.html I was informed then that there is a academic...
6
by: TB | last post by:
Hi Everyone on comp.lang.c++: I am thinking about learning a programming language and I want to decide whether it is worthwhile spending my time learning the C++ programming language. I am a...
8
by: clintonG | last post by:
Every single time neophytes or converts ask about naming and style conventions what are they told by the majority consensus? The answer is "do what you prefer but do so consistently" right? Yes,...
31
by: Mason | last post by:
I've been working to become competent at making websites. My learning path has been: html -css- paintshop pro -javascript -php/mysql I'm getting somewhat proficient at php/mysql (although I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.