Re: C++ & gnome (was: Re: opening Gnome to multiple (windowing) systems)

My last comment (I promise)..

On Thu, 9 Apr 1998, Miguel de Icaza wrote:

>Well, strings are still implemented as chars.  You still do have
>buffer overflows, C++ is basically: C + objects + every single
>feature they could come up with.

Well to be pedantic they are *USUALLY* implemented as  char* but since
string is a typedef of bstring<char>, a string can also be wchars.  So you
make the switch way up in the hierarchy and you can use unicode.  Try that
with C and its a major search and replace exercise.  Or preprocessor
trickery.  Choose the hack.

>So, the language, unfortunatelly is still too close to the machine.
>If you wanted all of those wizbang features, why not start by using a
>language that designed things correctly (as the TOM, and Java people

Not familiar with TOM but Java unfortunately is owned by a single vendor
(Sun) and is in a state of flux.  Also Java is growing pretty complex
(inner classes, closures, etc) and its classes are becoming pretty
byzantine (you try and keep up with all the developments).  Some of the
design decisions are only now (in 1.1) being sorted out like the events
etc.  I can continue here...

C++ is as close to the machine as you want it to be.  Its all about

>Now, lets see the rundown of features of C++:
>> C++ has nothing that SmallTalk, Simula and other languages have.
>It has complex rules.  It does too many implicit things all by

Complex rules?!  So what - learn a working set and then code.  C code
trades language complexity for nasty implementation tricks and
gross hacks.  Passing pointers around.  Public structures.  Returning
error codes.  Ugghhh!

>> In addition C++ has some real neat stuff (that *CAN'T* be
>> done in  C like templates).
>Yeah, I have noticed templates.  To compile some Mico source files
>(which makes use of templates to some extent) you need 48 megs of ram.
>I wonder what will happen in a couple of years when people abuse

People are abusing templates already.  From day one.  That does not mean
that templates are a great way to elegantly solve certain problems.  Smart
pointers come to mind.

>> Polymorphism allows programmers to avoid the C monster switch
>> statements.
>False.  You can do this just fine in plain C.  Ever wondered how
>Microsoft's COM works?

False, what do you mean?  Lots of C code revolves around a big switch.
This is a fact.

Microsofts COM runs off an array of function pointers (implemented as a
vtable).  Are you seriously trying to equate C++ virtual functions with
what could only be considered as a C kludge?  Talk about code bloat. 
Anyway COM is hardly a choice I would want to use in order to advocate C
over C++.

>> Exceptions and RTTI are also invaluable tools.
>Those were not around when I learned C++.  I see they have been busy
>adding even more features to an already bloated language.  No wonder
>the Netscape people avoid so many C++ features to get portable code.

Well structured exceptions and RTTI are part of the spec now and represent
great features.  Bloated - says who?  Sun, who went off to invent java?  A
modern programming language that implements OO needs to have more language
functions.  Bloated, what compared to C, or Ada, or Modula 3 or even.  C
is "bloated" compared to assembler.

>I still think that raising the programming level is the right approach
>in this context.  

Fair enough, I just don't think that C provides sufficient abstraction for
an application programmer.  And also C's namespace gets more and more
cluttered until hungarian notation and other nomenclature conventions are
required to avoid clashes.

>> Delphi is a fine product and deserves more attention than it gets.
>> Although I don't really fancy pascal - those 'begin's and 'end's
>> drive me batty.
>Java is basically ObjectPascal with C syntax.  

No, its more like SmallTalk with C-like syntax.


(My last word).

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]