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

  • Thread starter Thread starter Hacker Jack
  • Start date Start date
AI Thread 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.
  • #51
And in fact, anti-missile software did mistakenly shoot an Iranian passenger airliner down once, and the government tried to deny it at first but had to admit it had happened. Tragic. And it could easily have started a war.
 
Technology news on Phys.org
  • #52
harborsparrow said:
Well--@yungman--you should have read the report in the 1980's when several of the Bell Labs engineers had to rush to testify before the U S Congress to try and get them NOT to build lazers that could shoot things from space. Bell Labs had officially lobbied for the project because the company stood to get a lot of money out of it, but the engineers rebelled and essentially told Congress: "Are you effing out of your MINDS?" And cited all the rockets going off course and blowing up in the early days of space travel due to programming errors, and all the ongoing failures in software, and the absolute dumbness that it would take to trust software not to shoot at the wrong thing etc. But funding finally did that project in, not wisdom. Thank goodness it never happened.
I actually don't mind that, like I said, I don't mind problems with computers and windows as they have to change and keep up with times, avoid virus hacking and all that. That to me, it's understandable. But I don't want my appliance to do that, appliance is not for adventure for me particularly it's not getting better since 4 years ago, why they can do it up to 4 years ago and just go to hell. Something just is not right. My 65" Samsung is a smart tv, not that it's primitive. My 2014SUV have all the smarts as the 2018, just less mouse pads to screw things up accidentally. Far as I concern, the newer printers don't do anything more than the 4 year old ones, they all do duplex printing, scanning and copying. So where's the improvement? Getting slower to train your patience? That's what bugs me.

You always have bugs when things first come out, takes time to perfect the product. Problem is the life cycle is so short you don't have time to fix anything, instead hoping the next model will fix the old problem...then introduce the new set of problems.
 
  • Like
Likes harborsparrow
  • #53
harborsparrow said:
And certain other features such as operater overloading might as well, in my experience, be academic toys. Because in complex real-world code, I have never seen a good reason to do anything like that, and I would in fact advise against using things like operator overloading (without a strong compelling reason, which I did not encounter--one may exist though) because--think of someone coming along ten years later, trying to fix a big hunk of unknown code, and not knowing immediately that the operator has been overloaded.
Some standard containers, such as std::map and std::set, require that the type stored in the container be comparable using "<". If you want to use these containers with your own types, that's one obvious situation where operator overloading is needed. It's certainly not just an academic toy; it's commonly used in every large C++ code base that I've worked on, most of which are commercially shipped products running in hundreds of millions of phones.
 
  • Informative
Likes harborsparrow
  • #54
My background is odd, unlikely. Maybe everyone's is. I learned C (and started learning C++) because I got a job in 1984 at Bell Labs and they told me to. Before that, I had done a little Fortran, Snobol, Pascal, and some assembler. I had designed a little hardware and a bit-slice microprocessor. I was interested in technology and had repaired telephone switchboards for a couple of years (my first exposure to a "computer" actually), I had studied radio engineering, and I had worked on the software and hardware for the very first Positron Emission Technology (PET) scanner ever built, but mostly I had been living in poverty. I was lucky enough to claw through public college with a combination of scholarships, work study, and assistantships, working side jobs in factories and restaurants, borrowing textbooks, and not owning a car. I was motivated by fear of being 40 years old if I did not find a profession that would earn a living wage.

I could easily have ended up homeless, and I still feel enormous compassion for people who do.

At Bell Labs, I knew I had been hired to fill a quota (being female), not because they thought I would be the best choice. But I found enough generous mentoring to become as good as I needed to be. I would say that there, I soon became slightly above average in performance, not a star, and it was definitely the school of hard knocks. You don't even want to know some of the gender discrimination that I encountered, and it didn't matter all that much because I had been raised among boys and I could take it. I did take it and survived, if not thrived.

I typically spent at least half my waking hours learning new stuff, and I didn't always do exactly as expected in small things, but I usually got the needed results on time, if in some unorthodox way. When I did fail at something, I agonized, because I often could not easily tell whether I had truly failed through stupidity or whether the deck had been stacked against me. Eventually, I got mad enough about that to accept that it was impossible to know for sure.

For years, I have kept a daily log of what I got done. I used to keep it in a notebook, and now I keep it in a wiki. I look at this log when I am discouraged, to give myself the courage to go on. An old telephone repairman gave me the advice to keep this log. He said it would be useful when management tried to blame me for "dang", as he called it. It has served me well, and I'll pass that along to any young people who ever read this. The log consists of one single line describing something I completed. Okay, maybe, occasionally 2 lines.

I lasted a dozen years at Bell Labs as it slowly downsized. Two years of microprocessor programming for consumer products (some 4-bit chip). Two years of C programming for SONET systems on Motorola 68000 controllers. I learned to make a PC do polling instead of interrupts, so that I could guarantee nothing would ever block. I learned weird realtime tricks like software debouncing for a shared memory item. They tried to teach me C++ but I hated it. After that, I got shunted into writing requirements for transmission and network operations systems. As @yungman noted, the "software" profession requires one to constantly learn the latest new thing, and it was always one huge crap shoot to see if I had chosen the right new language to learn to keep myself employed. I embraced the WWW. I liked Microsoft and bought and studied PC's although Bell Labs officially hated it. I made enemies there by solving problems quickly on Windows that were going to take two years to solve using UNIX. I left Bell Labs after a dozen years and became an independent consultant. I negotiated my own contracts, worked short term jobs for high pay, and kept moving here and there. I worked in big pharma until 9-11 shook the world up. Jobs in software got very lean in the early 2000's due in part to outsourcing, and I became a college professor (non tenured) and that lasted for about 10 years. I taught computer architecture to grad students, Java programming (had to learn it myself first, and quickly), and software engineering. I learned Ruby and various other programming languages so that I could teach them. After that, I worked for biologists where I was the only programmer, sysadmin, web developer, chief cook and bottle washer. Became good at database design and programming (mentored by biologists who are fearless about databases and statistics). The pay was low but the work was interesting and my boss sometimes actually said thank you. Around 2010, I refused to commute any more and started working remotely from home, which I loved. My boss snuck around and allowed it because he didn't want to lose me. So the pandemic hasn't bothered me as much as it has some people; my home office was already in good shape.

My formal training was to program close to the metal--and I liked it and was good at it @yungman--but I left it behind because the level of gender harassment in that field was just not worth putting up with. Over the years, I kept clawing my way back to actually writing code. I have worked extensively with both Linux and Windows whereas most programmers ever only learn one . This became an advantage. I would string things together to make something happen that could only be done using four different technologies at once, or I would get something done by some unorthodox approach that no one else thought would work.

I stayed employed, but I had to take what was available to me, not particularly what I wanted. Many good technologists left the field during those bad economic downturns. I only know maybe two women my age who survived in the tech trenches throughout their entire lives. I am proud to have survived. I grew to like the work and be good at it, but unfortunately, most of the people who are in my day to day life have no idea what I have accomplished. They look down on me because I am not a good quilter or a good whatever that women are expected to be good at, and they don't see or appreciate my accomplishments. That frustrates me sometimes.

So that's my war story.

I've enjoyed reading your war stories. Keep them coming.
 
Last edited:
  • Like
  • Love
Likes yungman, Mark44 and Jarvis323
  • #55
jbunniii said:
Some standard containers, such as std::map and std::set, require that the type stored in the container be comparable using "<". If you want to use these containers with your own types, that's one obvious situation where operator overloading is needed. It's certainly not just an academic toy; it's commonly used in every large C++ code base that I've worked on, most of which are commercially shipped products running in hundreds of millions of phones.

Good to know! Since I never properly learned C++, I didn't learn this before.
 
  • #56
harborsparrow said:
My background is odd, unlikely. Maybe everyone's is. I learned C (and started learning C++) because I got a job in 1984 at Bell Labs and they told me to. Before that, I had done a little Fortran, Snobol, Pascal, and some assembler. I had designed a little hardware and a bit-slice microprocessor. I was interested in technology and had repaired telephone switchboards for a couple of years (my first exposure to a "computer" actually), I had studied radio engineering, and I had worked on the software and hardware for the very first Positron Emission Technology (PET) scanner ever built, but mostly I had been living in poverty. I was lucky enough to claw through public college with a combination of scholarships, work study, and assistantships, working side jobs in factories and restaurants, borrowing textbooks, and not owning a car. I was motivated by fear of being 40 years old if I did not find a profession that would earn a living wage.

I could easily have ended up homeless, and I still feel enormous compassion for people who do.

At Bell Labs, I knew I had been hired to fill a quota (being female), not because they thought I would be the best choice. But I found enough generous mentoring to become as good as I needed to be. I would say that there, I soon became slightly above average in performance, not a star, and it was definitely the school of hard knocks. You don't even want to know some of the gender discrimination that I encountered, and it didn't matter all that much because I had been raised among boys and I could take it. I did take it and survived, if not thrived.

I typically spent at least half my waking hours learning new stuff, and I didn't always do exactly as expected in small things, but I usually got the needed results on time, if in some unorthodox way. When I did fail at something, I agonized, because I often could not easily tell whether I had truly failed through stupidity or whether the deck had been stacked against me. Eventually, I got mad enough about that to accept that it was impossible to know for sure.

For years, I have kept a daily log of what I got done. I used to keep it in a notebook, and now I keep it in a wiki. I look at this log when I am discouraged, to give myself the courage to go on. An old telephone repairman gave me the advice to keep this log. He said it would be useful when management tried to blame me for "dang", as he called it. It has served me well, and I'll pass that along to any young people who ever read this. The log consists of one single line describing something I completed. Okay, maybe, occasionally 2 lines.

I lasted a dozen years at Bell Labs as it slowly downsized. Two years of microprocessor programming for consumer products (some 4-bit chip). Two years of C programming for SONET systems on Motorola 68000 controllers. I learned to make a PC do polling instead of interrupts, so that I could guarantee nothing would ever block. I learned weird realtime tricks like software debouncing for a shared memory item. They tried to teach me C++ but I hated it. After that, I got shunted into writing requirements for transmission and network operations systems. As @yungman noted, the "software" profession requires one to constantly learn the latest new thing, and it was always one huge crap shoot to see if I had chosen the right new language to learn to keep myself employed. I embraced the WWW. I liked Microsoft and bought and studied PC's although Bell Labs officially hated it. I made enemies there by solving problems quickly on Windows that were going to take two years to solve using UNIX. I left Bell Labs after a dozen years and became an independent consultant. I negotiated my own contracts, worked short term jobs for high pay, and kept moving here and there. I worked in big pharma until 9-11 shook the world up. Jobs in software got very lean in the early 2000's due in part to outsourcing, and I became a college professor (non tenured) and that lasted for about 10 years. I taught computer architecture to grad students, Java programming (had to learn it myself first, and quickly), and software engineering. I learned Ruby and various other programming languages so that I could teach them. After that, I worked for biologists where I was the only programmer, sysadmin, web developer, chief cook and bottle washer. Became good at database design and programming (mentored by biologists who are fearless about databases and statistics). The pay was low but the work was interesting and my boss sometimes actually said thank you. Around 2010, I refused to commute any more and started working remotely from home, which I loved. My boss snuck around and allowed it because he didn't want to lose me. So the pandemic hasn't bothered me as much as it has some people; my home office was already in good shape.

My formal training was to program close to the metal--and I liked it and was good at it @yungman--but I left it behind because the level of gender harassment in that field was just not worth putting up with. Over the years, I kept clawing my way back to actually writing code. I have worked extensively with both Linux and Windows whereas most programmers ever only learn one . This became an advantage. I would string things together to make something happen that could only be done using four different technologies at once, or I would get something done by some unorthodox approach that no one else thought would work.

I stayed employed, but I had to take what was available to me, not particularly what I wanted. Many good technologists left the field during those bad economic downturns. I only know maybe two women my age who survived in the tech trenches throughout their entire lives. I am proud to have survived. I grew to like the work and be good at it, but unfortunately, most of the people who are in my day to day life have no idea what I have accomplished. They look down on me because I am not a good quilter or a good whatever that women are expected to be good at, and they don't see or appreciate my accomplishments. That frustrates me sometimes.

So that's my war story.

I've enjoyed reading your war stories. Keep them coming.
You should write a book, or at least a medium article or something.
 
  • Like
  • Wow
Likes yungman and harborsparrow
  • #57
Old timer here. Started programming Fortran IV and assembly and some APL back in 1968 (in high school). Got my first job in 1973, mostly assembly on a multi-computer | multi-tasking database server (using six HP 2100 mini-computers), with some Fortran used for offline processing. In 1975 and later, it was still mostly assembly for work, while using Fortran and APL on an IBM 370 at a local community college where I was helping students. I didn't learn C until 1985 when I got an Atari ST. My first experience with C++ started with Programming Windows 3.1 by Charles Petzold. An interesting thing is how little has changed in the basic Windows API since then. My career mostly involved operating systems for mini-computers and later embedded systems, mostly C with some assembly, so my experience with C++ was for personal use or to help others. I'm still using versions of Visual Studio (2005 to 2019) for C, C++, and C# with Windows (XP, 7, 10).

