[prog] School problem, C++ and cout.precision(2);

Kathryn Andersen kat_lists at katspace.com
Sun Nov 24 20:33:32 EST 2002


On Sat, Nov 23, 2002 at 12:58:54AM -0800, Ganesh Swami wrote:
> How many people use C++ completely ? Actually very few.

Classic answer: it depends.  A language zealot might say thou shalt use
only C++, but in the Real World (TM) there's such things as already
existing code written in C (or, heaven help us, Fortran or other ancient
languages) and one just has to deal with it.  C++ is nice, and more of our
stuff at work is is moving towards C++, but the original code was
written in C.  And when one is dealing with pure X (such as writing
one's own widgets) one has to at least deal with the C interface.

The thing I find about C++ is that it's easier to write than to debug --
well, especially if one has complex interrelationships between classes,
or (save us) do complex things in the class initializer.

> Is it worth learning Templates and other advanced C++ features ?

Yes indeedie -- but that doesn't mean you should use templates just
because they're cool, but use them when they're useful.  And when
they're useful, they can be very very useful.  And I don't just mean
the STL (Standard Template Library) but when one is making one's own
classes, it can make sense to use Templates for something you know
you're going to be reusing the design of.
 
> I believe C++ comes with its own classes for implementing stacks, hashes
> and other data structures. Does anybody use them ?

Absolutely.  Why reinvent the wheel?
 
> I personally do not like streams. Its more trouble than ease.

I can relate to that.  On the one hand, streams are cool for printing
out your own classes seamlessly.  On the other hand, there are days when
I hanker for printf.

Kathryn Andersen
-=-=-=-=-=-=-=-=-
"KNEW THIS WAS ONE WAY TICKET BUT YOU KNOW I HAD TO COME"
			-- Virgil Brigman, The Abyss
-- 
 _--_|\	    | Kathryn Andersen	<kat at katspace.com> <http://www.katspace.com>
/      \    | 
\_.--.*/    | GenFicCrit mailing list <http://www.katspace.com/gen_fic_crit/>
      v	    | 
------------| Melbourne -> Victoria -> Australia -> Southern Hemisphere
Maranatha!  |	-> Earth -> Sol -> Milky Way Galaxy -> Universe



More information about the Programming mailing list