Author Topic: Best c++ Book?  (Read 1479 times)

0 Members and 1 Guest are viewing this topic.

Xedafen

  • Guest
Best c++ Book?
« on: September 16, 2014, 02:33:59 pm »
« Last Edit: September 16, 2014, 02:36:04 pm by Xedafen »

Offline Killordie

  • /dev/null
  • *
  • Posts: 6
  • Cookies: 2
    • View Profile
Re: Best c++ Book?
« Reply #1 on: October 09, 2014, 10:48:35 am »
Hi there,

I'm glad you have decided to pick up programming, yet sad to see no one has replied yet. When I have time later in the day I will update this post with my recommendations and advice so hang in tight.

In the meanwhile if you are completely new to programming this is not a bad start: http://www.tutorialspoint.com/cprogramming/.

Offline Stackprotector

  • Administrator
  • Titan
  • *
  • Posts: 2515
  • Cookies: 205
    • View Profile
Re: Best c++ Book?
« Reply #2 on: October 09, 2014, 11:13:07 am »
I liked http://www.learncpp.com/ myself. It's good when you need a quick c++ primer:)
~Factionwars

Offline Killordie

  • /dev/null
  • *
  • Posts: 6
  • Cookies: 2
    • View Profile
Re: Best c++ Book?
« Reply #3 on: October 09, 2014, 11:31:21 am »
I liked http://www.learncpp.com/ myself. It's good when you need a quick c++ primer:)

Actually I second that. It does not matter a whole lot if you start out in C or in C++ although in game development you are more likely to jump straight into C++. As far as buying the book goes I would follow Factionwars tutrorial link first. Having an understanding of C++ in general will also help you understand which book is more likely to be of use to you.

I would also like to add websites with C++ references:
http://www.cplusplus.com/reference/
http://en.cppreference.com/w/

Offline kenjoe41

  • Symphorophiliac Programmer
  • Administrator
  • Baron
  • *
  • Posts: 990
  • Cookies: 224
    • View Profile
Re: Best c++ Book?
« Reply #4 on: October 09, 2014, 02:32:11 pm »
Don't know if these might enlighten you. Take you pick: http://evilzone.org/c-c/c-guides-and-resources/
If you can't explain it to a 6 year old, you don't understand it yourself.
http://upload.alpha.evilzone.org/index.php?page=img&img=GwkGGneGR7Pl222zVGmNTjerkhkYNGtBuiYXkpyNv4ScOAWQu0-Y8[<NgGw/hsq]>EvbQrOrousk[/img]

Offline s3my0n

  • Knight
  • **
  • Posts: 276
  • Cookies: 58
    • View Profile
    • ::1
Re: Best c++ Book?
« Reply #5 on: October 10, 2014, 03:17:31 pm »
Actually I second that. It does not matter a whole lot if you start out in C or in C++

