473,407 Members | 2,312 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Advantages of C++ over C - request for information

Hello.

I have to create short (1 hour) presentation about C++ advantages over
C. Are there any good articles/texts/etc. about such topic?

Personally, I'm quite proficient at C++ myself (e.g. I've read and
understood many books from H. Sutter, A. Alexandrescu etc.), so I do not
need to learn about C++ before making that presentation. I am able to
write such presentation myself, but of course - if somebody else written
similar text, I would like to use it.

Thanks in advance for any ideas, comments and pointers to articles.

--
Best regards from
Kamil Burzynski
Jul 23 '05 #1
17 7803
Kamil Burzynski wrote:
I have to create short (1 hour) presentation about C++ advantages over
C. Are there any good articles/texts/etc. about such topic?
Have you tried the Web? www.google.com is a good starting point.
[...]

Jul 23 '05 #2
"Kamil Burzynski" <K.*********@usunto.adbglobal.com> wrote in message
news:20*********************@kburzynski1.adb.pl...
I have to create short (1 hour) presentation about C++ advantages over
C. Are there any good articles/texts/etc. about such topic?


Take a look at chapter 1 of 'Ruminations on C++."

Also, here's an example:

map<string, int> words;
string word;

while (cin >> word)
++words[word];

This code fragment counts how many times each distinct word appears in the
standard input stream. You might try rewriting it in C and see how much
more code it takes.
Jul 23 '05 #3
On Mon, 07 Mar 2005 15:39:27 GMT
"Andrew Koenig" <ar*@acm.org> wrote:
"Kamil Burzynski" <K.*********@usunto.adbglobal.com> wrote in message
news:20*********************@kburzynski1.adb.pl...

Take a look at chapter 1 of 'Ruminations on C++."

Also, here's an example:

map<string, int> words;
string word;

while (cin >> word)
++words[word];

This code fragment counts how many times each distinct word appears in the
standard input stream. You might try rewriting it in C and see how much
more code it takes.


Thanks a lot - great example! By the way: any similar example for type traits,
some advanced template<> (i.e. something more than containers) snippets?

--
Best regards from
Kamil Burzynski
Jul 23 '05 #4
On Mon, 07 Mar 2005 10:37:46 -0500
Victor Bazarov <v.********@comAcast.net> wrote:
Kamil Burzynski wrote:
I have to create short (1 hour) presentation about C++ advantages over
C. Are there any good articles/texts/etc. about such topic?


Have you tried the Web? www.google.com is a good starting point.


Yes, I'm googling for this subject... for now I've end up with tons of
C++ tutorials ;p I will keep going on, though.

--
Best regards from
Kamil Burzynski
Jul 23 '05 #5
On Mon, 7 Mar 2005 16:34:24 +0100,
Kamil Burzynski <K.*********@usunto.adbglobal.com> wrote
in Msg. <20*********************@kburzynski1.adb.pl>
I have to create short (1 hour) presentation about C++ advantages over
C. Are there any good articles/texts/etc. about such topic?


That's an odd topic. Any talk entitled "The advantages of A over B" sounds
like a misguided attempt to sell product A to a customer who prefers B.
But if this was the case it would be better to entitle the talk "On the
differences between A and B", which of course would also unveil the
advantages that B has over A.

And 1 hour is by no means "short". What's the background of this question?
Just curious.

--Daniel
Jul 23 '05 #6
On 7 Mar 2005 16:20:12 GMT
Daniel Haude <ha***@kir.physnet.uni-hamburg.de> wrote:
On Mon, 7 Mar 2005 16:34:24 +0100,
I have to create short (1 hour) presentation about C++ advantages over
C. Are there any good articles/texts/etc. about such topic?
That's an odd topic. Any talk entitled "The advantages of A over B" sounds
like a misguided attempt to sell product A to a customer who prefers B.
But if this was the case it would be better to entitle the talk "On the
differences between A and B", which of course would also unveil the
advantages that B has over A.


Good point. This situation is slightly similar, however :) Take a look
below for more explaination.
And 1 hour is by no means "short". What's the background of this question?
Just curious.


Well, lets say, that "long" is few days - 8h each ;)

There is many C programmers, that do avoid C++ just because "it is too
bloated, C++ are bigger and slower, I can use struct instead of class and have
rougly the same functionality, etc.". I would like to show, that C++
is not necessarily overbloated, and it have many useful mechanisms, that
are improving programmers efficiency on long-term project development.

--
Best regards from
Kamil Burzynski
Jul 23 '05 #7

Kamil Burzynski wrote:
Hello.

I have to create short (1 hour) presentation about C++ advantages over C. Are there any good articles/texts/etc. about such topic?


Don't forget to mention that C++ is C with two plusses...

Jul 23 '05 #8
Noah Roberts wrote:
Kamil Burzynski wrote:
Hello.

I have to create short (1 hour) presentation about C++ advantages


over
C. Are there any good articles/texts/etc. about such topic?

Don't forget to mention that C++ is C with two plusses...


Why is that an advantage? Takes almost 200% longer to type...
Jul 23 '05 #9
"Kamil Burzynski" writes:
I have to create short (1 hour) presentation about C++ advantages over
C. Are there any good articles/texts/etc. about such topic?

Personally, I'm quite proficient at C++ myself (e.g. I've read and
understood many books from H. Sutter, A. Alexandrescu etc.), so I do not
need to learn about C++ before making that presentation. I am able to
write such presentation myself, but of course - if somebody else written
similar text, I would like to use it.

Thanks in advance for any ideas, comments and pointers to articles.


Try Bjarne Stroustup's site:

http://www.research.att.com/~bs/C++.html

I haven't looked but there must be some good stuff there. I know he has a
good list of advantages in the Second Edition of _The C++ Programming
Language_.
Jul 23 '05 #10
Kamil Burzynski wrote:
Hello.

I have to create short (1 hour) presentation about C++ advantages over
C. Are there any good articles/texts/etc. about such topic?

Personally, I'm quite proficient at C++ myself (e.g. I've read and
understood many books from H. Sutter, A. Alexandrescu etc.), so I do not
need to learn about C++ before making that presentation. I am able to
write such presentation myself, but of course - if somebody else written
similar text, I would like to use it.

Thanks in advance for any ideas, comments and pointers to articles.

1> new /delete vs malloc?
2> inline constructors and destructors for better performance?
3> How do we acccess struct data? Using some array indexing -- so isn't
that overhead?
4> What about locality of reference in c++ isnt it much better?

You can talk about these points as well.
Jul 23 '05 #11
Kamil Burzynski wrote:
There is many C programmers, that do avoid C++ just because "it is too
bloated, C++ are bigger and slower, I can use struct instead of class and have
rougly the same functionality, etc.". I would like to show, that C++
is not necessarily overbloated, and it have many useful mechanisms, that
are improving programmers efficiency on long-term project development.


If you're trying to sell/promote/discuss C++ rationally with a bunch of
die-hard C programmers (I oughta know, I used to be one many years ago)...

Then maybe they are already thinking object-oriented, packaging data up
in structs and writing functions to work with structs. (ie. almost like
member functions) You could point out:

C++ increases type safety, particularly with new, delete, collection
classes and stream IO. This enables you to catch some errors at compile
time rather than debugger time.

C++ provides automated "plumbing" for doing what they are already doing
"by hand." If they are thinking/coding object oriented (yes you can do
that in C) then using an OO language just makes life easier.

C++ provides virtual functions, something not easily done in raw C. (yes
I know you can. But hey, I can whittle a rocking chair with nothing
more than a pocket knife too, but why would anyone want to?)

C++ gives you the STL, letting you "stand on the shoulders of giants" -
or at least not have to re-invent fundamental data structures and
algorithms.

C++ provides an exception mechanism for structured error handling.

C++ is not nearly as big and bloated as many C die-hards (and assembly
programmers) would have us believe. Can you hurt yourself (and
performance) with C++? Sure. But you can also write code that is every
bit as efficient as C. When people complain that C++ is big and
bloated, it often means that their understanding of the problem and how
best to apply OO/C++ to it is anemic.

Finally, they don't have to try to go whole-hog into C++ from day one.
They can start out simply using C++ as a better C. Then begin applying
C++ idioms as appropriate.
Jul 23 '05 #12
Phil Staite wrote:
Kamil Burzynski wrote: .... C++ is not nearly as big and bloated as many C die-hards (and assembly
programmers) would have us believe. Can you hurt yourself (and
performance) with C++? Sure. But you can also write code that is every
bit as efficient as C.
Translation: "I can write bad code in any language."
When people complain that C++ is big and bloated, it often means that their understanding of the problem and how
best to apply OO/C++ to it is anemic.

Finally, they don't have to try to go whole-hog into C++ from day one.
They can start out simply using C++ as a better C. Then begin applying
C++ idioms as appropriate.


I'm not sure this is appropriate (after having done just that)!

I would rather introduce tools like smart pointers, policy classes etc
right up front. The learning curve will be shorter (hopefully).

Jul 23 '05 #13
I hear this is the approach "Accelerated C++" takes, though I havent'
seen this book myself. (I wish I had heard of it it 7 years or so ago
though, if it was around then.)

I'm actually "writing" (when I have the time, which is essentially
never) what will be a full-fledged book I'm going to put online that
takes this approach too.

Jul 23 '05 #14
On Mon, 07 Mar 2005 12:07:03 -0500, Victor Bazarov
<v.********@comAcast.net> wrote:
Noah Roberts wrote:
Kamil Burzynski wrote:
Hello.

I have to create short (1 hour) presentation about C++ advantages

over
C. Are there any good articles/texts/etc. about such topic?

Don't forget to mention that C++ is C with two plusses...


Why is that an advantage? Takes almost 200% longer to type...

All the things you are writing in C++ can be written in C.
Advantage of C++ is that you can do it faster, with less
errors and so on. This is starting point to all other
explanations. Otherwise you will always get answer
"I can do it in my beloved C".
Jul 23 '05 #15
On Tue, 08 Mar 2005 10:43:35 +0200,
Taras <ka*@voliacable.com> wrote
in Msg. <op**************@campus.voliacable.com>
All the things you are writing in C++ can be written in C.
Advantage of C++ is that you can do it faster, with less
errors and so on.


Depends very much on the application though. I learned C++ when I was
faced with a problem that was so compulsively object-oriented that
learning the new language and implementing the application was a lot
faster than it would have been in C. In fact I didn't have to work very
hard because I had negotiated for a very convenient deadline (thinking I
would use C. In C++, I had the parts of the app ready long before the
respective deadlines, but released them only shortly before, thus building
up quite a reputation ;-). So I ended up getting paid quite handsomely for
learning a new language.

I still like C a lot better, aesthetically. Ever wondered why there isn't
an obfuscated C++ contest? ;-)

--Daniel
Jul 23 '05 #16
C++ is a superset of C.

I dont know why I feel that needs explination, but:

C is part of C++, C++ is C and the ++.

Why is package A and B better or worse than just package A?

Well with package A and B you get all of the stuff in package A and all of
the stuff in package B. But in package A, you don't get any B stuff.

Thats why package A and package B is better.

C++ has one major disadvantage, that is coupled with its major advantage.
Speed and size versus Power.

You can write more powerfull programs quicker with c++. And as a result, it
will be a bigger and slower programm than doing the same thing in C alone.
If you want to take the time, and I mean sometimes close to 5 times the
coding to do the same thing in C, go for it.

BUT, just becuase you are using C++ doesn't mean you can no longer put C
code in your program.
Use a healthy mixture of both to pull the Power, AND Performance out of
you're computer.
"Daniel Haude" <ha***@kir.physnet.uni-hamburg.de> wrote in message
news:slrnd2rl46.1vc.ha***@kir.physnet.uni-hamburg.de...
On Tue, 08 Mar 2005 10:43:35 +0200,
Taras <ka*@voliacable.com> wrote
in Msg. <op**************@campus.voliacable.com>
All the things you are writing in C++ can be written in C.
Advantage of C++ is that you can do it faster, with less
errors and so on.


Depends very much on the application though. I learned C++ when I was
faced with a problem that was so compulsively object-oriented that
learning the new language and implementing the application was a lot
faster than it would have been in C. In fact I didn't have to work very
hard because I had negotiated for a very convenient deadline (thinking I
would use C. In C++, I had the parts of the app ready long before the
respective deadlines, but released them only shortly before, thus building
up quite a reputation ;-). So I ended up getting paid quite handsomely for
learning a new language.

I still like C a lot better, aesthetically. Ever wondered why there isn't
an obfuscated C++ contest? ;-)

--Daniel

Jul 23 '05 #17
In message <TnyXd.1054$Qz.789@okepread05>, DHOLLINGSWORTH2
<DH*************@cox.net> writes
C++ is a superset of C.

I dont know why I feel that needs explination, but:


Because it's not true?

--
Richard Herring
Jul 23 '05 #18

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

Similar topics

12
by: bissatch | last post by:
Hi, Generally if I re-use code, I use a function. If I need to use these functions over a number of pages I write the function to an include file where all pages have access. So when should I...
65
by: Anthony_Barker | last post by:
I have been reading a book about the evolution of the Basic programming language. The author states that Basic - particularly Microsoft's version is full of compromises which crept in along the...
8
by: turnit \(removethis\) | last post by:
I have a login form that uses the post method to carry the information to the next page. The form works just fine in ie6.0, but fails in mozilla and fails in ie5.2 on a mac. "HTTP/1.1 400 Bad...
3
by: JT | last post by:
is there a way to clear out the request.form collection, or the entire request object, for that matter?? im using server.transfer and this can be troublesome in cases where you need the...
6
by: Daniel Rimmelzwaan | last post by:
I want to send a biztalk document to an aspx page, and I need to see some sample code, because I just can't make it work. I have a port with transport type HTTP, pointing to my aspx page, something...
20
by: yaron | last post by:
Hi, 1. I am familiar with .NET 1.1 and not with .NET 2.0 . if i should start a new networking project should i write it with .net 2.0 beta or write it with .net 1.1 ? 2. What are the...
0
by: Jack Wright | last post by:
Dear All, I have a web Application "http://localhost/Web/WebForm1.aspx" that calls a WebService from "http://localhost/webserviceapp/service1.asmx"...I have set the executionTimeout to 10 secs in...
1
by: SenthilPSL | last post by:
When I call a webservice on IIS on Windows 2000 Server with .NET runtime 2.0, I get the following Error. System.Net.WebException: The operation has timed out From ASPX Pages, I call the web...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...
0
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...
0
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...
0
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...

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.