Boost logo

Boost :

From: Pavol Droba (droba_at_[hidden])
Date: 2003-10-29 02:13:46


On Wed, Oct 29, 2003 at 12:09:23AM -0000, Andy Little wrote:
>
> "Ross MacGregor" <ross__macgregor_at_[hidden]> wrote in message
> news:bnmmlm$vsd$1_at_sea.gmane.org...
> >
> > Rob Stewart wrote:
> >
> > > From: David Abrahams <dave_at_[hidden]>
> > >
> > >>I don't get it. The first element of a sequence is s[0]. Why
> > >>shouldn't the first matching substring be find_nth(s, XX, 0)?
> > >
> > > Because s[0] isn't the 0th element; it's the first. As I said,
> > > we use ordinals to refer to things like this. Addressing an
> > > element uses an index, and indexes start at zero. "nth"
> > > explicitly refers to ordinals, and there's no 0th; you start with
> > > 1st, so find_nth() should reasonably start numbering from one.
> >
> > Yes agree with Rob on this one. I have been using 0 based indexes for a
> > long long time, but when i see find_nth(), I expect 1 to be the first
> > occurence.
> >
> > I think in this case naming guidlines should override convention or
> > usage concerns. If you use a term like "nth" in the name, it should
> > reflect its usage in the english language.
>
> "offset" does it for me... find_offset() ...?

If just a name is confusing, I have no problem to rename it. However the problem
would be to find the better name. I don't like find_offset. It does not
decsribe what it is suppose to do.

Pavol


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