RE: Flamage (was RE: Question)
RE: Flamage (was RE: Question)
- Subject: RE: Flamage (was RE: Question)
- From: "Smith, Bradley" <email@hidden>
- Date: Mon, 3 Dec 2001 16:21:04 -0000
>
I'm currently (being paid to) work on a C++ project with > 1,200
>
distinct _leaf_ classes. Total inheritance tree - > 3,000 classes.
>
It's terrifying. And it's not that complex an application, really,
>
for a major financial institution.
>
>
This enormous class bloat is due to 2 things, mainly.
>
1 - Poor initial design
>
2 - Strong typing
>
>
I reckon that with Objective-C, this could be reduced to a couple of
>
hundred classes at most, without getting too radical. Less than a
>
hundred with a proper redesign. Really. Although a redesign in half-
>
way-decent C++ could get it down to 500 or so classes, IMO.
>
>
The main problem, and one that I'm suffering myself, when people come
>
from strongly typed languages to something like Obj-C, is that it is
>
very difficult to change the way you think. Subclassing
>
unnecessarily becomes a way of life, and a difficult habit to break.
>
>
I'm on the 4th refactor of my object modelling project. It's gone
>
from nearly 60 classes down to 18. It's got a lot less lines of
>
code. It does more. Faster. This is a good thing.
>
>
I'm beginning to think in terms of objective-C now. I'll think 'How
>
can I extend something to do this?' rather than 'What do I need to
>
subclass here?'. It's a wierd way of thinking, to someone who's
>
spent years doing C++. But Objective-C means manageable inheritance
>
hierarchies (with the odd downside of a number of categories on
>
existing classes, but those are generally **very** easily reusable)
>
>
So, I think Ondra's probably right here. That's not to say that he's
>
not, on occasion, a little *ahem* 'forthright' *ahem* from time to
>
time, but I can live with that ;-)
>
>
Just my $0.02 (probably overvalued at that price)
>
>
Simon
Maybe it is over complex. Maybe it's over complex because Eduardo comes from
a C++ background. My point is that it's not Ondra's (or anyone else's for
that matter) job to make that analysis. He's never even seen the project and
neither has anyone else here. Ondra has decided, without seeing the details,
that the only reason there are 150+ classes is because it was designed by a
C++ programmer and instead of offering a sensible, helpful response like
"try using protocols and delegation" (for example) he's launched an attack
on C++ and everyone who uses it, just like he does all the time.
Brad