Re: As a programmer of both languages...
- From: jacob navia <jacob@xxxxxxxxxx>
- Date: Tue, 11 Dec 2007 20:24:27 +0100
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
.
- Follow-Ups:
- Re: As a programmer of both languages...
- From: CBFalconer
- Re: As a programmer of both languages...
- From: Julienne Walker
- Re: As a programmer of both languages...
- From: Ian Collins
- Re: As a programmer of both languages...
- References:
- As a programmer of both languages...
- From: Tomás Ó hÉilidhe
- As a programmer of both languages...
- Prev by Date: Re: Need help with this program
- Next by Date: Re: As a programmer of both languages...
- Previous by thread: Re: As a programmer of both languages...
- Next by thread: Re: As a programmer of both languages...
- Index(es):
Relevant Pages
|