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




> >It has complex rules.  It does too many implicit things all by
> >itself. 
> 
> Complex rules?!  So what - learn a working set and then code.  

This is probably fine for a 1-person project.  The person chooses the
subset it feels confortable with and deals with that.  Now, say, in a
20-person project, each one chooses a slightly different language
subset.  Now, try to maintain that. 

> 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.

Ok, well, I really do not intend to code my next project using
templates if they are going to require me to use a 128-meg machine to
compile the code.

> Lots of C code revolves around a big switch.  This is a fact.

Just non-OO C code.  Old C code perhaps.  We have learned a lot from
the past years.  And no, it does not mean "use C++". 

> 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++.

Exactly, what do you think virtual functions are?

Now, I want you to tell me where the code bloat appers in the C
picture, because I can not figure it out.

> 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.

We are not trying to do a rethorics excercise here.  Please, stay
focused.

> 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.

Both CORBA and Gtk use a very clean approach, which I have come to
like as of late:

	module_object_method

example:

	gtk_label_set (l, "string");
	
Which describes precisely the action being performed.

The C++ way of doing this is:

	l->set ("string")

Which leaves us with the question of what exactly is "l" and what is
the "set" doing there.

Now, Objective-C goes one step beyond -in the right direction- and
lets you do:

	[l setString: "string"]

Every parameter gets a name, so you always can figure out what is
going on, like in:

	[l setString: "string" withFont: lucida withSize: 5];

Ok, it was a bad example, but nevertheless, it points a nice feature
of Objective-C.

Miguel.



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