Learn C++ with Bjarne Stroustrup's "Programming Principles and Practice" Book

  • Context: C/C++ 
  • Thread starter Thread starter Hacker Jack
  • Start date Start date
Click For Summary

Discussion Overview

The discussion revolves around experiences and challenges in learning C++ using Bjarne Stroustrup's book "Programming Principles and Practice." Participants share their backgrounds, learning methods, and opinions on the complexity of C++ as a first programming language, touching on both theoretical and practical aspects of programming.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested
  • Conceptual clarification

Main Points Raised

  • One participant notes the difficulty of understanding the English language used in C++ literature, suggesting that the terminology is a barrier to learning.
  • Another participant reflects on their transition from C to C++, highlighting the challenges of object-oriented programming and the complexity of the language specification.
  • Some participants express a preference for learning C++ through practical programming rather than solely through books, emphasizing the importance of hands-on experience.
  • There are mentions of the Standard Template Library (STL) and its impact on learning, with one participant stating they moved to Java after its introduction.
  • Several participants question whether C++ is the right first language to learn, with some suggesting Python as a potentially easier alternative.
  • Concerns are raised about manual memory management in C++, which can lead to bugs that are difficult for novices to understand.
  • One participant points out the need for a toolchain and IDEs when working with C++, contrasting it with languages like Python or JavaScript.
  • There is a discussion about the length and complexity of the C++20 standard, with one participant noting its extensive page count.
  • Another participant suggests that students should be encouraged to learn multiple programming languages rather than seeking a single "best" language.

Areas of Agreement / Disagreement

Participants express a range of views on the challenges of learning C++, with no consensus on whether it is the best first language. Some agree on the difficulties posed by the language's complexity and terminology, while others advocate for practical programming as a more effective learning method.

Contextual Notes

Participants mention various resources and books, including Gaddis's book as a more accessible alternative. There is also discussion about the differences between learning languages and production languages, indicating a nuanced understanding of programming education.

Who May Find This Useful

This discussion may be useful for beginners considering learning C++, educators looking for insights on teaching programming, and experienced programmers reflecting on their learning journeys.

  • #61
harborsparrow said:
I remember arguing, years ago at Bell Labs, with a designer who wanted to leave in a design that could result in a race condition. "But it will never happen in a million years", was his reply. I considered the guy a total idiot.
Ha! I've had that argument too. Fortunately, I was senior enough that pointing out that the code would run in the real world millions of times more often than in tests was enough to make sense prevail. That, and coming up with an alternate design that avoided the race.

Btw, this reminds me of the recently-learned Brandolini's law. :headbang:
 
  • Love
Likes   Reactions: harborsparrow
Technology news on Phys.org
  • #62
@strangerep thanks for pointing me to Brandolini's law!
 
  • #63
yungman said:
...I don't drive that much particular during this virus, stupid gas car die if you don't drive them or drive short distance. I have to make up reason to take a longer drive every other week to keep them alive.

@yungman we are having exactly the same problem with a 2015 Honda Fit. It dies if not run maybe an hour every week. but the 16-year-old Toyota Camry could sit in the driveway unstarted for 2 months and the battery doesn't run down. I am convinced that it is crappy firmware design, somewhere in the car, draining the battery while it's just sitting there. dumb. bad. it ought to be able to go longer than a week!
 
  • #64
harborsparrow said:
@yungman we are having exactly the same problem with a 2015 Honda Fit. It dies if not run maybe an hour every week. but the 16-year-old Toyota Camry could sit in the driveway unstarted for 2 months and the battery doesn't run down. I am convinced that it is crappy firmware design, somewhere in the car, draining the battery while it's just sitting there. dumb. bad. it ought to be able to go longer than a week!
Possibly this is due to the parasitic current draw of security sensors, which might not be present in your Toyota Camry. It would be interesting to see how large a current draw there is for a car just sitting idle. There might also be sensors that unlock the doors when you come close or press a button on a fob.

