Universal escaping in KConfigINI: Summary and patch

Oswald Buddenhagen ossi at kde.org
Fri May 25 11:05:14 BST 2007


On Fri, May 25, 2007 at 11:28:23AM +0200, Andreas Hartmetz wrote:
> On Friday 25 May 2007 09:02:26 Oswald Buddenhagen wrote:
> > buuut ... having the default last is *still* the right thing to do. ;)
> >
> OK, braindump: IMO "default:" is usually last not because "default:"
> has to be last, but because it usually handles the error case, which
> isn't as important to the understanding of the code as the normal
> case. In this particular case, "default:" handles the normal case so
> it's first. What-ever.
> 
my braindump goes like this: default as in "everything else". having
it first is a bit like top-quoting ...

> > > we cannot discuss minor stuff forever
> >
> > oh, c'mon ... are you in a hurry? :-D
> >
> There was this thing... I think it was called release plan :o
> Yeah, who reads release plans anyway? xD
>
what is a release plan, anyway? >8-)

> > your patches are made with -b, right?
> Uh, I had to look up what -b even means ("ignore whitespace changes").
> My patches are made with "svn diff".
> 
maybe you have it in the .svnrc. i'm asking because you have some
weirdly indented braces which simply makes no sense unless they are at
the old positions.

> > > +        escape:
> > > +            *r++ = '\\';
> >
> > i unindent goto labels only half an indent step. maybe you find it more
> > appealing, too. ;)
> 
> I don't like half-indentions.
>
too bad. :}

> Goto labels just don't fit in well in C/C++ and I see no good way to
> change that.
> 
correct. i find the half-indents to be as close to looking good as it
gets.

> > > +            *r++ = nibbleLookup[((unsigned char)s[i]) >> 4];
> > > +            *r = nibbleLookup[((unsigned char)s[i]) & 0x0f];
> >
> > you overdid the casting, but readability-wise it is better your way.
> > it might get even better if you line up the equal sign and change to 15
> > again. :)
>
> Except for very mathematical code, I tend to think that lining up statements 
> makes them look silly.
>
so do i. i just think it fits in this case. whatever.

> And for bit manipulations I *think* in bits, so I write in bits/hex.
>
you wouldn't claim that you have to think even a centisecond to
recognize a 2^n-1 with n<=8, would you? :-P
and for very small numbers this doesn't matter anyway ... but maybe i'm
already at the next level. ;)

-- 
Hi! I'm a .signature virus! Copy me into your ~/.signature, please!
--
Chaos, panic, and disorder - my work here is done.




More information about the kde-core-devel mailing list