Jump to page: 1 24  
Page
Thread overview
Re: What's C's biggest mistake?
Dec 25, 2009
Sean Kelly
Dec 25, 2009
Walter Bright
Dec 25, 2009
bearophile
Dec 26, 2009
retard
Dec 26, 2009
Sean Kelly
Dec 27, 2009
Marco
Dec 27, 2009
bearophile
Dec 27, 2009
Walter Bright
Dec 26, 2009
Sean Kelly
Dec 30, 2009
BCS
Dec 30, 2009
Walter Bright
Dec 30, 2009
BCS
Dec 31, 2009
Walter Bright
Dec 31, 2009
bearophile
Dec 31, 2009
BCS
Jan 01, 2010
Kevin Bealer
Jan 01, 2010
dsimcha
Jan 01, 2010
Walter Bright
Jan 01, 2010
Don
Jan 01, 2010
bearophile
Jan 01, 2010
Walter Bright
Jan 01, 2010
Don
Jan 01, 2010
Walter Bright
Jan 01, 2010
bearophile
Jan 01, 2010
bearophile
Jan 02, 2010
Kevin Bealer
Jan 04, 2010
retard
Jan 01, 2010
BCS
Dec 31, 2009
retard
Dec 31, 2009
Walter Bright
Dec 31, 2009
Sean Kelly
Dec 31, 2009
dsimcha
Dec 31, 2009
Sean Kelly
December 25, 2009
Walter Bright Wrote:

> http://www.reddit.com/r/programming/comments/ai9uc/whats_cs_biggest_mistake/

On seeing this title I was going to interject "using pointers to represent arrays!" but it seems you beat me to it.  This is definitely the biggest problem with C.
December 25, 2009
Sean Kelly wrote:
> On seeing this title I was going to interject "using pointers to
> represent arrays!" but it seems you beat me to it.  This is
> definitely the biggest problem with C.

Also here: http://news.ycombinator.com/item?id=1014533

I find the responses to be very curious, particularly the "not in the spirit of C" ones. Then there are the ones who deny that this even is an actual problem in C code.

It reminds me of why I decided to work on D rather than keep pushing on those ropes.
December 25, 2009
Walter Bright:
>I find the responses to be very curious, particularly the "not in the spirit of C" ones.<

There are people that think of C as something set in stone, something that has a "necessary" design. Few years of discussions in the D newsgroups teach that instead C was not born as a single atomic perfect thing, it's a collection of design choices and design compromises, the original authors have chosen only part of the possible alternatives. And some of those design choices today can be improved. (In biology it's the same thing, a mammalian body like the human one is the result of a very large number of design choices, many of them are arbitrary, and some of them are just wrong).

