[C++] Learning a programming language

  • Context: C/C++ 
  • Thread starter Thread starter trollcast
  • Start date Start date
  • Tags Tags
    Language Programming
Click For Summary

Discussion Overview

The discussion revolves around the best approaches to learning C++, focusing on whether to use a dedicated textbook or to learn through practical problem-solving on platforms like Project Euler. It includes considerations of different learning styles and the challenges associated with various resources.

Discussion Character

  • Exploratory
  • Debate/contested
  • Homework-related

Main Points Raised

  • One participant suggests considering a textbook specifically on C++, such as one by Bjarne Stroustrup, to learn the language in depth.
  • Another participant emphasizes that writing code is the best way to learn, recommending tackling problems of personal interest.
  • A different participant mentions the value of Stroustrup's work as a reference rather than a textbook and suggests other books that focus on using the C++ standard library effectively.
  • One participant warns that learning C++ through Project Euler may be discouraging due to the mathematical complexity of the problems, which could be more challenging than the programming aspect for some learners.

Areas of Agreement / Disagreement

Participants express differing opinions on the effectiveness of using textbooks versus practical problem-solving. There is no consensus on the best approach, and the discussion reflects a variety of perspectives on learning methods.

Contextual Notes

Participants highlight the importance of personal learning styles and the varying difficulty levels of resources, particularly the mathematical demands of Project Euler compared to programming skills.

trollcast
Gold Member
Messages
282
Reaction score
13
I'm trying to learn C++ at the minute and I've managed to get over the basics, I/O, Conditionals, Repetition up to and a bit of pointers.

Now what I'm wondering is should I get a textbook that is solely on C++, eg. Barjne Soustroups one, and learn specifically C++.

Or learn by doing problems on places like Project Euler and prehaps maybe a book on another topic that's written in C++, specifically something like this: https://www.amazon.com/dp/032144146X/?tag=pfamazon01-20 , and learn from the code examples and practice?
 
Last edited by a moderator:
Technology news on Phys.org
The best way to learn how to write code is to write code. Pick some problems that you are interested in and try to write code to implement these problems.
 
trollcast said:
eg. Barjne Soustroups one

You mean this one?

https://www.amazon.com/dp/0321543726/?tag=pfamazon01-20

I haven't seen it myself, but it's gotten good reviews on Amazon, and I think anything Stroustrup writes about C++ is worth reading. I see a new edition of his "bible" is coming out in May:

https://www.amazon.com/dp/0321563840/?tag=pfamazon01-20

I wouldn't use it as a textbook, although some people claim to have done that. I think of it as the ultimate reference. Over the years, previous editions have been my "go-to" book when I want to refresh my memory about some C++ feature.

Depending on your learning style, you might also consider https://www.amazon.com/dp/020170353X/?tag=pfamazon01-20 by Koenig and Moo. Its strong point is in learning how to use the standard "containers" in the C++ standard library, or what many books still call the "STL" (Standard Template Library): vectors, lists, etc. instead of plain old arrays. It's all based on one or two examples which are developed progressively in succeeding chapters, instead of using free-standing examples in each chapter. So it's best read through (and worked through) from beginning to end, which isn't good if you like to jump around depending on which topic catches your fancy at the moment.
 
Last edited by a moderator:
trollcast said:
I'm trying to learn C++ at the minute and I've managed to get over the basics, I/O, Conditionals, Repetition up to and a bit of pointers.

Now what I'm wondering is should I get a textbook that is solely on C++, eg. Barjne Soustroups one, and learn specifically C++.

Or learn by doing problems on places like Project Euler and prehaps maybe a book on another topic that's written in C++, specifically something like this: https://www.amazon.com/dp/032144146X/?tag=pfamazon01-20 , and learn from the code examples and practice?

Trying to learn C++ by doing Project Euler is going to discourage you quite a bit. It's not an easy task. Project Euler is very difficult (at least it was for me). It requires better knowledge in math than it does programming, and I'm the other way around.
 
Last edited by a moderator:

Similar threads

Replies
86
Views
3K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 133 ·
5
Replies
133
Views
13K
Replies
69
Views
11K
  • · Replies 15 ·
Replies
15
Views
4K
  • · Replies 397 ·
14
Replies
397
Views
22K
  • · Replies 10 ·
Replies
10
Views
4K
  • · Replies 7 ·
Replies
7
Views
1K
  • · Replies 16 ·
Replies
16
Views
3K
  • · Replies 9 ·
Replies
9
Views
2K