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

List:       kde-core-devel
Subject:    Re: inefficient QString coding practice
From:       Simon Hausmann <hausmann () kde ! org>
Date:       2004-03-14 14:45:24
Message-ID: 200403141545.24594.hausmann () kde ! org
[Download RAW message or body]

On Sunday 14 March 2004 15:34, Tobias Koenig wrote:
> > > > if(str == QLatin1String("foo")) { ... }
> > >
> > > Hmm, and you think the lazy developer will type 'QLatin1String' for
> > > every short "foobar" string?!?
> > > Can't we use a shorter name? Such a long name disturbs the whole code
> > > layout.
> >
> > Currently we have QString::fromLatin1(...). Is that better?
>
> No, and that's the only reason why I never use it ;)
>
> > You can always use a typedef if you think the length is really
> > disturbing. I still prefer long but descriptive names to short but
> > unclear ones.
>
> me too, but not when you have to write it that often like this one.

Really, how often do you have to write it?

QLatin1String is for corners in library development. Most of the time
if ( bleh == "foo" ) doesn't really matter performance wise, in an 
application.

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

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