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

  • Thread starter Thread starter Hacker Jack
  • Start date Start date
Click For Summary
Bjarne Stroustrup's "Programming Principles and Practice" serves as a foundational text for beginners learning C++, though its complexity can be challenging due to its advanced language and writing style. Users often find that transitioning from procedural programming in C to object-oriented programming in C++ is difficult, particularly with concepts like manual memory management and the intricacies of the language. Many learners express a desire for more modern, accessible resources, with some suggesting alternatives like Python for beginners. Practical experience through coding is emphasized as essential for truly understanding C++, as theoretical knowledge from books alone may not suffice. Overall, while C++ is recognized as a powerful language, its steep learning curve can lead some to reconsider their choice of first programming language.
  • #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 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 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 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
1K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 15 ·
Replies
15
Views
3K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 397 ·
14
Replies
397
Views
19K
Replies
16
Views
3K
  • · Replies 15 ·
Replies
15
Views
3K
  • · Replies 6 ·
Replies
6
Views
3K
Replies
5
Views
7K