www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - What's C's biggest mistake?

reply Walter Bright <newshound1 digitalmars.com> writes:
http://www.reddit.com/r/programming/comments/ai9uc/whats_cs_biggest_mistake/
Dec 24 2009
next sibling parent reply bearophile <bearophileHUGS lycos.com> writes:
Walter Bright:
 http://www.reddit.com/r/programming/comments/ai9uc/whats_cs_biggest_mistake/

Many people would say null pointers. I don't agree.<

Note that in this newsgroup I've asked for nonnull class references. I have said nothing serious about pointers. Please don't mix the two things.
C can still be fixed. All it needs is a little new syntax:<

Good luck moving that iceberg. Bye, bearophile
Dec 24 2009
parent Walter Bright <newshound1 digitalmars.com> writes:
bearophile wrote:
 C can still be fixed. All it needs is a little new syntax:<

Good luck moving that iceberg.

I've already thrown my hat in the ring with D <g>. The C standards group has already made two attempts to fix the array problem in C. Both attempts missed the mark by a wide margin. The development of so-called safe C libraries also show the interest in a decent solution.
Dec 24 2009
prev sibling next sibling parent reply Edward Diener <eddielee_no_spam_here tropicsoft.com> writes:
Walter Bright wrote:
 http://www.reddit.com/r/programming/comments/ai9uc/whats_cs_biggest_mistake/ 
 

This reminds me of the Java idiots when Java first came out. They discussed C endlessly trying to prove Java's supremacy as the new premier language, and either completely ignored that C++ existed or acted as if C++ was a computer language nobody actually used as opposed to that paragon of an up to date programming excellence circa 1996, the C programming language. Think how you will feel in 10 years when others belittle the D programming language, compared to other languages around in 2019, and are always referring to D version 1. While I admire much of the work you have done in creating D, it does not take much for an intelligent programmer to realize that your own view of C++ is jaundiced and heavily affected by what you perceive as D's improvements over C++. As a suggestion, which I don't expect you to take, you would do much better in viewing C++ in a more reasonable light while touting features of D which you feel is an improvement.
Dec 24 2009
parent reply Walter Bright <newshound1 digitalmars.com> writes:
Edward Diener wrote:
 Walter Bright wrote:
 http://www.reddit.com/r/programming/comments/ai9uc/whats_cs_biggest_mistake/ 

This reminds me of the Java idiots when Java first came out. They discussed C endlessly trying to prove Java's supremacy as the new premier language, and either completely ignored that C++ existed or acted as if C++ was a computer language nobody actually used as opposed to that paragon of an up to date programming excellence circa 1996, the C programming language.

C is still heavily used today for new code, so fixing a mistake in it is very relevant. It's a lot easier to add a simple compatible change to C than to convince people to change to a whole new language.
 Think how you will feel in 10 years when others belittle the D 
 programming language, compared to other languages around in 2019, and 
 are always referring to D version 1.

I expect that time will expose many mistakes in the design of D. How I feel about it would be quite irrelevant. My article was not about attempting to get anyone to switch away from C - it was how a simple fix to C will address a serious shortcoming. It will still be C. It is not fundamentally different from bashing C++ for not having variadic templates and then proposing variadic templates for C++0x.
 While I admire much of the work you have done in creating D, it does not 
 take much for an intelligent programmer to realize that your own view of 
 C++ is jaundiced and heavily affected by what you perceive as D's 
 improvements over C++. As a suggestion, which I don't expect you to 
 take, you would do much better in viewing C++ in a more reasonable light 
 while touting features of D which you feel is an improvement.

Many people have suggested I stop comparing C++ to D, and they're right, and I have generally done so. As for my view of C++ being jaundiced, consider that I have been in the C++ compiler business since 1986 or so. I'm still the only person who has written a C++ compiler from front to back. I still support and maintain the C++ compiler. C++ has been good to me - professionally and financially. I did not discover D and become a fanboy, it was created out of my frustrations with C++. Of course I perceive D's improvements as improvements over C++ because I deliberately designed them that way! I have a C++ compiler, I wrote nearly every line in it, I know how it works and how to implement all of C++'s features. So if D doesn't work like C++ in one way or another, there's a deliberate choice made to make the change - not I didn't know how to do it. In other words, I don't feel my view of C++ is based on prejudice. It's based on spending most of my professional life developing, implementing, and using C++. C++ did a lot of things right, and you can see that in D. My opinions might still be wrong, of course. I have another blog post I'm working on that lists several design mistakes in D <g>. I hope you'll find it enjoyable! Andrei and I were just talking about programming language books, and how we both thought it was disingenuous that some of them never admit to any flaws in the language. We hope we don't fall into that trap.
Dec 24 2009
parent Max Samukha <spambox d-coding.com> writes:
On 25.12.2009 2:31, Walter Bright wrote:
 Edward Diener wrote:
 Walter Bright wrote:
 http://www.reddit.com/r/programming/comments/ai9uc/whats_cs_biggest_mistake/



 My opinions might still be wrong, of course. I have another blog post
 I'm working on that lists several design mistakes in D <g>. I hope
 you'll find it enjoyable!

That would be helpful. Not knowing that a feature is actually a design mistake may lead to painful revelations in the future. Also, I suggest mentioning, which design mistakes are going to be fixed and which are considered unfixable without major (and unlikely) language redesign.
 Andrei and I were just talking about programming language books, and how
 we both thought it was disingenuous that some of them never admit to any
 flaws in the language. We hope we don't fall into that trap.

Dec 25 2009
prev sibling parent merlin <merlin esilo.com> writes:
Walter Bright wrote:
 http://www.reddit.com/r/programming/comments/ai9uc/whats_cs_biggest_mistake/ 

That's a big one. I don't know if it's the biggest, there are so many to choose from: *) lack of standard bool type (later fixed) *) lack of guaranteed length integer types (later fixed) *) lack of string type and broken standard library string handling (not fixed) *) obviously wrong type declaration (int v[] not int[] v) *) grammar not context free (so close, yet so far...) *) lousy exception handling implementation IMO, had a few things gone differently with C, Java, C++, and other attempts to simplify/fix it would not have happened. D is the only language that really got it right IMO. merlin
Dec 30 2009