[Exceptional C++ Style] Item 18 - Virtuality

Adrian Fagg adrianf at evaluategroup.com
Wed Jan 5 04:56:31 EST 2005


> -----Original Message-----
> From: effective-cpp-bounces at accu.org
> [mailto:effective-cpp-bounces at accu.org]On Behalf Of Jon Jagger
> Sent: 04 January 2005 12:42

> You'll probably not be surprised to learn that I disagree with the 
> advice Herb gives on this.
> Does anyone else have strong misgivings about it too?
> Cheers
> JJ

Yes indeed. The trouble is that Sutter writes on this so compellingly, that it feels almost churlish to argue against it. It actually convinced me for several hours when I first read this, but as Kevlin has already said, it's the Template Method aspect that rings the bell.
I wouldn't go so far as to say that NVI is never the right thing. There are some scenarios in languages other than C++ where NVI is a recognisable idiom.

I really do feel that the case is too weak for this to be a guideline, either here or in other recent and influential style guides.

Regards,

Adrian

Work: mailto:adrianf at evaluategroup.com
Home: mailto:adrian.fagg at ntlworld.com

Pretty pictures: http://homepage.ntlworld.com/rbyadf/ 





More information about the Effective-cpp mailing list