Flash said:
So why did you start talking about operator overloading?
Operator overloading is just syntatic sugar.
For hash tables, for instance, or for lists, the normal call
syntax is perfectly OK.
Syntatic sugar is needed when you want to access data structures
like a length prefixed string using the normal syntax
String a;
....
a[2] = 'b';
instead of
setStringChar(a,2,'b');
what is more cumbersome.
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.
As has been stated repeatedly, discussing the implementations of such
things in standard C is fine here.
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
I have done it countless times, and I think this is one of the
reasons C is perceived as a language unable to program anything serious.
> The problem is you telling people to
use your extensions to C such as operator overloading or telling people
to use your implementation of such things if it is not written in
standard C and freely available.
lcc has been always an experimental compiler where people can try
new ideas. The objective of my implementation of operator overloading
and other "extensions" is to *prove* that this can be done in a
simple way in a simple compiler. That was the objective. And I would
like that the community as a whole reflects on the possibility of
incoporating those extensions into the language, making my special
implementation unneeded.
But even without those extensions, a simple standard about lists,
would provide a much needed simplification of programs, increasing
portability and reliability. How many bugged implementations of those
lists primitives are there?
The polemic that I used (and that I regret now) arises from an
incredible feeling of frustration with a community that is slowly
drifting into obsolescence without noticing it.
I mentioned the reaction of the comitee confronted with the buffer
overflow bug written in the asctime() function in the standard.
I cited the answer to the first bug-correction proposal of Mr Cleaver
(memory overwrites are allowed) but nobody seemed to notice.
If you want to discus extending the C language or the standard C library
then that belongs in another group. Others have stated the name of the
group but I can't be bothered to look it up.
Maybe, but in comp.std.c there are more or less the same people.
I doubt it that the reaction would be different. I mentioned
(in a long thread) the fact that asctime() had a bug, but the
reaction was the same:
Nobody cares.
I have been told in this group that C++ was designed to do this
kind of stuff. This implies that C should stay in the same level
as 1989 forever, what fits nicely for people that think that only
C++ has any future.
I think that the agnostic nature of C gives the programmer a lot of
creative freedom, freedom of expression. There isn't a single,
language preferred way of doing things (OO programming) but you
can use any paradigm that fits the application best.
The complexity of C++ is so staggering, that most people, even
experts, do not understand the language in all the facets it
has. C++ has gone the "let's complxify things" until ridiculous
heights.
Confronted with that, I think that is normal that people react strongly
when presented with something that seems to go in the same
direction.
But this is not the case here.