language features!

S

Sean

Hi, guys:
I am newbie to the C++ from the C. I want to know something about the
C++ language features! Could you describe your two favorite features in
the C++ language and why you like them so much. Also describe the two
features of the C++ language that you think are the most over-rated or
the most misused, and why you think that is the case.
Thanks in advance!

Sean
 
R

Rolf Magnus

Sean said:
Hi, guys:
I am newbie to the C++ from the C. I want to know something about the
C++ language features! Could you describe your two favorite features in
the C++ language and why you like them so much. Also describe the two
features of the C++ language that you think are the most over-rated or
the most misused, and why you think that is the case.

Hmmm, this question sounds quite familiar....
.... googling...

Hah, I knew it:
http://groups.google.com/group/comp.lang.c++/browse_thread/thread/8106cb29a63feb75/c4705744d465c4ec

I'm wondering if this is some kind of homework question that will come up
here once every semester or so.
 
N

n2xssvv g02gfr12930

Sean said:
Hi, guys:
I am newbie to the C++ from the C. I want to know something about the
C++ language features! Could you describe your two favorite features in
the C++ language and why you like them so much. Also describe the two
features of the C++ language that you think are the most over-rated or
the most misused, and why you think that is the case.
Thanks in advance!

Sean
The STL library is by far the most useful C++ feature. This often
makes use of operator overloading and functors, and by definition is a
template library. So my vote goes to those features for the most useful.
The most frequently misused operations are new and delete resulting
in failed garbage collection, hence I recommend using the STL containers
instead. Finally, the parsing of class objects by value is common source
of problems due to constructor/destructor implementation.

JB
 
B

benben

Sean said:
Hi, guys:
I am newbie to the C++ from the C. I want to know something about the
C++ language features! Could you describe your two favorite features in
the C++ language and why you like them so much. Also describe the two
features of the C++ language that you think are the most over-rated or
the most misused, and why you think that is the case.
Thanks in advance!

Sean

There are so many of C++ features it is just unfair to mention only
two...but if you must then:

* function and operator overloading
* // comment :)

So you can write something as cool as:

Vector rotate(Vector v, Vector center, double theta)
{
Vector r = v - center; // operator overloading
Vector p = polar_form(r);
r = rectangular_form(p + J(theta));

return center + relative;
}

Regards,
Ben
 
T

TB

Sean skrev:
Hi, guys:
I am newbie to the C++ from the C. I want to know something about the
C++ language features! Could you describe your two favorite features in
the C++ language and why you like them so much. Also describe the two
features of the C++ language that you think are the most over-rated or
the most misused, and why you think that is the case.
Thanks in advance!

Sean

I find this question kinda ugly. My two favorite features?
 
S

Sgt. York

n2xssvv said:
The STL library is by far the most useful C++ feature. This often
makes use of operator overloading and functors, and by definition is a
template library. So my vote goes to those features for the most useful.
The most frequently misused operations are new and delete resulting
in failed garbage collection, hence I recommend using the STL containers
instead. Finally, the parsing of class objects by value is common source
of problems due to constructor/destructor implementation.

JB

Amen, JB. Without STL, I can't imagine myself using C++ at all. I've
also become rather boost-dependent (www.boost.org) as well. Some really
amazing stuff in there.

-York
 
F

forkazoo

Sean said:
Hi, guys:
I am newbie to the C++ from the C. I want to know something about the
C++ language features! Could you describe your two favorite features in
the C++ language and why you like them so much. Also describe the two
features of the C++ language that you think are the most over-rated or
the most misused, and why you think that is the case.
Thanks in advance!

Sean

This is school related, right? Well, if you want to really impress
your teacher, just tell him that the Library for Standard Data is what
you use all the time. It will be replacing the STL. So, in class one
day, just tell your teacher that you use the LSD all the time, and see
how impressed he is.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top