> I missed the original question, but if OP (Greg?) can wait

At the perl meeting, I mentioned that I'm using a lot of c++
at work and groused that I haven't found a good
"intro to c++" book.

So, I'm the guy to blame for this thread.

I would like a book that introduces c and c++ from the
point of view of showing the best practices first
and comp-sci theory gets put in the second edition
so I don't have to buy it.

For example, unless I'm missing something fundamental,
I don't see any reason to have parameters to a c++ function
ever be a pointer. If I need an in/out, I pass by reference.

The entire rest of the code treats it like whatever variable
type that is is, and all you do is put an ampersand in front
of the paramter in the function declaration.

The sigils in c++ also seem to have some inconsistencies
similar in flavor to the way perl has an array declared
with @array and indexes into the array with $array[]
but you can also have a scalar called $array.

For the life of me, I cannot wrap my head around the
line noise that is c++ declaring a function or variable
by putting all manner of line noise in the code.

There's also the various and many flavors of a sequence
of characters in c++. You could have an array of chars,
a pointer to an array of chars, a std::string, a sstream,
and I'll be DAMNED if c++ isn't designed so that not one of
them will work in every situation.

Most of my code is using std::string, but sometimes I need
to convert to c_str() and sometimes I need to use streams
and it just makes me want to gouge my eyes out.

So, really, if the way to move text around is with strings
then I'd like a book that starts out introducing strings
and then later on, when some stupid exception to the rule
comes up, it goes into char* or streams and explains the
difference at that point.

That was the sort of book I was looking for.
Probably doesn't exist because no one will agree on the
best way to pass strings around in c++.

But that's how the subject of c++ books came up.
Greg


_______________________________________________
Boston-pm mailing list
Boston-pm@mail.pm.org
http://mail.pm.org/mailman/listinfo/boston-pm

Reply via email to