473,804 Members | 3,588 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
"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
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
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...
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...
1
7616
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
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.
3
2990
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.