Boost logo

Glas :

[glas] Design Principles

From: Rainer Blome (rainer.blome_at_[hidden])
Date: 2005-02-03 04:34:14


Hi.
Related to the discussion whether assignment of vectors of different sizes should be allowed,
I think it would help to identify a number design principles that may help to decide issues like this.

Examples would be (some taken from postings):

David Abrahams> will it [a safety measure] prevent enough bugs
  to justify the inconvenience?

Toon Knapen> if [a feature] is done under the hood, people will be surprised
 by the performance(-penalties) they get.

Theodore Papadopoulo> catch [...] problems as soon as possible.

My 2 pennies:

o Avoid implicit conversions, they will hurt you (performance- and safety-wise).
   Instead, make explicit conversions easy.

o If it's not required, it should not have to be paid for.
   Stay "Lean and mean".

   For example, a program that does not benefit from
   the convenience of implicit resizing should not have to
   pay the prices of it (performance hit, less errors caught at compile time, etc.).

o Make things explicit in general, enable the programmer to express her thoughts.

Rainer

__________________________________________________________
Mit WEB.DE FreePhone mit hoechster Qualitaet ab 0 Ct./Min.
weltweit telefonieren! http://freephone.web.de/?mc=021201