Re: Why is OO Popular?

From: Eric Kaun (ekaun_at_yahoo.com)
Date: 05/04/04


Date: Tue, 04 May 2004 13:40:09 GMT


"Jeff Brooks" <jeff_brooks@nospam.com> wrote in message
news:nphlc.350119$oR5.75668@pd7tw3no...
> [SNIP]
> Just because some people think that OO leads no where doesn't mean it's
> true. There are lots of programs that successfully use OO.

It really depends on how you define "successfully" - much OO code is bad
procedural code, and when people abstract badly (and it's easy to do, since
the abstractions in the solution space are not always directly implied by
the abstractions in the problem space, which are difficult to properly
identify), it's a far worse mess than bad procedural code. In my opinion. I
can refactor long spaghetti procedure, but networks of spaghetti objects?
BLECH!

> Not all OO languages are complex. Look at Smalltalk, or Python as
examples.

There are natural complexities to object languages, of course. The biggest
areas of confusion: identity and equivalence, value vs. variable (i.e.
aliasing in mutation, and the attendent "deep copy" sorts of confusion),
proper subtyping relationships (defining and obeying superclass predicates),
etc.

> OO developers model classes as they understand them. These may not be
> correct in the matematical sense but that doesn't mean the software
> doesn't work.

It just means that there's no basis for the modeling other than intuition,
and furthermore the worst OO languages force everything to be an object,
when everything is obviously not. Look at functional languages for the power
of "unobjectified" functions. Then look at Haskell or ML to see the power of
strong type inference (strong typing with less pain, basically what
dynamically-typed languages claim without safety). Then see whether all of
your desired logic fits so cleanly into OO.

> A lot of people like to point out the programming languages ignore
> mathematics and say the languages are bad for doing so. If following
> mathematics was required to write software then most of the existing
> languages wouldn't be able to be used to create software. Obvously, this
> isn't the case.

That's the problem - it CAN be used. To paraphrase Chris Rock: You can drive
a truck with your feet if you want to, but that doesn't make it a good idea.
Lots of things can be done - we're discussing what SHOULD be done.

Math and logic are a sound basis, as is Occam's Razor. I'm not a zealot, but
if you have a better basis, propose it. Saying that math is insufficient,
but replacing it with just any idea that sounds OK at the moment, is a bad
way to proceed. I'm not saying objects are entirely bad, but the fact that
they mix value and variable semantics adds complexity, complexity we may not
need. There may be attendant benefits (as Robert Martin said, dependency
management), but we have to be aware of what the downside is.

> The only way using mathematics as the basis of a language would be
> easier for people to understand is if people understood mathematics.

So in other words, the cure to mathematical ignorance is to abandon it? Like
it or not, we're using logic. It may be clear or not, may be consistent or
not, may be overly complex or not, but it's there. Ignorance is a poor
excuse. Math doesn't have to be complex - in fact, its aim is simplicity.
Spaghetti code is a result of an overly simplistic approach which ultimately
yields excessive complexity, far beyond what a better approach would have.
This suggests we need a bit more discipline up front (uh oh, the XPers are
screaming now...)

- erk



Relevant Pages

  • Re: Index Formula (proof?)
    ... USAlane@xxxxxxxxxxxxxxxxxxxxxxxxxxxx to Complexity ... This is a report on the poll. ... Techniques Will be Used?52 people answered this ... Geometry, p. 55) did:In any branch of mathematics, ...
    (sci.math)
  • Re: PHP global namespace clogged up
    ... Different languages have different standards. ... In my experience of software development the only thing you can guarantee is ... > Perhaps a big investment in procedural code explains some of your views ... Unlike some developers I am willing to look at new techniques and try them ...
    (comp.lang.php)
  • Re: Index Formula (proof?)
    ... SIGACT News Complexity Theory Column 36Lane A. HemaspaandraDept. ... This is a report on the poll. ... Techniques Will be Used?52 people answered this one.1. ... Geometry, p. 55) did:In any branch of mathematics, there are usually ...
    (sci.math)
  • PLMMS 2009: First Call for Paper
    ... The ACM SIGSAM 2009 International Workshop on Programming Languages ... for Mechanized Mathematics Systems will be co-located with TPHOLs 2009. ... Final Papers Due: July 10, ...
    (comp.lang.lisp)
  • PLMMS 2009: First Call for Paper
    ... The ACM SIGSAM 2009 International Workshop on Programming Languages ... for Mechanized Mathematics Systems will be co-located with TPHOLs 2009. ... Final Papers Due: July 10, ...
    (sci.math.symbolic)