471,092 Members | 1,100 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,092 software developers and data experts.

What is the advantage of C?

Could you extract examples of the characteristics of C itself to
demonstrate what the advantages of C are? What are its pleasant,
expressive and versatile characteristics?

And what are its disadvantages?

Oct 8 '06
50 8116

"Charles Richmond" <ri******@comcast.netwrote in message
Keith Thompson wrote:
Charles Richmond <ri******@comcast.netwrites:
ISTM that the C standard could be shorted by 80% if all the special
cases were eliminated. These cases were introduced to allow some
odd-ball implementations to squeak in under the standards fence.
For instance, just say "NULL is always 0". If you can *not* implement
NULL this way, go home and think about how to fix *your*
*not* change the standard.

I don't see how specifying the representation of a null pointer would
shorten the standard significantly.

What *would* shorten the standard would be to drastically simplify the
concept of null pointer constants. Drop the stuff about special-case
conversion of an integer constant expression with value 0. Add a new
keyword, say "nil" or "null", and make it the *only* valid null
pointer constant. Don't bother specifying how null pointers are
represented. (This is basically what Pascal and Ada do. Programmers
in those languages don't care how null pointers are represented, only
that they compare equal to null pointers and unequal to non-null

This wouldn't shorten the standard by a whole lot, but it would
certainly shorten section 5 of the comp.lang.c FAQ.

Of course it's not possible to do this without breaking existing code,
so it will never happen.
The NULL pointer and exceptions associated therewith...were only an
example. My point is that the C standard is replete with exceptions
to allow strange systems to be standard. ISTM that this comprises
the bulk of the current C standard. I say simplify the standard and
let the strange, non-conforming implementations change to match it.
Old code that is broken...will be broken. It can work under K&R or
something. New code shoule match the standard.
If you've got a strange system it is normally strange for a reason, not
because some evil engineer decided to mess ANSI up.
That reason is highly likely to be performance requirements. If null
pointers can't be all zero, likely either the hardware is very cheap and
needs zero as one of its 256 bytes of writeable memory, or is very expensive
and has some wonderful synchronous address validation system. Either way,
specifying extra operations to make all-zero null is effectively saying that
standard C cannot run on the machine.
freeware games to download.

Oct 12 '06 #51

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by David Horowitz | last post: by
2 posts views Thread by Visually Seen # | last post: by
2 posts views Thread by Samuel R. Neff | last post: by
3 posts views Thread by yinglcs | last post: by
37 posts views Thread by deepu | last post: by
13 posts views Thread by Sarath | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.