- - - other languages - - -

I use NetBeans / Java to help people asking questions in a few forums. I don't like Java's lack of functionality for native types or worse yet, it's native linked list, native linked list iterators, and no way to move nodes within or between lists (no equivalent to C++ std::list::splice()). I also use Python to help at some forums. My main complaint is how slow it is. Unless 80% or so of a Python program uses the libraries built with compiled languages, I don't see much of a practical use for it.

Some of my hardware type co-workers use Visual Basic, since it has a drag and drop interface for creating user interfaces, such as real time graphs, bar charts, general information displays, used with code they added for monitoring hardware during development. Other co-workers used Matlab for math problems, which would be converted to C if it was going to be used in an embedded device.
 
Last edited:
  • Like
Likes harborsparrow and Mark44
  • #58
harborsparrow said:
My background is odd, unlikely. Maybe everyone's is. I learned C (and started learning C++) because I got a job in 1984 at Bell Labs and they told me to. Before that, I had done a little Fortran, Snobol, Pascal, and some assembler. I had designed a little hardware and a bit-slice microprocessor. I was interested in technology and had repaired telephone switchboards for a couple of years (my first exposure to a "computer" actually), I had studied radio engineering, and I had worked on the software and hardware for the very first Positron Emission Technology (PET) scanner ever built, but mostly I had been living in poverty. I was lucky enough to claw through public college with a combination of scholarships, work study, and assistantships, working side jobs in factories and restaurants, borrowing textbooks, and not owning a car. I was motivated by fear of being 40 years old if I did not find a profession that would earn a living wage.

I could easily have ended up homeless, and I still feel enormous compassion for people who do.

At Bell Labs, I knew I had been hired to fill a quota (being female), not because they thought I would be the best choice. But I found enough generous mentoring to become as good as I needed to be. I would say that there, I soon became slightly above average in performance, not a star, and it was definitely the school of hard knocks. You don't even want to know some of the gender discrimination that I encountered, and it didn't matter all that much because I had been raised among boys and I could take it. I did take it and survived, if not thrived.

I typically spent at least half my waking hours learning new stuff, and I didn't always do exactly as expected in small things, but I usually got the needed results on time, if in some unorthodox way. When I did fail at something, I agonized, because I often could not easily tell whether I had truly failed through stupidity or whether the deck had been stacked against me. Eventually, I got mad enough about that to accept that it was impossible to know for sure.

For years, I have kept a daily log of what I got done. I used to keep it in a notebook, and now I keep it in a wiki. I look at this log when I am discouraged, to give myself the courage to go on. An old telephone repairman gave me the advice to keep this log. He said it would be useful when management tried to blame me for "dang", as he called it. It has served me well, and I'll pass that along to any young people who ever read this. The log consists of one single line describing something I completed. Okay, maybe, occasionally 2 lines.

I lasted a dozen years at Bell Labs as it slowly downsized. Two years of microprocessor programming for consumer products (some 4-bit chip). Two years of C programming for SONET systems on Motorola 68000 controllers. I learned to make a PC do polling instead of interrupts, so that I could guarantee nothing would ever block. I learned weird realtime tricks like software debouncing for a shared memory item. They tried to teach me C++ but I hated it. After that, I got shunted into writing requirements for transmission and network operations systems. As @yungman noted, the "software" profession requires one to constantly learn the latest new thing, and it was always one huge crap shoot to see if I had chosen the right new language to learn to keep myself employed. I embraced the WWW. I liked Microsoft and bought and studied PC's although Bell Labs officially hated it. I made enemies there by solving problems quickly on Windows that were going to take two years to solve using UNIX. I left Bell Labs after a dozen years and became an independent consultant. I negotiated my own contracts, worked short term jobs for high pay, and kept moving here and there. I worked in big pharma until 9-11 shook the world up. Jobs in software got very lean in the early 2000's due in part to outsourcing, and I became a college professor (non tenured) and that lasted for about 10 years. I taught computer architecture to grad students, Java programming (had to learn it myself first, and quickly), and software engineering. I learned Ruby and various other programming languages so that I could teach them. After that, I worked for biologists where I was the only programmer, sysadmin, web developer, chief cook and bottle washer. Became good at database design and programming (mentored by biologists who are fearless about databases and statistics). The pay was low but the work was interesting and my boss sometimes actually said thank you. Around 2010, I refused to commute any more and started working remotely from home, which I loved. My boss snuck around and allowed it because he didn't want to lose me. So the pandemic hasn't bothered me as much as it has some people; my home office was already in good shape.