This might have been correct 10 years ago, but now C++ has completely different style to C. You can code in C if you use C++, but you cannot code in C++ if you use C. C++ is just different paradigm of thinking with classes (and everything that goes with that), objects, STL (if you don't use STL you are not programming in C++), etc

As one person on the Internet said:
"Put simply, what is considered idiomatic in C is definitely not idiomatic in C++.
C and C++ are very different languages in practice, because of the way people use them. C aims at minimalism, where C++ is a very complex language, with a lot of features."
Easter egg in all *nix systems: E(){ E|E& };E

Offline Killordie

  • /dev/null
  • *
  • Posts: 6
  • Cookies: 2
    • View Profile
Re: Best c++ Book?
« Reply #6 on: October 10, 2014, 09:37:08 pm »
This might have been correct 10 years ago, but now C++ has completely different style to C. You can code in C if you use C++, but you cannot code in C++ if you use C. C++ is just different paradigm of thinking with classes (and everything that goes with that), objects, STL (if you don't use STL you are not programming in C++), etc

As one person on the Internet said:
"Put simply, what is considered idiomatic in C is definitely not idiomatic in C++.
C and C++ are very different languages in practice, because of the way people use them. C aims at minimalism, where C++ is a very complex language, with a lot of features."

Hi s3my0n,

Although you are absolutely correct in in what you said I'm afraid you misinterpreted what I meant. Taking in consideration that the OP has no programming experience the first programs are going to be very minimalistic and simple in nature. Does it really matter then if you use C or C++ when you at highest write a function or two to learn the basics?

There is an argument to be made for C++'s STL and that the books mentioned by him all use C++ as a basis, but for the purpose of learning C/C++ I really don't think it matters a whole lot how you start out because it will be in roughly the same way and you'll still end up using the rich C++ environment in the end.

Offline kenjoe41

  • Symphorophiliac Programmer
  • Administrator
  • Baron
  • *
  • Posts: 990
  • Cookies: 224
    • View Profile
Re: Best c++ Book?
« Reply #7 on: October 10, 2014, 10:10:03 pm »
@Killordie; lets not make this another C/C++ battle. The current C++ way is very different from the C syntax. It even got worse with C++11 that took C++ in another very different galaxy.
At this point if you start with C, you are gonna start again from the beginning if you ever think of doing C++; forget almost every thing and relearn new approaches to your problem, OOp approaches with a huge mix of STL.
If you can't explain it to a 6 year old, you don't understand it yourself.
http://upload.alpha.evilzone.org/index.php?page=img&img=GwkGGneGR7Pl222zVGmNTjerkhkYNGtBuiYXkpyNv4ScOAWQu0-Y8[<NgGw/hsq]>EvbQrOrousk[/img]

Offline ArkPhaze

  • Peasant
  • *
  • Posts: 136
  • Cookies: 20
  • null terminated
    • View Profile
Re: Best c++ Book?
« Reply #8 on: October 14, 2014, 01:21:08 am »
This might have been correct 10 years ago, but now C++ has completely different style to C. You can code in C if you use C++, but you cannot code in C++ if you use C. C++ is just different paradigm of thinking with classes (and everything that goes with that), objects, STL (if you don't use STL you are not programming in C++), etc

As one person on the Internet said:
"Put simply, what is considered idiomatic in C is definitely not idiomatic in C++.
C and C++ are very different languages in practice, because of the way people use them. C aims at minimalism, where C++ is a very complex language, with a lot of features."

Actually, this is only semi-true... If you attempt to write C++, coming from a C background, you'll probably end up just using pointers where references and/or iterators would be better suited paired with some kind of container. You may be frustrated by things like sizeof('x') in C vs. sizeof('x') in C++, but those are still quite minimal issues. If you use a function in C++ like malloc() and you're used to not casting the return, a compiler error should guide you in the right path pretty quickly. Just because the standard idea of C++ typically requires a different way of thinking, doesn't mean you can't write C-like code in C++. You probably just won't be using half of the features available to the language is all.

So I assume you mean to say that "you can't write REAL C++ code coming from a C background," just to clear the confusion, and if that's the case, then you are 100% correct.

Because it's bad to mix the two... If you use C I/O instead of C++ I/O when programming in C++, you're probably not taking advantage of RAII as you should for instance with things like std::?fstream.

There was a comparison I read recently.

"Using C is like walking on one side of the road and possibly getting hit by cars in one direction, using C++ is like walking on the other side of the road and getting hit by cars going in the opposite direction, but using C & C++ is like walking down the middle of the road and getting hit by cars going in both directions."

Hi s3my0n,

Although you are absolutely correct in in what you said I'm afraid you misinterpreted what I meant. Taking in consideration that the OP has no programming experience the first programs are going to be very minimalistic and simple in nature. Does it really matter then if you use C or C++ when you at highest write a function or two to learn the basics?

There is an argument to be made for C++'s STL and that the books mentioned by him all use C++ as a basis, but for the purpose of learning C/C++ I really don't think it matters a whole lot how you start out because it will be in roughly the same way and you'll still end up using the rich C++ environment in the end.

Maybe it doesn't matter, but as I said, you can still run into discrepancies without delving into the STL for the comparison of C and C++. These languages are even less comparable now as the years go by... If you happen to run into one of the small but subtle differences, it may be confusing to the person trying to learn the language.

If you have an idea of what kinds of things you want to do with C/C++, then you should try to choose THE language of the two that best suits your goals, and stick with it. If at a later time you decide you want to learn the other, then do so... There are cases where C++ is more suitable than C and others where C is a better option than C++.

If you plan on learning C++ then, as s3my0n is trying to explain to you... You should NOT be trying to write C-like code in C++, just because it compiles fine. The STL is provided for a reason, and a good one at that. You don't have the STL in C, so if you're learning C++ or not, you're either using it or not using it; C or C++.

Killordie, there's a big difference between even the hello world versions of C and C++; printf() and std::cout are not even remotely the same, just because they can be used to write output to the console's stdout.
« Last Edit: October 14, 2014, 01:33:49 am by ArkPhaze »
sig=: ArkPhaze

[ J/ASM/.NET/C/C++ - Software Engineer ]