473,899 Members | 3,071 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 8569
"CBFalconer " <cb********@yah oo.comwrote in message
Malcolm wrote:
>"lovecreatesbe a...@gmail.com" <lo************ ***@gmail.comwr ote:
>>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?

The most important advantage is that a C compiler exists for almost
every platform in existence. There is also a huge body of code.
It is about the "cleanest" of all the high level so-called
second-generation languages. It has enough syntax to make programs
readable, but no more.

Actually it is neither as clean nor as portable as Pascal. However
it is significantly more flexible, and as you said, compilers exist
for practically every system.

I would much rather create, from scratch, a Pascal system than a C
system. Today this is not necessary, because of basically portable
compilers such as gcc. As a very rough measure of compiler
complexity needed, compare the size of the Pascal standard with
that of the C standard. And don't even mention C++.
Pascal decided to pretend that the machine doesn't work in binary.
It is very easy to build a Turing tarpit. For instnace, if you go to my
website you can download a little program called "cellular automaton". In
theory, and given the limits of its screen, it can compute any computable
function.
Some day I will get round to writing a little routine for it to add two
numbers together. In practise, that is about the limit that you will be able
to achieve with it.
--
www.personal.leeds.ac.uk/~bgy1mm
freeware games to download.

Oct 8 '06 #11

"CBFalconer " <cb********@yah oo.comwrote in message
news:45******** *******@yahoo.c om...
Richard Heathfield wrote:
>lovecreatesbea ...@gmail.com said:
>>Could you extract examples of the characteristics of C itself to
demonstrate what the advantages of C are?

C has the same advantage as strawberry ripple ice cream. It exists.

Some people prefer other flavours. Some people like several different
flavours. Some people even like to mix their flavours together.

The most important thing about C is its Cness. For people who like it,
it's exactly the right taste, with just that tang, and just that zest.

Before C became standardized and included prototypes, I couldn't
stand it at all. The original K&R flavor was much too error prone.
C has always been the least bad programming language.
There probably is a way to tell a computer what to do, simply, clearly and
without any real possibility of error, but we haven't found it. Experiments
are interesting, but have tended to make the problems worse.
--
www.personal.leeds.ac.uk/~bgy1mm
freeware games to download.
Oct 8 '06 #12

"CBFalconer " <cb********@yah oo.comwrote in message
news:45******** *******@yahoo.c om...
Actually it is neither as clean nor as portable as Pascal. However
it is significantly more flexible, and as you said, compilers exist
for practically every system.

I would much rather create, from scratch, a Pascal system than a C
system. Today this is not necessary, because of basically portable
compilers such as gcc. As a very rough measure of compiler
complexity needed, compare the size of the Pascal standard with
that of the C standard. And don't even mention C++.
I learned Pascal years ago and have followed the Wirth languages Modula-2
Oberon - very interesting - i like Wirth's minimalist philosophy but he is
developing in isolation - the only trouble is that any operating systems
that matters are written in C (or C++).
Oct 8 '06 #13
Paul Connolly wrote:
"CBFalconer " <cb********@yah oo.comwrote in message
>Actually it is neither as clean nor as portable as Pascal. However
it is significantly more flexible, and as you said, compilers exist
for practically every system.

I would much rather create, from scratch, a Pascal system than a C
system. Today this is not necessary, because of basically portable
compilers such as gcc. As a very rough measure of compiler
complexity needed, compare the size of the Pascal standard with
that of the C standard. And don't even mention C++.

I learned Pascal years ago and have followed the Wirth languages
Modula-2 Oberon - very interesting - i like Wirth's minimalist
philosophy but he is developing in isolation - the only trouble is
that any operating systems that matters are written in C (or C++).
I think Wirth went wrong in eliminating i/o from the language when
advancing to Modula from Pascal. The change did add a measure of
flexibility, but made programming much less natural. The
advantages of the pseudo-variadic write/read in Pascal are many.
It produces the flexibility of variadic functions without the
insecurities. In some ways the stream i/o of C++ is a return to
that, but with much less clarity. In this respect Modula and C are
very similar.

--
"The mere formulation of a problem is far more often essential
than its solution, which may be merely a matter of mathematical
or experimental skill. To raise new questions, new possibilities,
to regard old problems from a new angle requires creative
imagination and and marks real advances in science."
-- Albert Einstein
Oct 9 '06 #14
CBFalconer said:
Richard Heathfield wrote:
>lovecreatesbea ...@gmail.com said:
>>Could you extract examples of the characteristics of C itself to
demonstrate what the advantages of C are?

C has the same advantage as strawberry ripple ice cream. It exists.

Some people prefer other flavours. Some people like several different
flavours. Some people even like to mix their flavours together.

The most important thing about C is its Cness. For people who like it,
it's exactly the right taste, with just that tang, and just that zest.

Before C became standardized and included prototypes, I couldn't
stand it at all. The original K&R flavor was much too error prone.
I have but rarely tasted that language, and I don't like the taste at all.
But there will be some who liked that flavour, and are sorry to see it go.
And, even without liking it, I too am sorry to see it go, for our diversity
is diminished by its passing.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
Oct 9 '06 #15

David Wade wrote:
"Serve Laurijssen" <se*@n.tkwrot e in message
news:eg******** **@news5.zwoll1 .ov.home.nl...
C will get you women.
Might be a disadvantage if you are in fact a woman and not lesbian but it
is
the general consensus that C gets you lots of women
May also be a problem if in fact you are a gay male and don't want a women
either....
Are you saying this is implementation dependent?

Oct 9 '06 #16
CBFalconer <cb********@yah oo.comwrites:
[...]
I think Wirth went wrong in eliminating i/o from the language when
advancing to Modula from Pascal. The change did add a measure of
flexibility, but made programming much less natural. The
advantages of the pseudo-variadic write/read in Pascal are many.
It produces the flexibility of variadic functions without the
insecurities. In some ways the stream i/o of C++ is a return to
that, but with much less clarity. In this respect Modula and C are
very similar.
The ideal solution, I think, is to design a language so the I/O
statements have the same ease of use as Pascal, *but* are defined as
ordinary library routines without using any special-case language
features.

C does this with printf(), but only by giving up type checking.
(Other languages do various other off-topic things.)

--
Keith Thompson (The_Other_Keit h) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Oct 9 '06 #17

"lovecreatesbea ...@gmail.com" <lo************ ***@gmail.comwr ote in message
news:11******** *************@i 42g2000cwa.goog legroups.com...
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 ?
This is a history lesson from my personal experiences. Despite it being a
bit long, I hope you take the time to read it.

I've programmed in a number of languages: C, PL/1, 6502 assembly, x86
assembly, FORTH, Pascal, Fortan, BASIC, etc.(fourteen total). I haven't
experienced newer languages like C++, PHP, Java, etc., or object oriented
ones: C++, Smalltalk. Given that, two of the things I value most in a
language are: 1) ease of programming and 2) pointers (which correspond to
addresses in assembly). Most of the languages I've experienced, fail both
of those. The exceptions are: C, PL/1 (or PL/I), FORTH and, perhaps, Pascal
(today).

PL/1, a precursor to Pascal, was basically Pascal (with pointers, like C),
and record structures that were supposedly based on COBOL. One big
difference was that variables were passed by reference. This _greatly_
eased programming. In hundreds of thousands of lines of code I wrote, there
were only two situations where I had to tell the compiler to pass by value.
Unlike C, one (basically) never had to be concerned about whether you were
passing in a value or an pointer to a function or procedure... Strings were
a fundamental type, but due to the way they were implemented for the machine
I programmed, I still viewed them as problematic.

FORTH is syntax free and not usually taught in academic settings. The
biggest problems are that 1) you have to think in terms of objects on the
stack like assembly, 2) you have to learn RPN, 3) the default words are
somewhat cryptic if you don't know assembly, and 4) you can't usually
generate compiled code. The last one is a big disadvantage. It's
interpreted like BASIC, so development is quick. That is an advantage.

Assembly can be trying, because there usually isn't an easy method to create
named variables or larger data types likes structures. In assembly,
everything is referenced by register name or memory address. So, where is
my loop counter? Did I put it in eax, esi, memory, zero page (6502
reference...).. . Did it get relocated or saved by the linked C code?

FORTRAN, as I experienced it, which was a few decades ago, was a complete
****ing nightmare. The only thing good about it was that numerical results
were accurate... Otherwise, I can't say anything good about it at all.
Hopefully, Fortran has been heavily modified since then.

Pascal, when I learned it, had limited pointer functionality. It was an
example of safe programming practices like Java. For the most part, the
language was easy to learn but didn't seem powerful (which I attribute to
the lack of actual pointers and inability to access the OS). Apparently, a
more complete type of pointer was added in the early '90's with a new
standard.

