473,608 Members | 2,287 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

As a programmer of both languages...


There seems to be constant vacuous debate about which is better or
preferable, C or C++, and it looks like one of these discussions is on-
going right now in this newsgroup.

I'm a programmer who started out in C++, and who's currently doing
an embedded systems project in C. The relationship and comparison
between the two languages is very simple in my opinion.

The objective of C++ was to build upon C; to take everything that C
can do, and then add a few more features, such as classes, operator
overloading, and exceptions.

Overlooking the small differences between the common subset of the
two languages (e.g. converting from void*, the type of character
literals), it's quite accurate to say that C++ is C with some more added
features.

So at the most basic, you can say that C++ is better than C in that
it can do everything C can does, and that it has a few more extra
features. That's great and all, but the price to pay for these extra
features is the increased complexity of the compiler. I'm currently
writing a program for the PIC 16F684 microcontroller (which is less than
the size of a postage stamp), and there wouldn't be a snowball's chance
in hell of me finding a C++ compiler for it. Why? Because nobody's
bothered writing one. I mean *have* *you* *seen* the size of the C++
Standard? :-O Not only that, but when programming for embedded systems,
the nature of the programs doesn't tend to give rise to a desire for
object-orientated programming. The current program I'm writing is a
Connect4 game, and there hasn't be one instance yet in which I've
yearned for object orientation (even though I use classes extensively
when writing PC applications).

So my own point of view is that while C++ is the programming
language to be used today for PC's, game consoles and the like, C is
still the king when it comes to embedded systems, and that doesn't seem
like changing any time soon. And for the less-than-proficient among us,
there's Java for PC's, and Basic for micrcontrollers .

--
Tomás Ó hÉilidhe
Dec 11 '07 #1
36 1855
Tomás Ó hÉilidhe said:
>
There seems to be constant vacuous debate about which is better or
preferable, C or C++, and it looks like one of these discussions is on-
going right now in this newsgroup.
It is indeed a vacuous debate. Some problems fit better in C than in C++
and vice versa, and some programmers are better at C than at C++ and vice
versa. One's language choice depends partly on the program and partly on
the programmer.

<snip>

--
Richard Heathfield <http://www.cpax.org.uk >
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
Dec 11 '07 #2
"Tomï¿½ï¿½ï¿½ï¿ ½ï¿½ï¿½ï¿½ï¿½ï¿ ½ï¿½ï¿½ï¿½ï¿½ï¿ ½ï¿½ï¿½ï¿½ï¿½ï¿ ½ï¿½ï¿½ï¿½ï¿½ï¿ ½ï¿½ï¿½ï¿½ï¿½ï¿ ½ï¿½ï¿½ï¿½" wrote:
There seems to be constant vacuous debate about which is better or
preferable, C or C++, and it looks like one of these discussions is on-
going right now in this newsgroup.
Not really, except for a few idiots like you who try to restart such
stupid "debate". Go away.

[vapid language-war fodder snipped]
Dec 11 '07 #3
Tomás Ó hÉilidhe wrote:
There seems to be constant vacuous debate about which is better or
preferable, C or C++, and it looks like one of these discussions is on-
going right now in this newsgroup.
No, it has never been a discussion about C or C++, since most people
here will agree that C is the better choice

What we are discussing is whether we should incorporate into C some
modifications like operator overloading and try/catch into the core C
language.

I have developed a C compiler that implements those enhancements in a
way that is compatible with the C standard. This offends many people
here that say that C "doesn't need" those things and even if it
disappears, it is better to leave it like it is now.
I'm a programmer who started out in C++, and who's currently doing
an embedded systems project in C. The relationship and comparison
between the two languages is very simple in my opinion.

The objective of C++ was to build upon C; to take everything that C
can do, and then add a few more features, such as classes, operator
overloading, and exceptions.
The difference between C and C++ is the object orientation of C++. C is
not object oriented.
Overlooking the small differences between the common subset of the
two languages (e.g. converting from void*, the type of character
literals), it's quite accurate to say that C++ is C with some more added
features.
Too many added features pecisely. What I am proposing is not taking all
of that but just two, to make C an easier language to use.
So at the most basic, you can say that C++ is better than C in that
it can do everything C can does, and that it has a few more extra
features. That's great and all, but the price to pay for these extra
features is the increased complexity of the compiler. I'm currently
writing a program for the PIC 16F684 microcontroller (which is less than
the size of a postage stamp), and there wouldn't be a snowball's chance
in hell of me finding a C++ compiler for it. Why? Because nobody's
bothered writing one. I mean *have* *you* *seen* the size of the C++
Standard? :-O Not only that, but when programming for embedded systems,
the nature of the programs doesn't tend to give rise to a desire for
object-orientated programming. The current program I'm writing is a
Connect4 game, and there hasn't be one instance yet in which I've
yearned for object orientation (even though I use classes extensively
when writing PC applications).
A simple language is needed, not ONLY for the PIC 16F684. A simple
language is needed because it is easier to use!

Now, it can't be TOO simple, because that makes it HARDER to use than
necessary.
So my own point of view is that while C++ is the programming
language to be used today for PC's, game consoles and the like, C is
still the king when it comes to embedded systems, and that doesn't seem
like changing any time soon. And for the less-than-proficient among us,
there's Java for PC's, and Basic for micrcontrollers .
No. C is a general purpose programming language. With a few enhancements and
a better library it can become a great programming language for
many tasks.
--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32
Dec 11 '07 #4
Martin Ambuhl wrote:
"Tomï¿½ï¿½ï¿½ï¿ ½ï¿½ï¿½ï¿½ï¿½ï¿ ½ï¿½ï¿½ï¿½ï¿½ï¿ ½ï¿½ï¿½ï¿½ï¿½ï¿ ½ï¿½ï¿½ï¿½ï¿½ï¿ ½ï¿½ï¿½ï¿½ï¿½ï¿ ½ï¿½ï¿½ï¿½" wrote:
> There seems to be constant vacuous debate about which is better or
preferable, C or C++, and it looks like one of these discussions is on-
going right now in this newsgroup.

Not really, except for a few idiots like you who try to restart such
stupid "debate". Go away.

[vapid language-war fodder snipped]
Please do not take this ... well... person, as representing anyone but
himself.
--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32
Dec 11 '07 #5
jacob navia wrote:
>
The difference between C and C++ is the object orientation of C++. C is
not object oriented.
Are you really dense, or just being obtuse? As you have been told many
times before, C++ is a multi paradigm language. You can *choose* to
write OO or procedural code in C++.

--
Ian Collins.
Dec 11 '07 #6
jacob navia wrote:
Martin Ambuhl wrote:
>"Tomï¿½ï¿½ï¿½ï ¿½ï¿½ï¿½ï¿½ï¿½ï ¿½ï¿½ï¿½ï¿½ï¿½ï ¿½ï¿½ï¿½ï¿½ï¿½ï ¿½ï¿½ï¿½ï¿½ï¿½ï ¿½ï¿½ï¿½ï¿½ï¿½ï ¿½ï¿½ï¿½ï¿½" wrote:
>> There seems to be constant vacuous debate about which is better
or preferable, C or C++, and it looks like one of these discussions
is on-
going right now in this newsgroup.

Not really, except for a few idiots like you who try to restart such
stupid "debate". Go away.

[vapid language-war fodder snipped]

Please do not take this ... well... person, as representing anyone but
himself.
Yes, I had forgotten about Jacob Navia, a troll who comes here to flog
his commercial software (available with a free license if you never use
it for anything useful).

Dec 11 '07 #7
Ian Collins wrote:
jacob navia wrote:
>The difference between C and C++ is the object orientation of C++. C is
not object oriented.
Are you really dense, or just being obtuse? As you have been told many
times before, C++ is a multi paradigm language. You can *choose* to
write OO or procedural code in C++.
Yes, and you can choose to write in C using a C++ compiler and
framework. Does that mean that C++ is C???

C++ was defined during the 90ties as THE object oriented language.
Now, that the hype as gone and people start realizing that this wasn't
the silver bullet after all, C++ will be sold as a "multi paradigm"
language.

But the basic machinery: constructors/destructors/classes/methods
is still there. I do not understand why this fads must be followed:
it was conceived as an OO language and it was marketed as an OO language
for around 10 years.

Now they start marketing it as "Multi paradigm". this is handy yes,
but the facts are stubborn.

You can't program in C++ without using classes. Even if you define
a simple structure it is actually a class.

Of course you can write a hello world program without them but explain
me how do you ignore classes in C++?

I think it would be quite hard.

Multi paradigm?

Maybe, who knows what buzzword will be invented in the future, but
the fact is that without classes you just can't do anything at all in
C++.

Or... I am just "dense" and fail to grasp the obvious :-)
--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32
Dec 11 '07 #8
On Dec 11, 2:24 pm, jacob navia <ja...@nospam.c omwrote:
Tomás Ó hÉilidhe wrote:
There seems to be constant vacuous debate about which is better or
preferable, C or C++, and it looks like one of these discussions is on-
going right now in this newsgroup.

No, it has never been a discussion about C or C++, since most people
here will agree that C is the better choice
The better choice for what? I'd like to believe that most people here
are enlightened enough to realize that personal preference alone
doesn't make a language suitable for a project.
What we are discussing is whether we should incorporate into C some
modifications like operator overloading and try/catch into the core C
language.
To be honest, I haven't seen many people advocating those additions.
However, I *have* seen countless people argue endlessly about whether
C is better than C++ or vice versa. I'd much rather see discussions
about how to improve the languages (preferably located in the correct
newsgroup) than truly petty holy wars about which one is better.
I have developed a C compiler that implements those enhancements in a
way that is compatible with the C standard. This offends many people
here that say that C "doesn't need" those things and even if it
disappears, it is better to leave it like it is now.
I don't think anybody has a problem with extensions. It seems to me
that the problem is discussion of extensions or improvements in a
newsgroup that's devoted to the standard language. Discussion of
extensions should be relocated to the newsgroup for the compiler in
which they're implemented, and improvements should be relocated to a
newsgroup that's devoted to the language standard (comp.std.c). In the
correct newsgroup those discussions can do more good.
The objective of C++ was to build upon C; to take everything that C
can do, and then add a few more features, such as classes, operator
overloading, and exceptions.

The difference between C and C++ is the object orientation of C++. C is
not object oriented.
Templates are something of a big difference as well. ;-)
Overlooking the small differences between the common subset of the
two languages (e.g. converting from void*, the type of character
literals), it's quite accurate to say that C++ is C with some more added
features.

Too many added features pecisely. What I am proposing is not taking all
of that but just two, to make C an easier language to use.
I'm not convinced that operator overloading is such a desirable
feature that it would be one of the two that you would borrow from C+
+. Exception handling is tricky to the point where I don't see much of
it even in C++; I doubt how well it would be received in C.
So my own point of view is that while C++ is the programming
language to be used today for PC's, game consoles and the like, C is
still the king when it comes to embedded systems, and that doesn't seem
like changing any time soon. And for the less-than-proficient among us,
there's Java for PC's, and Basic for micrcontrollers .

No. C is a general purpose programming language. With a few enhancements and
a better library it can become a great programming language for
many tasks.
I'm not sure about enhancements to the language, but some work on the
library would be nice.
-Jul
Dec 11 '07 #9
"Tomás Ó hÉilidhe" <to*@lavabit.co mwrites:
There seems to be constant vacuous debate about which is better or
preferable, C or C++, and it looks like one of these discussions is on-
going right now in this newsgroup.
[snip]

Yes. Why must you start yet another one?

--
Keith Thompson (The_Other_Keit h) <ks***@mib.or g>
Looking for software development work in the San Diego area.
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Dec 11 '07 #10

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

Similar topics

1
2438
by: Angie | last post by:
Hello, My name is Angela Mastrodonato. I'm a web designer who would like the assistance of a php programmer. Some of my clients have requested more dynamic web sites, and I am in the beginning phases of learning php. When it comes to common services, such as shopping carts, I have found ways to modify existing scripts. However, I have been getting requests for services that seem specific, and require a more customized approach than...
7
2061
by: stormslayer | last post by:
Folks: I've been considering a shift to python. I currently use c++builder (borland) or perl. I do computational models / statistics programming, and was interested in python b/c it a. has a library that connects to the R stats package b. has code that seems way more readable than anything else There is, however, at least for my work, a hard constraint. Execution
10
1418
by: PMD96 | last post by:
I'm new to programming and have been recommended to start with Python. I've reviewed the tutorial and am looking for additional learning tools to learn programming and Python. Any recommendations?
72
5808
by: E. Robert Tisdale | last post by:
What makes a good C/C++ programmer? Would you be surprised if I told you that it has almost nothing to do with your knowledge of C or C++? There isn't much difference in productivity, for example, between a C/C++ programmers with a few weeks of experience and a C/C++ programmer with years of experience. You don't really need to understand the subtle details or use the obscure features of either language
3
1573
by: OJLP | last post by:
Hi. I am about to embark on C# learning. I have had limited VB experience. Can anyone offer any advice as to some good books / courses to attend, for a newbie to get the basics as quick as possible? I have seen a lot of books out there, but a lot of feedback that they are aimed at more than newbies? ANy advice anyone? Rgds OJLP
31
1525
by: amruta | last post by:
hi, i m new in programming.at present i m learning computer languages. i just want to know how u can develop a skills of any language, how u can be master in any languages. can any one help me.
13
2028
by: aum | last post by:
Hi, I'm a Python programmer, just starting to get into javascript. On reading some of the js guides, and not liking any of the OO usage patterns I saw, I've cooked up something which python folks might find to taste. Here's the code - first the 'engine', then some code demonstrating the usage patterns. For me (and maybe for some of you), it promotes readability and some
13
2484
by: BK | last post by:
Our .Net team has just inherited a junior programmer that we need to get up to speed as quickly as possible. Unfortunately, his skill set is largely Access with some VB6 and ASP classic experience. We employ some parts of XP such as pair programming, and this should help. Other than books, does anyone have any suggestions? His skill set is pretty antiquated and we need to get him up to speed as quickly as possible so any suggestions...
65
5243
by: Chris Carlen | last post by:
Hi: From what I've read of OOP, I don't get it. I have also found some articles profoundly critical of OOP. I tend to relate to these articles. However, those articles were no more objective than the descriptions of OOP I've read in making a case. Ie., what objective data/studies/research indicates that a particular problem can be solved more quickly by the programmer, or that the solution is more efficient in execution time/memory...
0
8496
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...
1
8148
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
8338
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6816
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
6013
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
3962
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
4024
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2474
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
1
1594
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.