Re: STL / Qt flame-war (Re: [linux-audio-dev] Audio-related widgets with Qt ?)

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: STL / Qt flame-war (Re: [linux-audio-dev] Audio-related widgets with Qt ?)
From: Tommi Ilmonen (tilmonen_AT_cc.hut.fi)
Date: Mon Sep 17 2001 - 17:44:47 EEST


Hi.

On Mon, 17 Sep 2001, Jelle wrote:
> However, lists are linked lists, not arrays, and thus can only forward and
> backford access items, but not random access. If you want that you have to
> use a vector.

> for(list<X>::iterator i = mylist.begin(); i!=mylist.end(); i++)
> mylist.erase(i)

I know. But STL could still provide an easier way to do it. I prefer this:

mylist.remove(4); // Yes, I know this would be evil with long lists.

> > STL does have some really nice stuff, but I seldom need/use it anyhow.
>
> THat is a shame, the STL is really very practical.

I use when it offers things that I need. For many of my purposes QList is
in fact better (less code, smaller binaries). And I do like Qt's documentation.
I also use my own array class since it has range checking than can be
switched on/off as needed.

> Also, it's unlikely that you will write are more efficient/complete custom
> version of anything in the STL. It's really very versitile.

The amount of features is seldom the problem. The ease to access them can
be. Plus I like libraries that do safety checks and then give explicit
error messages.

> > At any rate, I find the question of containers is not very important. Qt
> > API usually hides the containers from the application developers
> > (QString and QStringList are some of the exceptions) so app developers
> > are free to use what-ever containers they like -> I do not see a conflict
> > between STL and Qt (since std::string is useless from my perspective
> > anyhow and strings are the only really obvious place where one is better
> > off using one standard only).
>
> At some point you are going to feed a widget a list or a string and it would
> be neat if that is the same one you use in the rest of your code.
>
> It really sucks when you need to write conversion routines to go from
> STL to wxString, qtString etc..

That is very true. But does one actually need conversion routines ? I
believe all of these string classes can cast themselves to/from
"const char *". So the problem is the performance penalty (which may be
significant or not).

> > a few hundred times. Then I decided that enough is enough and went over to
> > Qt instead. I believe Qt has cost me fewer crashes in two years than GTK
> > in a few days. This -- of course -- proves nothing besides the fact that
> > GTK is not the idel toolkit for *me*.
>
> Hmm. OK. You probably did something wrong ;)

I know ;-) But GTK was a library that allowed me to do so; Mentality
mismatch.

Tommi.


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Mon Sep 17 2001 - 17:43:09 EEST