Boost logo

Boost :

From: vesa_karvonen (vesa.karvonen_at_[hidden])
Date: 2002-01-16 05:11:37


--- In boost_at_y..., Toon Knapen <toon.knapen_at_s...> wrote:
> I find the size1() and size2() not very intuitive unless their
names are
> chosen to align with the storage (major-row ?) in which case I
think the
> name breaks encapsulation.
>
> Would'nt it be easier to just call them nrows() and ncols() for
instance ?

hmm... I haven't been following this discussion, but if I understand
the topic correctly, then none of the names you are discussing above
are anywhere near optimal in my opinion.

You really don't want to use distinct names for dimensions. If you
do, then it is much more difficult to change the order in which you
traverse 2 or more dimensional arrays (I guess these are matrices in
this case). I've done this design mistake in that past and I know
from experience that it leads to unnecessary duplication of code.

So, consider using something like size(dimension) instead.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk