[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    Re: Font dialog
From:       David Faure <faure () kde ! org>
Date:       2005-06-26 16:04:25
Message-ID: 200506261804.25762.faure () kde ! org
[Download RAW message or body]

On Sunday 26 June 2005 17:09, Thomas Zander wrote:
> On Friday 24 June 2005 12:11, Clarence Dang wrote:
> > > I personally find this kind of avoiding future problems kind of
> > > silly; if you make this mistake 2 or 3 times; the next time check
> > > your change before you start compiling.
> >
> > So you've never made this mistake again _ever_?
> 
> I avoid switch statements unless I _need_ fallthrough since they take up 
> more screen space in my coding window as opposed to 
> if() { \n }else if () {\n}  structures.

That's wrong thinking though, the compiler can generate something much better
with a switch (even if you don't use fallthrough) than when you use if/elseif/etc.
You also get nice warnings if you forget an enum value, etc. When you can use
a switch, use one.

But anyway, I can see that this "break after return" discussion is turning into
a matter of style and preference, so let's stop it here. It's still the first time
I see it after years of reading KDE code (and I think it can be a bit confusing, to
write code that's never reached), that's why I reacted to it in the first place.

-- 
David Faure, faure@kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).

_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic