473,320 Members | 1,814 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,320 software developers and data experts.

Can anybody recommend a C++ book? (intermediate/advanced)

I'm currently a Delphi developer (my day job) but at my company we only
write custom web application/database stuff, so we never really get
into anything advanced. However, I know enough about pointers, objects,
etc, to consider myself an "intermediate" level programmer.

Well, I'm looking to write a game involving physics and multiplayer
capability, and that pretty much means I need C++ if I want to use any
existing engines (eg. HGE, RakNet, ODE, etc).

With that said, I know enough about C++ to write basic programs and I
can even write simple objects but thats about it. When it comes to
multiple inheritance, templates, advanced memory allocation, advanced
pointers, and other advanced C++ stuff I'm pretty lost.

So can anybody recommend me a C++ book?

What concepts are important to learn for writing a multiplayer game in
C++?

Any suggestions available on Safari (www.safaribooksonline.com) is a
bonus Smile

Thanks in advance for any suggestions!

Sep 21 '06 #1
10 2295
jk*****@gmail.com wrote:
>
So can anybody recommend me a C++ book?

What concepts are important to learn for writing a multiplayer game in
C++?

Any suggestions available on Safari (www.safaribooksonline.com) is a
bonus Smile
I don't know if its available on Safari, but I'd start with Koenig & Moo
"Accelerated C++". It starts you off the "C++ way", rather than as C
and then adding the classes.

Sep 21 '06 #2
jk*****@gmail.com wrote:
[snip]
With that said, I know enough about C++ to write basic programs and I
can even write simple objects but thats about it. When it comes to
multiple inheritance, templates, advanced memory allocation, advanced
pointers, and other advanced C++ stuff I'm pretty lost.
No book recommendation but ....
C++ is a big language, but don't fall into the trap of thinking that
you need to know every nuance and corner of it to do productive work.
Eg for templates you probably need to know enough to use the STL but
you don't need to worry about writing your own templates until you've
found your feet a bit. In fact I'd tackle your list thus:
MI - you won't need it.
Templates - see blurb above.
Advanced memory allocation - new and delete, possibly auto_ptr, that's
all. Don't go near writing your own operator new, allocators or any of
that.
Advanced pointers - You'll read lots on this ng about various smart
pointers, but again I'd suggest sticking with raw pointers for
starters.

When you pare down the list like this it all becomes a lot less
daunting - if you know Delphi and have a good intuitive grasp of what a
pointer is then you have a good starting point.

HTH

Sep 21 '06 #3
tragomaskhalos wrote:
jk*****@gmail.com wrote:
[snip]
With that said, I know enough about C++ to write basic programs and I
can even write simple objects but thats about it. When it comes to
multiple inheritance, templates, advanced memory allocation, advanced
pointers, and other advanced C++ stuff I'm pretty lost.

No book recommendation but ....
Since the OP asked, see accu.org for lots of book reviews. But
_Accelerated C++_ is probably the single best book out there for
learning (or re-learning or expanding one's knowledge of) C++ the right
way.
C++ is a big language, but don't fall into the trap of thinking that
you need to know every nuance and corner of it to do productive work.
Eg for templates you probably need to know enough to use the STL but
you don't need to worry about writing your own templates until you've
found your feet a bit. In fact I'd tackle your list thus:
MI - you won't need it.
Templates - see blurb above.
Advanced memory allocation - new and delete, possibly auto_ptr, that's
all. Don't go near writing your own operator new, allocators or any of
that.
Add to that STL containers (cf.
http://www.parashift.com/c++-faq-lit...html#faq-34.1).
Advanced pointers - You'll read lots on this ng about various smart
pointers, but again I'd suggest sticking with raw pointers for
starters.
I'd suggest just the opposite. Use raw pointers only when you must
(which is usually when you are communicating with a third-party
library). Unlike raw pointers, smart pointers (and other containers
that replace them like std::vector and std::string) are exception-safe
and provide automatic clean-up, which can virtually eliminate memory
leaks. To top it off, a very high quality and well-tested
implementation of several such classes is available for free from
boost.org, and in fact Boost's shared_ptr is part of TR1, which means
it will in all likelihood be an official part of the standard library
at the next revision.

Cheers! --M

Sep 21 '06 #4

tragomaskhalos wrote:
jk*****@gmail.com wrote:

Eg for templates you probably need to know enough to use the STL but
you don't need to worry about writing your own templates until you've
found your feet a bit. In fact I'd tackle your list thus:
MI - you won't need it.
Since C++ does not have a concept of interfaces besides abstract
classes that you inherit from you need MI in *many* normal situations.
There are many cases when you just can't write clean code without it,
you have to sacrifice some form of design to work around not using MI,
and this is just silly. MI isn't very complex anyway, I don't know why
you would want to remove it from a list of things to learn.
Templates - see blurb above.
Well, I put templates on a bit higher priority but in general you're
right.
Advanced memory allocation - new and delete, possibly auto_ptr, that's
all. Don't go near writing your own operator new, allocators or any of
that.
Yep, the default usually works pretty good.
Advanced pointers - You'll read lots on this ng about various smart
pointers, but again I'd suggest sticking with raw pointers for
starters.
Since smart pointers are a lot easier and safer to use I would say
"advanced pointers" are the raw kind. I wouldn't try to write a smart
pointer right away because it requires an advanced level of knowledge
but definately use them.

Sep 21 '06 #5

jk*****@gmail.com wrote:
So can anybody recommend me a C++ book?
http://www.bookpool.com/sm/0201775816

Sep 21 '06 #6

Noah Roberts wrote:
tragomaskhalos wrote:
jk*****@gmail.com wrote:

MI - you won't need it.

Since C++ does not have a concept of interfaces besides abstract
classes that you inherit from you need MI in *many* normal situations.
There are many cases when you just can't write clean code without it,
you have to sacrifice some form of design to work around not using MI,
and this is just silly. MI isn't very complex anyway, I don't know why
you would want to remove it from a list of things to learn.
Fair enough - I was going to point out that MI isn't actually very
hard, but my original comment was based on the observation that MI
isn't available in a lot of languages (including C++ once upon a time)
and they seem to do OK, albeit that some of them do provide interfaces
instead. So I'm not convinced that you can't get away without it, but
would agree that it's conceptually so straightforward that there's no
real value in *not* learning it early on.
>
Advanced pointers - You'll read lots on this ng about various smart
pointers, but again I'd suggest sticking with raw pointers for
starters.

Since smart pointers are a lot easier and safer to use I would say
"advanced pointers" are the raw kind. I wouldn't try to write a smart
pointer right away because it requires an advanced level of knowledge
but definately use them.
You and mlimber have both picked me up on this, and I suspect you both
represent the majority expert view so I appreciate I'm on thin ground
here. But my personal preference is to learn the raw concept first (eg
traditional pointers), get to know first hand the challenges involved
(eg ohmygawd I have to keep on top of all these deletion / ownership
issues), and then move onto an abstraction (ie smart pointers) that
saves a lot of grief, when one can appreciate fully the value of it.
The danger as I see it of going straight to the abstraction is that you
can be left without the underlying understanding when something doesn't
work as you'd expect (eg there was a thread a few days ago about
circular references with shared_ptr). Joel Spolsky expresses this far
more eloquently when he talks about "the law of leaky abstractions",
which abound in C++ partly because of all the legacy baggage of C
compatibility; he gives the example of std::string, which works
brilliantly at hiding the novice from some ugly realities until they
try and do string s = "oh" + "oh";.

Sep 21 '06 #7
tragomaskhalos wrote:
Noah Roberts wrote:
tragomaskhalos wrote:
Advanced pointers - You'll read lots on this ng about various smart
pointers, but again I'd suggest sticking with raw pointers for
starters.
Since smart pointers are a lot easier and safer to use I would say
"advanced pointers" are the raw kind. I wouldn't try to write a smart
pointer right away because it requires an advanced level of knowledge
but definately use them.

You and mlimber have both picked me up on this, and I suspect you both
represent the majority expert view so I appreciate I'm on thin ground
here. But my personal preference is to learn the raw concept first (eg
traditional pointers), get to know first hand the challenges involved
(eg ohmygawd I have to keep on top of all these deletion / ownership
issues), and then move onto an abstraction (ie smart pointers) that
saves a lot of grief, when one can appreciate fully the value of it.
The danger as I see it of going straight to the abstraction is that you
can be left without the underlying understanding when something doesn't
work as you'd expect (eg there was a thread a few days ago about
circular references with shared_ptr).
Can't the same thing be said for any abstraction, e.g. compilers. Why
use C++ instead of assembly since it only hides the details of how
things actually work? We deal in the abstract because it helps us solve
problems more easily. Granted that it is helpful to know how to use the
lower level elements as well, but that doesn't mean one should *start*
there. _Accelerated C++_ doesn't -- the authors introduce std::vectors
and std::strings first and only in chapter 9 or 10 get to raw pointers
and arrays.
Joel Spolsky expresses this far
more eloquently when he talks about "the law of leaky abstractions",
which abound in C++ partly because of all the legacy baggage of C
compatibility; he gives the example of std::string, which works
brilliantly at hiding the novice from some ugly realities until they
try and do string s = "oh" + "oh";.
Sure, but one can (and should!) still use these imperfect abstractions
to great effect.