My formal training was to program close to the metal--and I liked it and was good at it @yungman--but I left it behind because the level of gender harassment in that field was just not worth putting up with. Over the years, I kept clawing my way back to actually writing code. I have worked extensively with both Linux and Windows whereas most programmers ever only learn one . This became an advantage. I would string things together to make something happen that could only be done using four different technologies at once, or I would get something done by some unorthodox approach that no one else thought would work.

I stayed employed, but I had to take what was available to me, not particularly what I wanted. Many good technologists left the field during those bad economic downturns. I only know maybe two women my age who survived in the tech trenches throughout their entire lives. I am proud to have survived. I grew to like the work and be good at it, but unfortunately, most of the people who are in my day to day life have no idea what I have accomplished. They look down on me because I am not a good quilter or a good whatever that women are expected to be good at, and they don't see or appreciate my accomplishments. That frustrates me sometimes.

So that's my war story.

I've enjoyed reading your war stories. Keep them coming.
I don't even want to pretend I can understand what you went through because I’m a male, I went through a little bit similar as I am a Chinese, back in the days in the 70's and 80's, I did feel some discrimination. But my burning love for electronics just couldn't let that even hinder me. Whatever they told me to do, I did more. Like I was a test tech, I was supposed to only test the boards, I started writing some tiny assembly programs to test the hardware. They recognize that and gave me more. That's how I keep moving up. In 91, I want to become the manager of EE. I felt there was some discrimination, I did a good job in designing, but never been a manager. The discussion got quite bad and we had to go to personnel office to resolve the issue. I ask them what do I have to do to become the manage? They told me what they want to see me doing. I did it. I got the promotion. One thing in life I learn, you don't get what you deserve from others for different reasons, not all are discrimination, it can be laziness on their part and don't want to rock the boat. I always work hard, but I DEMAND recognition... in form or raise and promotion. I don't sit there waiting for them to reward me. Other than being promoted to EE in 1980, I asked for every raise and every promotion.

I hope you don’t get offended, my point is do a good job, then speak up and demand what you deserve, don’t wait for them to recognize you and don’t spend any time thinking about gender discrimination. My wife is the same way like me, she worked for the federal government in AFDC and Childcare, she only had HS education, she moved her way up to grade 12 through hard working in AFDC. She saw an opening in Childcare that was a grade 13. That’s around the time I was fighting to get the manager of EE position. We talked and I encourage her to go for it and talk to the regional administrator. She did, it’s funny I cheered her on and she cheered me on. She got some resistance also, but she really spoke up, finally they put her in a temporary position for 3 months saying that she was going to go back to AFDC, it’s only temporary. She worked her heart out. She got to stay and become permanent and promoted to grade 13. That’s the highest grade without being a manager usually people have master degrees. Point is, ASK, all they can say is no! I am surprised though, we have women programmers, nobody make anything out of it, we just work together get the job done. It's engineering that has fewer women, I blame it on the old generation kept giving dolls to the girls and teaching them how to cook and sew! Read the next paragraph.

When come to gender, I keep encourage my little girl (grand daughter) to learn science, math and CS. I want her to grow up with all these instead of cooking, sewing and all that. My wife is old school, little girl’s parents are not that educated. They all keep concentrating on English, writing and all that. I am the only one that kept talking about science, engineering, CS. I even bought an electronic kit for kids and played with her like 2 years back, taught her about AND, NAND, OR, NOR truth table. I am willing to learn Python if she have interest in it now so we can actually play together. I believe women can do everything a man do. It's just the old generation type cast them, automatically give girls a doll, learn cooking and sewing. The hell with that. I want my little girl to be strong, knowledgeable. I taught her how to use tools like screw driver, pliers, socket wrenches and all when she was like 8 or 9! Just a little exposure at a time.

