[Kmymoney-devel] Re: Set and Get, or what?

Cristian Oneţ onet.cristian at gmail.com
Wed Oct 27 21:22:40 CEST 2010


On Mon, Oct 25, 2010 at 12:56 AM, allan <aganderson at ukonline.co.uk> wrote:
> Now I'm back in 'production' mode, I've found a bug had crept in to the
> patches I put up yesterday for the csv plugin.  It didn't show up during
> the testing I did following the implementation of the set and get
> routines, because I made the mistake of not making a mistake.  What I
> mean is that all worked well If the correct column numbers were used,
> but if a mistake was made and I had to clear the settings, then the
> problem showed up.
>
> I obviously wasn't thinking very clearly when I did one of the changes,
> didn't like the way I had done this particular one, changed it a bit
> dubiously, but as it seemed to work, I left it.  I've now corrected that
> error.

Just a suggestion try to drop the really long intro's in the future
:). It only help confusing the reader. If someone wants more info
he'll ask. Take this as a friendly advice :).

> Which brings me finally to my query.  It revolves around a set method,
> which I only ever need to clear the setting, never to enter a new
> value.  In the body, I do the clear() of the field, which I would really
> need to explain in the header.  Or, is it OK for this particular set
> method to be named clearXxxx(), instead of setXxxx()?  My leaning is
> towards the latter, but don't want to upset any purists<BG>  In general,
> can I please myself about naming, while accepting style requirements and
> transparency?  I think this is about such transparency really.

If the method only clears something and does not set something than
it's name should be clearXxxx(). You don't need to worry about
upsetting anyone since where all in this for the fun not to get upset
:).

Regards,
Cristian


More information about the KMyMoney-devel mailing list