Cheers! --M

Sep 21 '06 #8
Just about anything written by Scott Meyers.

Effective C++
Effective STL
More Effective C++

My two cents!
jk*****@gmail.com wrote:
I'm currently a Delphi developer (my day job) but at my company we only
write custom web application/database stuff, so we never really get
into anything advanced. However, I know enough about pointers, objects,
etc, to consider myself an "intermediate" level programmer.

Well, I'm looking to write a game involving physics and multiplayer
capability, and that pretty much means I need C++ if I want to use any
existing engines (eg. HGE, RakNet, ODE, etc).

With that said, I know enough about C++ to write basic programs and I
can even write simple objects but thats about it. When it comes to
multiple inheritance, templates, advanced memory allocation, advanced
pointers, and other advanced C++ stuff I'm pretty lost.

So can anybody recommend me a C++ book?

What concepts are important to learn for writing a multiplayer game in
C++?

Any suggestions available on Safari (www.safaribooksonline.com) is a
bonus Smile

Thanks in advance for any suggestions!

--
------------------------------------------------------------------
Jack G. Atkinson Jr.
jg*******@gmail.com
Psa 104:4 He makes His angels spirits,
His ministers a flaming fire.
Luke 12:36-47 - Be ready!
------------------------------------------------------------------
Sep 22 '06 #9
Jack G. Atkinson Jr wrote:
Just about anything written by Scott Meyers.

Effective C++
Effective STL
More Effective C++
Sure. As the FAQ suggests, buy at least three:

http://www.parashift.com/c++-faq-lit....html#faq-28.4

Cheers! --M

Sep 22 '06 #10

Jack G. Atkinson Jr wrote:
Just about anything written by Scott Meyers.

Effective C++
Effective STL
More Effective C++

My two cents!
Why top post?

Personally I think Sutter's books are better.

Sep 22 '06 #11

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

Similar topics

12
by: Guido Mureddu | last post by:
Hello, I'm a student in electronic engineering. I do know you've seen and answered this sort of topic/request countless times, but I haven't found past threads as helpful as I had hoped, and...
3
by: Alex R | last post by:
Hey guys, I have been programming on and off in C for many years now, but I seem to forget the format of some function calls/conventions here and there, I might be working on something that is...
7
by: noid droid | last post by:
Greetings. I received 4 VB .NET books and looking through the indices and tables of contents, I see that none of them addresses multithreading in VB ..NET. I just bought a bunch of books because...
2
by: Chris Asaipillai | last post by:
Hi there Im starting a new course this Saturday. OBJECT ORIENTED DEVELOPMENT WITH VISUAL BASIC .NET and will cover the following concepts and principles. a.. Be able to build VB.NET...
4
by: Dave | last post by:
Hi, I've been writing C++ COM controls and VB 6 Applications for years. Before that Windows applications in C and OS2 Presentation Manager in C. My question is what book do you think would...
2
by: daveyand | last post by:
Hey Guys, I find myself using JS more and more but i find it difficult to find any better ways to do things or at least ways to do stuff that i havent thought of. Esp now with this AJAX...
12
by: Eps | last post by:
I am starting a new job that involves programming in c# and using ASP.net. I have some experience with c# but have little knowledge of ASP, I would like to get a book about each so I can get some...
10
by: Rob Kendrick | last post by:
Hi, I'm a C programmer of (I'd like to think) intermediate skill and experience, able to throw most things together quite happily in C. I'd like to get to the point of being able to...
4
by: Dasuraga | last post by:
I've been programming in C++ for a while now, but the only "real" training material I have is "C++ for dummies"(to make things even worse, it's the fourth edition,which doesn't even cover STL, and...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.