Hell, I even want her to be strong physically. I play sparing(no contact punching and kicking) on and off, make her get used to block, duck and punch. Stupid mother made her wasted so much time learning ballet and she just didn’t like it. Finally my little girl gather the courage ( through my moral support) to tell mommy she didn’t want to take it anymore! I tried to encourage her to take martial arts. I don’t want any man to kick her around. Hell, nobody kick my little girl around! That, I am still working on it. I have been “brain washing” her by kept talking how important to study math, have to take at least two semester of calculus even she end up in business school. BUT I told her without any doubt, don’t listen to what I said, choose the career she want, I just want her to have all the tools so she can be ready for anything. She is getting straight A’s and awarded student of the year twice the last two years. I am so proud of her. She’s coming over today to stay with us for two weeks. I am so stoked. She stay with us on average like 6 weeks a year.

As for me, I always joking ( serious also) that my wife is the big boss, I only work and get some allowance! It is quite true. We have a rental business and she is running it. She is in charge of our finance, tax, checking and all. I am lucky, I’d be in big trouble without her. I am all for women to be strong. Hey, I am benefited from her being strong, the hell with chauvinistic.( My English is so bad, I had to ask her how to spell chauvinistic!)

funny you mentioned about bit-slice. I so wanted to learn that at the time, didn't get the chance. But they were out pretty fast.
 
Last edited:
  • #59
yungman said:
I hope you don’t get offended, my point is do a good job, then speak up and demand what you deserve,

Ha ha @jungman. I had a good boss for a span of 4 years, and I asked him one year to be promoted, and he told me (and he always told me the absolute truth as far as I could tell): "Sorry, I can't get you promoted, but it has nothing to do with you. The last time the managers had a promotion meeting, I vetoed the promotion of (so-and-so), and his supervisor was angry at me and told me he would never support any of my candidates for promotion again." And I knew the so-and-so who my boss had refused to promote, and I understood that it was important that he had vetoed the promotion of that particular person. And so I just laughed and said, "Okay". And that was the only time I tried to get promoted within that corporation. The rest of the time, I knew there was no hope for various reasons. I really didn't want to be a manager there anyway, because they were mostly snakes.

Further, because I never had formal power, I developed a number of sideways ways of exercising power, influencing people, delegating work to others when I was overloaded, and working around people who were roadblocks. Over time, I think I became reasonably facile at all that, and those skills were more important to me personally than being the boss.

The ONE thing that gender really, truly cost me was that I was never paid equally. Bell Labs forbid people to tell their salaries, but I would always get some of the men to tell me anyway on the sneak, and I was often paid about 20 to 30% less than my peers even though, in several cases, I'm pretty sure I was far more productive and helpful than they were.

When I was a consultant, I asked for what I was worth. It was only a few years, but I proved to myself that it was possible to be paid what I was worth. It required a lot of hard nosed, cold negotiation at the time, and it required walking away from some opportunities that looked like I would really enjoy them, but if they wouldn't pay, I decided I would just go to the beach. Best decision I ever made. Maybe I'm delusional but I made sure that I was always worth what I was paid. That way, I could sleep well at night.

The next best decision I ever made was to work for less money near the end of my career--for the biologist--because it was peaceful and less cut-throat and the work was interesting as all hell and I had a good boss. Money is not everything.

I also once turned down a very high paying job because it was making missiles. They didn't call them missiles, they called them something odd like "autonomous flying vehicles", but it was before drones, and they showed a film and it was ballistic missiles, and I didn't want to be part of that. I knew other people were going to do it, but I just didn't want that on my conscience to work on anything that I knew would be used to kill.
 
Last edited:
  • #60
Vanadium 50 said:
Seriously, multiple inheritance is one of those ideas that looks great on paper, but not so good in real life. The advantages tend to be small or speculative, [...]
I'm surprised to find a point on which I totally disagree with you (since this is quite rare).

In a prehistoric age, I was working on a project when only single inheritance was available and I felt quite restricted and frustrated. As soon as I got a beta copy of the AT&T C++ compiler with MI implemented, I felt extremely liberated.

but the issues - including the Diamond of Death (just like on ski slopes, the diamond should serve as a warning) - tend to be very real.
The C++ design principle that "ambiguities are illegal" solves (imho) the so-called Diamond of Death problem. If there is an ambiguity as to which parent class method should be called, the user must qualify explicitly. I never had any problem with that.
 
  • Informative
Likes harborsparrow
  • #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
  • #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.
 
Back
Top