jacob said:
Keith Thompson a écrit :
We had this discussion already. I started yet another discussion about
the need for a portable standard container library several times and the
answers were:
Mr Flash Gordon, a "regular" here said: (11 Oct 2004)
"Not only can a lot of programing be done without using hash tables,
list, queues etc, but as I said a lot of programming *is* done without
using such things. Also the natural solution for a lot of problems does
not use such things.
In reply to you saying:
| Since the first message in this thread (admitted, polemic)
| I wanted to take a critical look at remarks like "I never use any
| data structures", and such, implying that C (or programming) can
| be done without using containers like hash tables, lists,
| queues, etc.
Is there anything wrong with pointing out that there are large problem
domains which
Our dear Dan Pop, another "regular" said... (21 March 2004)
"It's been 12 years since I've used a binary tree the last time. In the
meantime, the most complex data structure I *needed* to use was an array
of structures. And I suspect that many programmers use linked lists
only in their homework assignments. "
They fact that people have spent years on serious projects without the
needs of such things proves that you implication that they are required
for serious programming is false.
And everyone accepted those things in silence. Nobody complained.
Obviously they could see the point that there is a lot of serious
programming that does not require such things.
Oh, I just noticed, you appear not to have complained about my comment
either as far as I can see in Google.
The standards comitee doesn't even accept simple data structures like
strings. Lists, flexible arrays, stacks, queues, etc etc must be done
over and over, and are kept OUTSIDE the standard library.
They don't have to be done over and over again. Just pick an
implementation and keep using it.
Why?
Because everyone should use the STL damm it!
Why?
I repeat that such an attitude towards data structures means that indeed
C is the past and C++ the dreaded future.
You (or others) can implement those things in standard reusable C if you
require then. In fact, since October 2004 my job has moved on and I've
done some work using a linked list library written by someone else in
standard C and I'm now using an XML library written in C (the bits I've
looked at are all standard C). I didn't have to write these libraries,
nor did I need them to be part of the C language to use them.
Just because you are unable to write a reusable linked list
implementation in standard C doesn't mean that others can't. To quote you:
| OK. That is what I wanted. I think that the language is making too
| difficult to do that. Each time I need a list, I have to rewrite
| a new set of:
| DATA_LIST *AddToList(DATA *item);
| FindInList(DATA_LIST *list,DATA *item);
| etc
Strangely enough you didn't respond (as far as I can see in Google) to
my suggested alternative interface that would not require rewriting each
time.
I am not inventing this Keith, you should know. You participated to
those discussions.
And you know perfectly well that when I say:
I am not insulting anyone but precisely arguing AGAINST that frame of mind.
We use complex data structures when we need them often just reusing
existing code. We don't use them when we don't need them.
Personally I would have no problem if some of the things you suggest
were added to standard C, but that is a discussion for comp.std.c as has
already been pointed out. Or for the standards committee if you want to
join it.
--
Flash Gordon, living in interesting times.
Web site -
http://home.flash-gordon.me.uk/
comp.lang.c posting guidelines and intro:
http://clc-wiki.net/wiki/Intro_to_clc
Inviato da X-Privat.Org - Registrazione gratuita
http://www.x-privat.org/join.php