[MUD-Dev] Languages

Caliban Tiresias Darklock caliban at darklock.com
Sat May 24 20:41:17 New Zealand Standard Time 1997


On Sat, 24 May 1997 11:38:20 PST8PDT, Shawn Halpenny
<malachai at iname.com> wrote:

>Caliban Tiresias Darklock wrote:
>
>> The problem I see in projects built using proper OOP in C++ is that the
>> same data is validated over... and over... and over... and over...
>> because none of the objects can make any assumptions about the others,
>> so they can't ever take for granted that someone else has validated the
>> data. If they did, they'd break the whole reuse thing.
>
>That reflects poor design in the reuseable components, IMO--or at least
>in the documentation of them.  I'm a proponent of the "validate as close
>to the input source as possible" school of design, and if the interfaces
>are properly documented in those objects close to the source, there
>should be no reason for data to be validated ad infinitum.

I agree entirely with this. It's pretty much what I do. I try to slurp
in the data, sanity check it, and then place it into an area that might
be best described as a 'known good' area. For example, when I implement
a list, I sanity check the input when it's provided to be placed in the
list. If the proper interfaces are used, there is never again a need to
make sure that your pointers aren't NULL and your strings are
terminated. I do provide, for the truly paranoid, a function which
iterates through the list and sanity checks all the contents; but I
never use it.

>none of the features necessarily making C++ worse than
>any other language, nor particularly any better.  I like it, though, and
>will use it because it will let me accomplish what I want with less
>effort than in other languages I've looked at.

I can see several points in the C++ language that make it attractive for
large projects with deadlines... like commercial applications. If the
programmer will not maintain it, it carries several other niceties.
However, all the benefits of C++ seem to be social, rather than
technical; likewise the benefits of OOP. OOP is really great if you have
five teams in different countries working on a project. It's a fantastic
tool for DoD work, as well. But in most computing... I don't see much of
the benefit.

I will admit that heavy Windows programming is almost required to be in
C++, much as the SDK in Windows 3.0 more or less required that you work
in C. But Delphi's got some real potential, although I hate to admit
that any Pascal derivative is anything other than garbage, and Visual
Basic is a wonderful rapid prototyping language. It also makes good blue
glue.

>Also, I think the number of modern C++ compilers that translate code
>into C is between few and none (though it used to be common practice). 

Just as there aren't a lot of C compilers left that translate into
assembler. ;)

Language evolves...

-+[caliban at darklock.com]+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
 I am here to grind your eyes harder into the miasmic bile of life; to 
 show you the truth and the beauty in the whisper of steel on silk and 
 the crimson scent of blood as it rises to meet the caress of a blade. 
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+[http://www.darklock.com/]+-



More information about the MUD-Dev mailing list