[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-core-devel
Subject: Re: inefficient QString coding practice
From: Lars Knoll <lars () trolltech ! com>
Date: 2004-03-14 14:03:07
Message-ID: 200403141503.07690.lars () trolltech ! com
[Download RAW message or body]
On Saturday 13 March 2004 20:05, Tobias Koenig wrote:
> On Sat, Mar 13, 2004 at 07:35:21PM +0100, Lars Knoll wrote:
> > On Saturday 13 March 2004 15:02, Harri Porten wrote:
>
> Hi Lars,
>
> > We actually know about this problem and already have a solution for this
> > in Qt 4. It's called QLatin1String and is a simple wrapper around a const
> > char *.
> >
> > So you can then write
> >
> > 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?
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.
Lars
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic