Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > As a programmer of both languages...

Reply
Thread Tools

As a programmer of both languages...

 
 
Toms hilidhe
Guest
Posts: n/a
 
      12-11-2007

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.

--
Toms hilidhe
 
Reply With Quote
 
 
 
 
Richard Heathfield
Guest
Posts: n/a
 
      12-11-2007
Toms hilidhe 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
 
Reply With Quote
 
 
 
 
Martin Ambuhl
Guest
Posts: n/a
 
      12-11-2007
"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]
 
Reply With Quote
 
jacob navia
Guest
Posts: n/a
 
      12-11-2007
Toms hilidhe 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
 
Reply With Quote
 
jacob navia
Guest
Posts: n/a
 
      12-11-2007
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
 
Reply With Quote
 
Ian Collins
Guest
Posts: n/a
 
      12-11-2007
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.
 
Reply With Quote
 
Martin Ambuhl
Guest
Posts: n/a
 
      12-11-2007
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).

 
Reply With Quote
 
jacob navia
Guest
Posts: n/a
 
      12-11-2007
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
 
Reply With Quote
 
user923005
Guest
Posts: n/a
 
      12-11-2007
On Dec 11, 10:31 am, "Toms hilidhe" <(E-Mail Removed)> 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.
>
> 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.


Is it better to eat with a fork or a spoon?
When I am eating green beans, I use a fork, but when I am eating peas,
I use a spoon. Which is to say that they have slightly different
purposes, even though both are used for eating. You can eat green
beans with a spoon or peas with a fork, but it does not work out as
well that way.
C++ is a fork but C is a spoon. Which is to say, they have slightly
different purposes, even though both are used for programming.
If I am writing simple procedural filters, I will use C.
If I am writing a complex system that needs inheritance and templates,
then I will use C++.
C++ does not remove the need for C and C cannot accomplish all the
things that C++ can accomplish as easily.
They are not competitors, except for the overlapping set where the
needed functionality is easily derived from either language.
Do we really need a C++ compiler with templates to write a state
machine for a toaster IC?
Do we really want to code a 10 million line project in C?
C++ hides complexity, which is nice if you have an extremely complex
project. But that's not always the case.
It is pointless to debate if C is better than C++ or if C++ is better
than C because both of them are good for what they are best at.
You don't throw out the jigsaw because you bought a circular saw. I
am not going to use a jigsaw to rip a 10 foot panel, and I am not
going to use a circular saw to cut out a light socket opening.
So choose your tools wisely, and don't toss them out unless you are
sure that you don't need them.

IMO-YMMV.
 
Reply With Quote
 
Julienne Walker
Guest
Posts: n/a
 
      12-11-2007
On Dec 11, 2:24 pm, jacob navia <(E-Mail Removed)> wrote:
> Toms hilidhe 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Urgent positions: Sr Programmer Analyst (SPA) and Programmer Analyst(PRA)-06+month's- Carson City, NV. Isaac Java 0 12-08-2010 05:34 PM
Who gets higher salary a Java Programmer or a C++ Programmer? Sanny Java 391 01-06-2010 02:48 AM
Who gets higher salary a Java Programmer or a C++ Programmer? Sanny C++ 396 12-17-2008 06:13 PM
compilation error: file exists in both in both 'c:\WINNT\Microsoft.NET\Framework\v2.0.50727 ABCL ASP .Net 0 05-29-2008 04:59 PM
2 computers, both online, both invisible to each other ? b Computer Support 9 04-21-2006 04:06 AM



Advertisments