Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old August 10th, 2006, 04:05 AM
Magcialking
Guest
 
Posts: n/a
Default C++ or C?

somebody told me that c++ is superior to c while others insist that c++
is just a junk.
I don't know which to follow.I want to know exactly the difference
between them, and their respective advantage and disadvantage.

  #2  
Old August 10th, 2006, 04:15 AM
Victor Bazarov
Guest
 
Posts: n/a
Default Re: C++ or C?

Magcialking wrote:
Quote:
somebody told me that c++ is superior to c while others insist that
c++ is just a junk.
I don't know which to follow.I want to know exactly the difference
between them, and their respective advantage and disadvantage.
www.google.com and read about the differences until you're blue in
the face.

Oh, while you're at it, look up "trolling", and try not to do it.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask


  #3  
Old August 10th, 2006, 04:15 AM
Phlip
Guest
 
Posts: n/a
Default Re: C++ or C?

Magcialking wrote:
Quote:
somebody told me that c++ is superior to c while others insist that c++
is just a junk.
C++ was invented later, and it's easier to program. That means many new
libraries, using it, are often fat and bloated.

However, C++ permits as many efficiencies as C. You should write clean C++
style code, and keep it not ugly and bloated. Then if it's slow, you can use
C-style code that's more efficient. So ideally you can get the best of both
worlds.

Now try comparing a C language to any other language. Tip: Don't go straight
to Java. Get a high-level language like Ruby or Smalltalk, and learn to
compare it to C++.

--
Phlip
http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!!!


  #4  
Old August 10th, 2006, 04:35 AM
uralmutlu@gmail.com
Guest
 
Posts: n/a
Default Re: C++ or C?


Magcialking wrote:
Quote:
somebody told me that c++ is superior to c while others insist that c++
is just a junk.
I don't know which to follow.I want to know exactly the difference
between them, and their respective advantage and disadvantage.
Try to compare an apple and a pear.

The inventor of C++ Bjarne Stroustrup has a few things to say on the
subject: http://www.research.att.com/~bs/bs_faq.html

  #5  
Old August 10th, 2006, 04:55 AM
Magcialking
Guest
 
Posts: n/a
Default Re: C++ or C?

I heard that nearly 95% programs in the GNU world are written with C,
and except in the game industry, C is much more widely used, is that
true?

  #6  
Old August 10th, 2006, 05:15 AM
Phlip
Guest
 
Posts: n/a
Default Re: C++ or C?

Magcialking wrote:
Quote:
I heard that nearly 95% programs in the GNU world are written with C,
and except in the game industry, C is much more widely used, is that
true?
C is much older, and is responsible for the majority of the programming
infrastructure we use. Items like Unix, grep, Apache, Perl, and Berkeley
Sockets were all written in C.

That's not because C is better; just because it's older. And C++ cannot yet
compete for some platforms that only have C compilers. The most useful
system things must port to such platforms, hence they must use C.

Modern development, for most platforms, that requires relatively high
performance and portability will use C++. So your cell phone might run C++,
and your videogame most likely will.

Curiously, many videogames use libraries like Renderware that are themselves
written in C. This disadvantages some students, who learn its style, and
then use that style inappropriately in their C++ code.

The question arises to what purpose you will put these answers. If you seek
which language to learn, learn a soft easy one like Ruby first, and then
learn C++. Only learn C as you need it.

If you want to pick a language to start a project, you should pick a soft
one like Python, Ruby, or Smalltalk. Use soft languages to program faster,
and only convert modules to C++ as you need.

Most videogames also use a soft layer, typically Lua, to program their
high-level logic without worrying about the nuts-and-bolts that raw C++
requires.

--
Phlip
http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!!!


  #7  
Old August 10th, 2006, 05:15 AM
noone
Guest
 
Posts: n/a
Default Re: C++ or C?

On Wed, 09 Aug 2006 21:03:22 -0700, Magcialking wrote:
Quote:
I heard that nearly 95% programs in the GNU world are written with C,
and except in the game industry, C is much more widely used, is that
true?
It is true that most widely used GNU tools are written in C and not in
C++. This is probably more for historical reasons than anything else.
Many of those projects were started before C++ became as popular and
finding C programmers to contribute is easier. To their credit many GNU
project managers won't rewrite in C++ until there is an overwhelming
reason to do so since the end result is more often a new C program that
simply uses some C++ constructs and achieves the worst of both worlds.

You gotta teach GNU developers to adequately document and professionally
engineer their code first. open-source project docs are generally
TERRIBLE!


  #8  
Old August 10th, 2006, 05:25 AM
Jerry Coffin
Guest
 
Posts: n/a
Default Re: C++ or C?

In article <3FxCg.5380$1f6.3485@newssvr27.news.prodigy.net> ,
phlipcpp@yahoo.com says...

[ ... ]
Quote:
However, C++ permits as many efficiencies as C.
More, AAMOF. Essentially all of the basic techniques of C are available
in C++, and C++ adds a few tricks of its own (especially via templates)
that are difficult to match in C.
Quote:
You should write clean C++
style code, and keep it not ugly and bloated. Then if it's slow, you can use
C-style code that's more efficient.
....or or many cases, well written C++ that's considerably better than
you could reasonably plan on producing with C.