I have five motorcycles that I don't ride much this time of year. I have trickle chargers on four of them to keep the batteries charged up. I just bought the fifth one, and it's mostly a pile of parts that I have to put together -- it doesn't even have a battery yet. I also have a trickle charger on a generator, to make sure it will start when (not if) the power goes out.
 
  • Informative
Likes   Reactions: harborsparrow
  • #65
harborsparrow said:
@yungman we are having exactly the same problem with a 2015 Honda Fit. It dies if not run maybe an hour every week. but the 16-year-old Toyota Camry could sit in the driveway unstarted for 2 months and the battery doesn't run down. I am convinced that it is crappy firmware design, somewhere in the car, draining the battery while it's just sitting there. dumb. bad. it ought to be able to go longer than a week!
Check the battery. How old is the battery? I assume 5 years old originally came with the car. I've seen this symptom before that you have to start and drive the car to charge up the battery like this.

Like Mark said, check for leakage, if that's ok, chances are it's the battery. Happened to me twice before already. 5 years is a little short, but I would say 7 to 8 years is about time to change already.

When I said about gas car needed to be driven, I am more referring to the engine needs to be run and oil needs to be circulating, the fuel injector needs to be cycling gas to keep it clean and remove the water condensation etc.
 
  • #66
harborsparrow said:
@yungman we are having exactly the same problem with a 2015 Honda Fit. It dies if not run maybe an hour every week. but the 16-year-old Toyota Camry could sit in the driveway unstarted for 2 months and the battery doesn't run down. I am convinced that it is crappy firmware design, somewhere in the car, draining the battery while it's just sitting there. dumb. bad. it ought to be able to go longer than a week!
I forgot to mention, you said you commute long distance to work, is that on the Fit? Those days I commuted 80 miles a day on my Ford Fiesta, I put 100K miles in like 3 years, the battery died with the exact symptom in less than 4 years. I did not know that, One time I went back to Hong Kong for 2 weeks, I had to have my friend start the car and let it idle every other day. That was stupid. I used to work on cars a lot since, but I don't anymore. I wonder do they have battery tester or something. Ask the gas station. I absolutely don't touch cars for years now, hell, one time I needed to open the hood, I didn't even know where was the release!
 
  • Like
Likes   Reactions: harborsparrow
  • #67
@yungman the battery was replaced in May of this year, and the car has been driven very little since then.
 
  • #68
harborsparrow said:
@yungman the battery was replaced in May of this year, and the car has been driven very little since then.
Then you must have a leak somewhere. What was the reason you replace the battery on the first place?
 
  • #69
harborsparrow said:
@yungman the battery was replaced in May of this year, and the car has been driven very little since then.
That's likely the reason the battery has gone dead. My house is about 5 miles from town, and I have three cars at the moment. I usually take each of them out for at least a trip to town about once a week.
 
  • #70
I don't know of any reason the battery goes dead if not driving that often, that's more for the gas engine. That's the reason I seriously consider buying an all electric car for my next one because I don't have to drive them periodically to keep it alive. We have low mileage on our cars since retirement 15 years ago, our batteries never die as we don't drive that much. My neighbor across the street have a few expensive cars in the garage, he seldom drives them, I never heard he has to charge the batteries. They can sit there for months if it is not drained.

I think in her case, it's either some abnormal leakage or a defective new battery. Since she bought the battery in may, take it back to the place that change the battery and have them test the battery. I am sure they have battery tester. That will eliminate half the possibility.
 

Similar threads

  • · Replies 49 ·
2
Replies
49
Views
4K
  • · Replies 102 ·
4
Replies
102
Views
3K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 15 ·
Replies
15
Views
4K
  • · Replies 8 ·
Replies
8
Views
4K
  • · Replies 397 ·
14
Replies
397
Views
21K
Replies
16
Views
3K
  • · Replies 15 ·
Replies
15
Views
3K
  • · Replies 6 ·
Replies
6
Views
3K
Replies
5
Views
8K