473,804 Members | 3,138 Online
Bytes | Software Development & Data Engineering Community
+ 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 8550

"Charles Richmond" <ri******@comca st.netwrote in message
news:45******** *******@comcast .net...
Keith Thompson wrote:
>>
Charles Richmond <ri******@comca st.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...wer e 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
1825
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. Consider, void f(int x, int& i); int i, j; f(1, i);
1
5841
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 or OpenRowSet. I've tried variations on: select * from OpenDataSource( 'Advantage OLE DB Provider',
58
30258
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 neighborhood C# programmer? The standard answer I get from computer sales people is: "It means that the CPU can process 64 bits of data at a time instead of 32." Ok... I guess I *kind* of understand what that means at an intuitive level, but what...
2
1561
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. and so much on the internet, why can't we just stick with Windows Forms? P.S. The main reason I love C# so much is because it is so good for programming, and so, why do we keep on going on and fussing about other applications?
2
6967
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, GetEnumerator, and RemoveAt) but the way it implements all the other things you need to override seems overkill and counters the advantage of having an extensible base class. For example, the documentation example implementation of Remove: Public...
3
16336
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> struct Shoe { ~Shoe() { std::cout << "Buckle my shoe\n"; } };
3
2218
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 : std::unary_function<A*, bool> { public:
37
5123
by: deepu | last post by:
Please reply...
22
1435
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 advantage of C' (is it your question also). lovecreatesbeauty
13
4419
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 the same.
0
9706
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9579
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10575
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10330
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10319
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9144
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5520
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4297
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3816
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.