KRandomSequence's methods constness and naming issues

Robert Knight robertknight at gmail.com
Fri Dec 15 15:49:14 GMT 2006


> Hmm... next? next to what? :)
> How about perhaps generateBool(), generateInt() etc?

next as in "next in the sequence of random numbers".  This naming
scheme is used in other APIs as well, for example:

http://java.sun.com/j2se/1.4.2/docs/api/java/util/Random.html

In addition you can also see this class as an iterator over an
infinite list of numbers.  In which case using a naming scheme similar
to Qt 4's own Java-style iterators would seem appopriate.

Either way, I would understand what was meant by generateInt,
generateBool, so that would also be ok.  I just prefer to try to use
naming that is similar to APIs which people already know.

On 15/12/06, Dmitry Suzdalev <dimsuz at gmail.com> wrote:
> 2006/12/15, Robert Knight <robertknight at gmail.com>:
> > Since these are values from a sequence, perhaps nextTypeName() would be
> > best.
> >
> > eg.  nextBool() , nextInt().
> Hmm... next? next to what? :)
> How about perhaps generateBool(), generateInt() etc?
>
> > > Can this change somehow break compilation of other modules?
> >
> > I don't think so.  I think it will change the method signatures ( and
> > therefore break the ABI ), so a recompile will be needed - but if you
> > are doing this in KDE 4 kdegames this isn't a problem.
> This is a class from kdelibs/kdecore. That's why I was asking :).
> kdelibs' audience is quite huge that's why I prefer to be careful :).
>
> Dmitry.
>




More information about the kde-core-devel mailing list