Re: Noun Oriented Thinking Considered Harmful
- From: "Enquiring Mind" <Enquiring.Mind@xxxxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 5 Aug 2006 18:10:14 +0100
"Michael C." <Michael@xxxxxxxxxx> wrote in message
news:44d31f47$1@xxxxxxxxxxxxxxxxxxxxxxxxx
Kristofer Skaug wrote:I have only seen the last couple of posts in this thread that seems to be
I'm celebrating "Delphi Global Functions Appreciation Day!" (again!)
Yes.
I like Delphi because it doesn't force me to use classes or interfaces to
find solutions to problems.
I actually love the fact it gives
ME THE FREEDOM to decide what I WANT TO USE solve a problem.
I like being able to use pointers, classes, memory management, functions,
procedures, etc.
Hopefully, it will continue to stay this way.
debating the merits of hybrid procedural/object-oriented languages like
Object Pascal and entirely object-oriented languages like Java and C#. May I
add some further thoughts arising from my personal programming needs and
experience?
I am currently developing a large and complex engineering analysis
application, and usually start developing a new unit of functionality in an
object-oriented manner as a family of classes. This generally works
reasonably well for classes that implement data management, where
effectively the class is a stand-alone entity. Thus classes are fine to
implement collections, stacks, streams, databases, visual components etc..
They are also the best solution when polymorphism is required.
However I often find that when I have to program what may be most logically
and succinctly defined by a series of mathematical functions, where each
variable can be a function of any number of other variables, and the world
behaviour being modelled does not depend on a single class of object, but on
the interaction of several classes of object, I am forced to back-track and
recast the functionality as a series of global functions and procedures.
Suddenly code that was beginning to take on a convoluted logical structure
as difficult to readily comprehend as the deplored spaghetti code of old,
becomes simple and straightforward to understand, and more flexible to
reuse. If I may draw a parallel: to comprehend spaghetti code containing "go
to" jumps you needed a flowchart diagram to help you - you couldn't
understand the logic by just by reading the statements in a linear
sequential fashion. And today to comprehend some object-oriented code you
again need one or more diagrams - UML diagrams showing inheritance trees,
ownership structures, inherited properties, and the like. The structured
programming paradigm introduced in Pascal and perfected in languages like
Modula and Ada did away with the need for diagrams - you could understand a
well written procedure just by reading it line by line.
Moreover, to reuse procedures and functions by the class inheritance or
interface models is far more restrictive than by the global procedures
model. Common obstacles include the inability to use multiple inheritance,
the lack of differentiation between data references and owned data, lack of
information about inherited variables and behaviour, and the inheritance of
a lot of overhead that is not needed.
Another point is that in my field of scientific programming a procedure is
sometimes not just a few lines long - sometimes it needs to be say about a
page long. To have to intermingle this voluminous block of code in the class
definition makes the class definition truly unreadable, because you cannot
see the class definition in its entirety in say a single page. The
separation of interface and implementation parts that Delphi inherits from
Modula-2 is a language feature that I would find hard to do without.
A third point is that forcing certain types of problem to fit into the class
straightjacket is more bothersome that forcing them into the strongly typed
straightjacket of the original ISO Pascal used to be. It adds overhead to
the code and reduces simplicity - maximum simplicity being the goal that the
developer of reliable software should always aspire to.
To conclude may I add that it's sad to see bookshops treat Delphi as if it
were a legacy or specialist language like Fortran, rubbing shoulders with
Cobol. Delphi needed more promotion in academic and professional spheres,
and more books that explain its benefits over more fashionable current
languages, as well as entering into the minutiae of systems programming.
.
- Follow-Ups:
- Re: Noun Oriented Thinking Considered Harmful
- From: Jim Cooper
- Re: Noun Oriented Thinking Considered Harmful
- From: Wayne Niddery [TeamB]
- Re: Noun Oriented Thinking Considered Harmful
- References:
- Noun Oriented Thinking Considered Harmful
- From: Kristofer Skaug
- Re: Noun Oriented Thinking Considered Harmful
- From: Michael C.
- Noun Oriented Thinking Considered Harmful
- Prev by Date: Re: Devco to encourage VB users to migrate to Delphi
- Next by Date: Re: Devco to encourage VB users to migrate to Delphi
- Previous by thread: Re: Noun Oriented Thinking Considered Harmful
- Next by thread: Re: Noun Oriented Thinking Considered Harmful
- Index(es):
Relevant Pages
|
|