Re: Advantages of C++ over C - request for information
From: Phil Staite (phil_at_nospam.com)
Date: 03/08/05
- Next message: adaworks_at_sbcglobal.net: "Re: [OT] Re: Teaching new tricks to an old dog (C++ -->Ada)"
- Previous message: Song Yun Zhao: "Re: when to use uint? dis/advantages?"
- In reply to: Kamil Burzynski: "Re: Advantages of C++ over C - request for information"
- Next in thread: Gianni Mariani: "Re: Advantages of C++ over C - request for information"
- Reply: Gianni Mariani: "Re: Advantages of C++ over C - request for information"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 07 Mar 2005 21:57:57 -0700 To: Kamil Burzynski <K.Burzynski@usunto.adbglobal.com>
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.
- Next message: adaworks_at_sbcglobal.net: "Re: [OT] Re: Teaching new tricks to an old dog (C++ -->Ada)"
- Previous message: Song Yun Zhao: "Re: when to use uint? dis/advantages?"
- In reply to: Kamil Burzynski: "Re: Advantages of C++ over C - request for information"
- Next in thread: Gianni Mariani: "Re: Advantages of C++ over C - request for information"
- Reply: Gianni Mariani: "Re: Advantages of C++ over C - request for information"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|