Re: Plans for 2.8 - GNOME Managed Language Services?



Hello,

> > On the performance side of things, in my opinion C# got something right
> > that Java did not: the default for methods is to not be virtual, while
> > the default in Java is to be virtual.
> 
> Exactly the thing I hate about C++: it's quite more common that you
> care about having virtual methods than you care about such increase in
> performance.  Those who care about performance more than ease of
> coding are invited to do whatever's necessary (mark methods
> non-virtual or whatever), IMHO.
> 
> After all, if we try to bring such points ("it might be easier and
> less error-prone to code in Java, but C# is faster"), then C is a
> clear winner over both: it's (even) harder to code in it, but result
> is (usually) faster.

I did not want to go into a more complete debate, but Anders makes a
very good point about the problem with making every method virtual, and
I side with him.

Every time you make a method virtual, you are defining an entry point
into the class hierarchy.  It is a point that must be documented, and
pre-conditions and post-conditions explicitly stated, as well as what
the override is supposed to do.

For the interview, see:

	http://www.artima.com/intv/nonvirtual.html

Miguel.



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