Newsgroups: comp.lang.c++,comp.lang.smalltalk,comp.object
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!news.mathworks.com!newshost.marcam.com!zip.eecs.umich.edu!newsxfer.itd.umich.edu!agate!library.ucla.edu!csulb.edu!csus.edu!netcom.com!nagle
From: nagle@netcom.com (John Nagle)
Subject: Re: C++ Productivity
Message-ID: <nagleD3IFGn.wD@netcom.com>
Organization: NETCOM On-line Communication Services (408 261-4700 guest)
References: <1995Jan23.193745.7044@boole.com> <jim.fleming.84.00133AB6@bytes.com> <1995Jan25.201226.28856@rcmcon.com> <jim.fleming.75.0003AF13@bytes.com> <3gls1u$p2l@osfa.aber.ac.uk> <1995Feb1.184049.16332@rcmcon.com> <D3E33s.DCp@da_vinci.ecte.uswc.uswest.com> <1995Feb3.172403.2977@rcmcon.com> <3h178j$nrq@panix.com>
Date: Sun, 5 Feb 1995 04:36:23 GMT
Lines: 38
Xref: glinda.oz.cs.cmu.edu comp.lang.c++:110990 comp.lang.smalltalk:20365 comp.object:26142

dsiegel@panix.com (David Siegel) writes:
>In <1995Feb3.172403.2977@rcmcon.com> rmartin@rcmcon.com (Robert Martin) writes:
>>As for type conversions, yes, it takes a while to get used to strong
>>typing.  However the benefits are significant.  Many of us prefer to
>>use strongly typed languages.
>Which is why many of us prefer Smalltalk.  While C++ is more eagerly typed,
>it's much weaker -- keeping track of C++'s various implicit copies and
>conversions is mind-numbing.

     One big problem with C/C++ is that C wasn't designed as a strongly
typed language.  Strong typing was retrofitted, and it shows.  
(Even "typedef" was an afterthought.)  In a
strongly typed language, such as Pascal, any of the Modula family,
Ada, and Oberon, when a program compiles and links you have considerable
confidence that whole classes of errors have already been eliminated.
Neither C nor C++ provide that level of assurance.

     The general experience of programming in, say, Modula 2 is that
getting programs to compile and link is hard, but once the program is
built, it's already fairly far along in debugging.  The downside of 
strong typing tends to come when linking to weakly typed systems 
(such as, say, the MS Windows API) is required.  Trying to develop
a Modula or Ada binding to an API not designed for strong typing presents
serious problems.  (Wirth's "solution" to this has been to develop
his own small operating systems, but nobody runs them.)

     C++ can be written in a strongly typed way, but with the prevalence
of "void *" and casts in existing code, a successful program build doesn't
provide the level of confidence one has with Modula 2 or Ada.

     Cleaning up C++ is possible.  With templates and RTTI, there's very
little need for old-style casts and "void *".  Over time, they should
be phased out.  It's worth noting that the ARM prohibits some of the
more dangerous casts which some compilers (notably GCC) still allow.
The new cast syntax makes it clear when something dangerous is being done,
which is a huge aid to software maintenance.

					John Nagle
