Nmap Development mailing list archives

Re: C++ Development


From: Etaoin Shrdlu <shrdlu () deaddrop org>
Date: Sat, 09 Sep 2000 19:59:35 -0700

"Jay Freeman (saurik)" wrote:

[some very well written, and quite lengthy, arguments as to why nmap
might be moved to C++]

So I?m sitting here working on nmap+V, I?m thinking to myself ?man, I wish I
was working in C++?.  I finally ask (for the umpteenth time), ?Why aren?t
 I??  That?s the question I am posing to this list :-).

I am leaving in the first couple of lines, so that you might thing about
tightening up the rules on your Outlook (all the funny question mark
things are those special MS characters that don't really transcribe too
well). I left them in to make a simple point.

While it might seem useful to add in the complex and rich language of
C++, instead of using the more restrictive C, the baggage that comes
along with it brings unexpected extras that might not fit in with the
purpose of the tool. I am already beginning to find nmap growing large.
I see many proposed functionalities, such as application/port
determination, but at least these are optional add ons.

Not everyone is a fan of C++. I consider it to be a garbage language,
although I liked it (and used it) in some of its earlier incarnations.
It is not as though it is a separate language from C, but is rather
quite dependent on it. Much of the claimed improvements from such things
as STL are just that: claims. When I compare similar code written in C++
and C at the assembler or machine code level, the C++ is less efficient.
With a tool such as nmap, efficiency counts.

If this were a large "software engineering" project, requiring multiple
bodies, and design experts, and all that other claptrap from the 70s and
80s, something like C++ helps to keep everyone in the same camp, on the
same road, and singing the same tune. It occupies the place that Ada had
been expected to, and doesn't do too bad a job of it.

Anyone out there mind helping me understand why people don?t like C++?

I would have been one of the people answering the survey who claimed
that C++ sucks. My opinion hasn't changed. When I interview someone, I
ask which language they learned first, and it counts against them if it
was C++, then C, rather than the other way around (not much, but it can
be a deciding factor). 

As I mentioned, C++ can?t do anything C can?t, and C++ isn?t even that
fundamentally different from C (as ?objects? can be built as structs with
?methods? that take pointers to the struct); but having STL and I/O streams
can make things much easier over the ways the equivalents are usually
implemented in C.

Here you are mistaken. The footprint for C is much smaller than C++, due
to the libraries that you don't need to include. You can write clean,
well formed code in C, without classes (use struct instead), and without
all of that terrible overhead and obfuscation that seems to be part and
parcel of C++. Sure, memory handling can be better in C++, but
forgetting to free memory in C++ is just as disastrous as in C, and just
as easy. Array overruns, infinite loops, and any other problems you
might think of exist equally in both. At least with C, I know that it
will compile everywhere, and I know where to find the libraries for it.

I have had years of experience with multiple languages, everything from
CDC Compass (for the Cyber) to PIXAR assembler for the CHAP (that was a
GREAT machine, I loved it), from PASCAL to SNOBOL, and from LISP (more
dialects than I care to name) to C++. Please, leave nmap in C. You can
make all the C++ additions you want -- it's not like it won't compile
for you.

Sorry for the novelette, guess you touched a nerve.

.shrdlu

--
Computer security is an oxymoron.
Prepare for the worst.
                -- Bruce Schneier

---------------------------------------------------------------------
For help using this (nmap-dev) mailing list, send a blank email to 
nmap-dev-help () insecure org . List run by ezmlm-idx (www.ezmlm.org).



Current thread: