473,466 Members | 1,451 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 8472

"Charles Richmond" <ri******@comcast.netwrote in message
news:45***************@comcast.net...
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*
implementation,
*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
pointers.)

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.
--
www.personal.leeds.ac.uk/~bgy1mm
freeware games to download.

Oct 12 '06 #51

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Siemel Naran | last post by:
Hi. I have found one advantage of returning values through the argument list. It's that we have to store the return value. But when we return by value, we may forgot to store the return value. ...
1
by: David Horowitz | last post by:
Hi folks. I'm trying to connect to a Medisoft Advantage SQL db through SQL Server using OpenDataSource or OpenRowSet. I have general connections to the db working fine, but not with OpenDataSource...
58
by: Larry David | last post by:
Ok, first of all, let's get the obvious stuff out of the way. I'm an idiot. So please indulge me for a moment. Consider it an act of "community service".... What does "64bit" mean to your friendly...
2
by: Visually Seen # | last post by:
Hey everybody! I just want to discuss: what do people really use C# for? According to Microsoft, it was made for rapid software devolopment, and now everybody is on about XML, chat groups etc....
2
by: Samuel R. Neff | last post by:
What's the advantage of inheriting from CollectionBase as opposed to just implementing IList? It seems that it saves you from having to implement a few properties (Clear, CopyTo, Count,...
3
by: yinglcs | last post by:
I am reading the Boost scoped_ptr library, and I wonder what is the advantage of using that. Here is an example from Boost.org web site: #include <boost/scoped_ptr.hpp> #include <iostream> ...
3
by: Allerdyce.John | last post by:
I would like to know what is the advantage of inherit from unary_function template? For example, I have this in my code: What is the advantage of doing this: class Same :...
37
by: deepu | last post by:
Please reply...
22
by: lovecreatesbeauty | last post by:
After read a whole OS written by C (e.g. UNIX 6th Edition written by), at the end (yes, at the last line of the text of the last chapter), someone (sure, it's John Lions) asks `What is the...
13
by: Sarath | last post by:
What's the advantage of using for_each than the normal iteration using for loop? Is there any 'tweak' to use stream objects as 'Function' parameter of for_each loop. Seems copy function can do...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

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.