Don't get me wrong: I'm not trying to bash C at all. Nonetheless, for
quite a few tasks, a C++ programmer can aspire to considerably more than
simply matching the efficiency of C, especially in terms of speed. If
your main concern is executable size, then C or extremly C-like coding
usually work extremely well. Given the current prices of memory and hard
drives, many people find larger executables quite reasonable if they run
enough faster -- which they often do.

--
Later,
Jerry.

The universe is a figment of its own imagination.
  #9  
Old August 10th, 2006, 05:25 AM
noone
Guest
 
Posts: n/a
Default Re: C++ or C?

On Wed, 09 Aug 2006 22:27:16 -0600, Jerry Coffin wrote:
Quote:
In article <3FxCg.5380$1f6.3485@newssvr27.news.prodigy.net> ,
phlipcpp@yahoo.com says...
>
[ ... ]
>
Quote:
>However, C++ permits as many efficiencies as C.
>
More, AAMOF. Essentially all of the basic techniques of C are available
in C++, and C++ adds a few tricks of its own (especially via templates)
that are difficult to match in C.
And of course something that folks don't know or try to forget is that C++
was originally called "C with classes" and C++ compilers were simply C
code preprocessors.


  #10  
Old August 10th, 2006, 05:35 AM
uralmutlu@gmail.com
Guest
 
Posts: n/a
Default Re: C++ or C?


Magcialking wrote:
Quote:
I heard that nearly 95% programs in the GNU world are written with C,
and except in the game industry, C is much more widely used, is that
true?
GNU mainly deals with OSs, drivers, compilers, etc and they are mainly
written in C.

You can't compare C to C++, a statement like "C is more widely used
than C++" doesn't make sense. Although, there is a relationship between
C and C++, they serve different purposes.

There are millions of application developers around the world and
application developers use c++, java, #c, etc. So even if there is more
C than C++ at the low level in our computers, I don't think anyone can
tell how widely C++ is used to build propriatery applications.

  #11  
Old August 10th, 2006, 06:05 AM
Ian Collins
Guest
 
Posts: n/a
Default Re: C++ or C?

Phlip wrote:
Quote:
>
Modern development, for most platforms, that requires relatively high
performance and portability will use C++. So your cell phone might run C++,
and your videogame most likely will.
>
Cell phones are more likely a mix of C and (unfortunately) Java these days.

--
Ian Collins.
  #12  
Old August 10th, 2006, 06:25 AM
uralmutlu@gmail.com
Guest
 
Posts: n/a
Default Re: C++ or C?


Ian Collins wrote:
Quote:
Phlip wrote:
Quote:

Modern development, for most platforms, that requires relatively high
performance and portability will use C++. So your cell phone might run C++,
and your videogame most likely will.
Cell phones are more likely a mix of C and (unfortunately) Java these days.
>
--
Ian Collins.
Symbian is C++ and some philips models have a linux based OS with Qt.
However, majority of cell phones probably use C, or shall we say the
code and applications running on them is developed in C.

  #13  
Old August 10th, 2006, 07:05 AM
Robert J. Hansen
Guest
 
Posts: n/a
Default Re: C++ or C?

somebody told me that c++ is superior to c while others insist that c++
Quote:
is just a junk.
I don't know which to follow.I want to know exactly the difference
between them, and their respective advantage and disadvantage.
Anyone who thinks C++ is superior to C, or vice-versa, is clearly so
ignorant that they should be dismissed out of hand. There is no such
thing as 'superiority' with respect to programming languages, only ways
in which they excel or fail to excel.

If you'd care to ask a more narrowly-focused question, people can
probably give you more useful answers.

  #14  
Old August 10th, 2006, 07:25 AM
Jerry Coffin
Guest
 
Posts: n/a
Default Re: C++ or C?

In article <pan.2006.08.10.04.31.50.723068@all.com>, noone@all.com
says...

[ ... ]
Quote:
And of course something that folks don't know or try to forget is that C++
was originally called "C with classes" and C++ compilers were simply C
code preprocessors.
At least as I understand things, C with Classes started out as a set of
macros, that were fed to a perfectly normal C compiler (along with your
source code, of course).

IMO, most people would be better off forgetting most of this
relationship when they're writing C++ code though -- IMO, one of the
most common sources of poorly written C++ is authors who think and write
too much like they're writing C with a few extra bells and whistles.

--
Later,
Jerry.

The universe is a figment of its own imagination.
  #15  
Old August 10th, 2006, 07:35 AM
Ian Collins
Guest
 
Posts: n/a
Default Re: C++ or C?

uralmutlu@gmail.com wrote:
Quote:
Ian Collins wrote:
>
Quote:
>>Phlip wrote:
>>
Quote:
>>>Modern development, for most platforms, that requires relatively high
>>>performance and portability will use C++. So your cell phone might run C++,
>>>and your videogame most likely will.
>>>
>>
>>Cell phones are more likely a mix of C and (unfortunately) Java these days.
>>
Symbian is C++ and some philips models have a linux based OS with Qt.
However, majority of cell phones probably use C, or shall we say the
code and applications running on them is developed in C.
>
A large number of the new operator branded phones use Java.

--
Ian Collins.
 

Bookmarks

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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles