Re: Flamage (was RE: Question)
Re: Flamage (was RE: Question)
- Subject: Re: Flamage (was RE: Question)
- From: "Eduardo I. Jiménez" <email@hidden>
- Date: Mon, 3 Dec 2001 22:11:11 -0500
This enormous class bloat is due to 2 things, mainly.
1 - Poor initial design
2 - Strong typing
I don't see how strong typing could have this effect. Maybe the design
should consider templating.
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 argument that relaxed typing reduces the number of classes tends me
to think about spaghetti code (VisualBasic anyone?).
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.
Again, maybe what its needed is templating. Maybe people is subclassing
because they don't know any better and nobody has a clear vision on the
problem. Hey, don't take it personal, I'm talking in general...:)
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)
Sure, but I don't just need to implement the functionality. There is a
methodology and there are real-world entities I need to have in my
implementation. Sure, design does not translate literally to
implementation, but then I would just pack everything up in 5 classes
and go home early. The entities I have are there for a reason, and they
need to be in an implementation. Again, I think categories and protocols
are great, but C++ has also big plusses (namespaces ROCK!).
Thanks a lot
Eduardo Jimenez