My own objection to the proposal is simply that there are a trillion
ways to do this, and any single way is going to meet with approval by
some and disapproval by most. A similar argument can be made against
providing C's existing string library (and such an argument may well
have been made at the time). We got one anyway. Whether this is a
Good Thing is a matter of opinion!
The big difference:
C's string library is one of essentially two ways to do it; you can either
use a length indicator or a sentinel. It's fairly lightweight and maps nicely
to a number of conventions and idioms, and there are chips out there that have
instructions which map nicely to it, as I recall.
The string library imposes an extremely minimal data structure, and there
was a compelling need for that data structure to exist -- C would be much
less useful without the ability to use string literals for messages!
The container library isn't something you'd run into while writing "hello,
world!". It's a fairly specialized application, and it's a field where there
is a very noticeable tradeoff between efficiency and generality. Furthermore,
it specifies a fairly complicated data structure -- MUCH more complicated
than any currently in use, and I think the relative lack of complicated and
yet specified data structures in C is intentional.
A C-like container library ought to specify the interface, not the
implementation... But in this case, interface and implementation are fairly
closely tied together. When I did my list library, I picked a naming
convention for functions, declared a single struct type with which user
types were supposed to be compatible, and left it at that. It only does
one thing (lists) rather than other kinds of containers, but it imposes
only a very small amount of structure on you.
In general, I guess, I view data structures as a matter for the programmer
to decide in individual cases; not something that should be encapsulated in
the language spec. The few cases where C has structures (e.g., struct tm)
have by no small coincidence also been sources of major pain for many users.
-s