BASIC had the easiest method of string manipulation. This is the thing I
remember the most about BASIC. It was so easy, that I usually create the
MID$,LEFT$,RIGH T$, and a concatenation function when I'm programming in
languages other than C. C has less easy to use duplicate funtionality. The
other thing I remember is how much quicker it was to test and develop
programs. Compiling and running C over, and over again, is much slower.

As for C, it isn't as easy as Pascal, it can't do strings as easy as BASIC,
it is slower to develop in than BASIC or FORTH, it can't pass data as easy
as PL/1, but it captures the abilities of most early CPU's and modern RISC
CPU's. It's real strength is the closeness of it's featureset to assembly
language, named variables, and pointers. It's not that it's standardized or
somewhat portable or whatever excuse the others here want to promote.
And what are its disadvantages?
In addition to what I mentioned above,

1) There is no way to determine from a pointer in C what data it is pointing
to. You can point it to one variable and then reuse it to point into the
middle of another. This can cause programming errors and prevents
optimizations by the C compiler. (Yes, unfortunately, one of my preferred
language features is a hindrance to compiler advancement.)

2) C is frequently implemented using a single stack. This means that flow
control information (if, while, procedures, etc.) is stored on the same
stack as data. This allows for various stack overflow/underflow exploits or
programmer error.

etc...
Rod Pemberton
Oct 9 '06 #18
Richard Heathfield wrote:
>
CBFalconer said:
Richard Heathfield wrote:
lovecreatesbea. ..@gmail.com said:

Could you extract examples of the characteristics of C itself to
demonstrate what the advantages of C are?

C has the same advantage as strawberry ripple ice cream. It exists.

Some people prefer other flavours. Some people like several different
flavours. Some people even like to mix their flavours together.

The most important thing about C is its Cness. For people who like it,
it's exactly the right taste, with just that tang, and just that zest.
Before C became standardized and included prototypes, I couldn't
stand it at all. The original K&R flavor was much too error prone.

I have but rarely tasted that language, and I don't like the taste at all.
But there will be some who liked that flavour, and are sorry to see it go.
And, even without liking it, I too am sorry to see it go, for our diversity
is diminished by its passing.
Amen! <IMHOC is supposed to be a sharp and incisive tool. One
must be careful in using C lest one wound oneself badly. This
will foster care and thoughtfulness in those who use it...others
can get only pain from it. </IMHO>

--
+----------------------------------------------------------------+
| Charles and Francis Richmond richmond at plano dot net |
+----------------------------------------------------------------+
Oct 9 '06 #19
CBFalconer wrote:
>
Malcolm wrote:
"lovecreatesbea ...@gmail.com" <lo************ ***@gmail.comwr ote:
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?
The most important advantage is that a C compiler exists for almost
every platform in existence. There is also a huge body of code.
It is about the "cleanest" of all the high level so-called
second-generation languages. It has enough syntax to make programs
readable, but no more.

Actually it is neither as clean nor as portable as Pascal. However
it is significantly more flexible, and as you said, compilers exist
for practically every system.
The flexibility of C is preciesly what makes it dangerous. Pascal will
protect you in many ways, but C says "If you want to shoot yourself
in the foot, here, let me load the gun for you." Thus you must be
careful and do more thinking about what you are doing in C.
I would much rather create, from scratch, a Pascal system than a C
system. Today this is not necessary, because of basically portable
compilers such as gcc.
The Pascal compilers I have seen the source for (PASCAL4 and PASCALS)
are recursive decent parsers, which is a straghtforward and clear
way to parse. ISTM that C can be implemented with recursive decent,
with some fix-ups...but most C compilers use stronger parsing methods.
As a very rough measure of compiler
complexity needed, compare the size of the Pascal standard with
that of the C standard.
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.
And don't even mention C++.
IMHO C++ is *not* a language, it is an abomination. I have heard it
said that C is a sailboat and C++ is the Queen Mary. C++ is object
oriented, but it forces the programmer to create all the underpinnings
that support things. Compare C++ to any other object oriented
language and you will see what I mean.
--
+----------------------------------------------------------------+
| Charles and Francis Richmond richmond at plano dot net |
+----------------------------------------------------------------+
Oct 9 '06 #20

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

Similar topics

4
1828
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
5842
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
30281
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
1563
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
6972
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
16341
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
2225
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
5133
by: deepu | last post by:
Please reply...
22
1439
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
4428
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
9997
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
9843
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,...
1
10971
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,...
1
8039
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7201
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5887
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...
0
6081
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4720
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
4300
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.