Today D is not a replacement of C, because of its GC and few other things (I don't think today you can use D to create 1200 bytes long binaries that run on an Arduino CPU), but maybe a reduced-D can be used for that purpose too.

Bye,
bearophile
December 26, 2009
Fri, 25 Dec 2009 14:54:18 -0500, bearophile wrote:

> Today D is not a replacement of C, because of its GC and few other things (I don't think today you can use D to create 1200 bytes long binaries that run on an Arduino CPU), but maybe a reduced-D can be used for that purpose too.

Where can I download the compiler for this reduced-D? Let's be honest - even with upx exe compressor the binaries are huge. If you have micro- controllers with 64 to 128 kB of ROM, the best you can do with dmd is a 'hello world'. Unless a better fork of the language is made (without extra typeinfo, with optional gc - we need a compiler switch, compiling the stdlib is a PITA, and without template bloat -> smart linker, not some legacy crap made with assembler). A single version of D can't serve the tastes of all audiences.
December 26, 2009
Walter Bright Wrote:

> Sean Kelly wrote:
> > On seeing this title I was going to interject "using pointers to represent arrays!" but it seems you beat me to it.  This is definitely the biggest problem with C.
> 
> Also here: http://news.ycombinator.com/item?id=1014533
> 
> I find the responses to be very curious, particularly the "not in the spirit of C" ones. Then there are the ones who deny that this even is an actual problem in C code.

I'd be inclined to think most of these people are students or hobbyist programmers.  I couldn't imagine someone using C professionally and having this attitude.  Though there are certainly a lot of language lawyer wannabes on the NGs, so who knows.

> It reminds me of why I decided to work on D rather than keep pushing on those ropes.

And the programming community is better for it!
December 26, 2009
retard Wrote:

> Fri, 25 Dec 2009 14:54:18 -0500, bearophile wrote:
> 
> > Today D is not a replacement of C, because of its GC and few other things (I don't think today you can use D to create 1200 bytes long binaries that run on an Arduino CPU), but maybe a reduced-D can be used for that purpose too.
> 
> Where can I download the compiler for this reduced-D? Let's be honest - even with upx exe compressor the binaries are huge. If you have micro- controllers with 64 to 128 kB of ROM, the best you can do with dmd is a 'hello world'. Unless a better fork of the language is made (without extra typeinfo, with optional gc - we need a compiler switch, compiling the stdlib is a PITA, and without template bloat -> smart linker, not some legacy crap made with assembler). A single version of D can't serve the tastes of all audiences.

Yeah.  Even without the GC binaries contain a good bit of TypeInfo data.  I think we're getting to a point where this could be left out and the language would still be pretty much the same though.
December 27, 2009
bearophile Wrote:

> Walter Bright:
> >I find the responses to be very curious, particularly the "not in the spirit of C" ones.<
> 
> There are people that think of C as something set in stone, something >that has a "necessary" design. Few years of discussions in the D >newsgroups teach that instead C was not born as a single atomic >perfect thing, it's a collection of design choices and design compromises, >the original authors have chosen only part of the possible alternatives.

  For the most part the C design is complete at this point in its language lifecycle with only minor tweaks allowed in the core language that don't break existing ISO C90 standard code. C99 introduced VLAs which was a mistake bolting on a new feature.

Of course - cleanup of the standard libraries should continue.





December 27, 2009
Marco:

>C99 introduced VLAs which was a mistake bolting on a new feature.<

I may want those VLAs in D :-) They are more handy than using alloca().

Bye,
bearophile
December 27, 2009
Marco wrote:
> bearophile Wrote:
> 
>> Walter Bright:
>>> I find the responses to be very curious, particularly the "not in
>>> the spirit of C" ones.<
>> There are people that think of C as something set in stone,
>> something >that has a "necessary" design. Few years of discussions
>> in the D >newsgroups teach that instead C was not born as a single
>> atomic >perfect thing, it's a collection of design choices and
>> design compromises, >the original authors have chosen only part of
>> the possible alternatives.
> 
> For the most part the C design is complete at this point in its
> language lifecycle with only minor tweaks allowed in the core
> language that don't break existing ISO C90 standard code. C99
> introduced VLAs which was a mistake bolting on a new feature.
> 
> Of course - cleanup of the standard libraries should continue.


VLA's are not a mistake because they are a bolted on new feature. They are a mistake because they are poorly designed and have very limited utility.

On the other hand, I know the array proposal delivers because it's been very successful in D for nearly 10 years now. It won't break any existing code, either. And it's simple to implement (easier than VLA's).

It's just a win, all around.
December 30, 2009
Hello Walter,

> Sean Kelly wrote:
> 
>> On seeing this title I was going to interject "using pointers to
>> represent arrays!" but it seems you beat me to it.  This is
>> definitely the biggest problem with C.
>> 
> Also here: http://news.ycombinator.com/item?id=1014533
> 
> I find the responses to be very curious, particularly the "not in the
> spirit of C" ones. Then there are the ones who deny that this even is
> an actual problem in C code.
> 
> It reminds me of why I decided to work on D rather than keep pushing
> on those ropes.
> 

C is Latin, about 300 years ago: A dead language that no one uses but everyone knows. 


« First   ‹ Prev
1 2 3 4