[vox] things that really suck about C!
Matthew Van Gundy
matt-lugod at shekinahstudios.com
Sun Feb 28 23:04:05 PST 2010
On 2/28/10 6:35 PM, Brian Lavender wrote:
> I think if anything, C has been a certain detriment to the field of
> computer science!
Ah... it's easy to say that nearly 40 years after C's inception. It was
quite a revolutionary development at the time. If I remember my history
correctly, two of the major design goals for C were that it be
consistent (few special/end cases) and that it its constructs run
efficiently on production machines. I think that the fact that C is
still in wide-spread use in the field is a testament to how forward
thinking it was for the time. How many programs have you used that were
written in Algol, COBOL, PL/I? C has it's weaknesses and limitations
but it has proved its utility over the years.
> One calls a function and the arguments are passed by value. Call a
> function with an array as an argument, and feel free to modify its
> contents!
Yep, all arguments are pass by value (... there's that consistency
shining through). When you pass an array, it passes a pointer to the
first element. For fun though, change mod_array's signature to:
void mod_array(const int *a);
or
void mod_array(const int a[]);
Cheers,
Matt
More information about the vox
mailing list