jacob navia wrote:
> santosh wrote:
>>
>> C is not, and can never be, a "safe" language like Java or C#/.NET. If
>> you want a "safe" language, you can use one of them.
>>
>
> This means that interfaces like strncpy of gets or asctime are OK?
Of course not. It means that care should be taken when they have to be used
and, whenever possible, they should be replaced with better, preferably
standardised alternatives.
Most of them do have viable alternatives. Granted they are not incorporated
in the C Standard, but most s/w projects are not purely ISO C, and these
common alternatives are easily used.
> I mean nobody is saying that we should eliminate pointers (as Java does)
> but is it necessary to keep every wart in the
> language forever?
For backward compatibility for the foreseeable future, yes. But just being
in the Standard doesn't mean that good programmers have to use them.
> This attitude of "C is so dangerous anyway that it is better to leave it
> die a peaceful death" leads to the death of C as a programming language.
No one said this. C is what it is. Trying to change it support every Latest
and Greatest feature and every implementor's pet ideas won't serve the
language well.
This is why conforming implementations are expressly allowed to have
extensions. If your extensions really are in great demand and are very
useful, it should become heavily used in time.
Now tell me what fraction of C code out there uses operator overloading and
garbage collection and bignums? Of course it doesn't help that the only C
implementation that implements these "extensions" is wedded to the
Microsoft platform.
> Yes, it will survive a few years in small circuit boards but then, even
> those will disappear.
I think you are being overly pessimistic, and in any case, you are
forgetting the enormous amounts of code that needs to be maintained.
>> C was designed to be effectively used by those who take the time and
>> effort to understand it's design choices and their ramifications.
>>
>
> Yeah the elite...
>
No, the competent.
When basic competency is required in all the rest of science, why should
programming alone try to bend over backwards to accommodate the clueless?
>>> The GNU people do not discuss C anymore, and their compiler is a C++
>>> compiler, where all development is done.
>>
>> This is most likely untrue. You are engaging in polemic.
>>
> o GNU doesn't participate in any discussion or standards
> committee about improving C or is a part of the standardization
> effort as far as I can see.
Not participating in Standard related processes doesn't mean that the C
compiler is not being actively maintained and improved.
> Their compiler doesn't introduce anything
> new or innovative for C since several years. Yes, they were innovative
> at the beginning, in the 90s.
You seem to believe the FUD that a product has to always do something "new"
and "innovative" to be useful.
C itself is a good counter example. It has had relatively few additions
since the 1989 ANSI standard, yet it remains a widespread and popular
programming language.
> But then they have all their hands
> full with C++ and stopped any C development.
This is probably untrue. They are among the few widespread compiler to have
implemented much of C99, and incremental improvements are probably still
happening.
OTOH, it's also true that C++ is such a complex language for the
implementor, that it tends to dry up time and resources for other areas.
>>> There are no technical reasons for this situation. It could be possible
>>> to clean and expand the standard library, one of the most glaring
>>> deficiencies of the language. Designed in the 70s, it hasn't changed
>>> since then, and it shows!
>>
>> Most platform already have suitable and Standardised, (not C Standard),
>> alternatives to many Standard C functions.
>>
> And why couldn't we standardize them in the language then?
The response C99 has received from implementers and programmers shows that
most people want C to remain small and simple, allowing each project to use
whatever additions it wants on an as-needed basis. This is both flexible
and keeps the core language small and efficient.
<snip>
>>> It knows nothing about containers, hash
>>> tables, stacks, linked lists.
>>
>> All of these are, in most situations, already available in the form of
>> preexisting libraries. The GNU GLib is an example.
>>
> All of those libraries are not standard, then the user is burdened with
> learning each one of them in each platform!
>
> If C had a standard interface for lists, stacks, etc, the programmers
> could choose from different implementations offering the same interface!
>
> Programs would be much more portable!
How do you say this. All the above data structures can be implemented in
fully portable C. All that is required is an initial implementation which
can then be re-used with minimal modifications under all conforming
compilers.
>>> Making a better string library, allowing for operator overloading for
>>> containers and new numeric types, improving the language to adapt it
>>> to the new hardware environment available is frowned upon, "that
>>> wouldn't be C", as if C would disappear if we put strncpy and gets
>>> in the trash can.
>>
>> Yes, if you exceed a certain threshold for modifications to the language,
>> there will come a time when calling it C would become misleading and
>> disingenuous. Your lcc-win32 language is heading in that direction.
>>
>
> typedef struct tagString { size_t length; char *data; } String;
>
> This is NOT C. Calling this C would be disingenious.
Maybe not but things like operator overloading, function overloading,
default arguments _are_ substantial changes to the core language, to the
extent that I would categorise any code that makes heavy use of these
features as not C.