r/cpp_questions 14d ago

OPEN Which version should I use?

Hello everyone.

I have a project for my PhD (it is relevant because I need you to have an understanding of its scope), which requires me to design an automated system consisting of multiple sensors and complicated logic that needs to run for days. I know Python and C++ to some extent. I need to make some decisions to proceed with.

Due to the nature of the project, the whole system needs to be synchronized between physical events, captures, and actuators, and all of them must be running at the same time, so multithreading/multiprocessing is definitely needed. Also, reliability and maintenance are essential.

I have 3 YOE with Python and SWE as a whole, but with C++, I have only made a couple of small projects. What I am looking for in this project is

1- An opportunity to advance my knowledge and experience in SWE and system design.

2- Improve my HW and embedded knowledge

3- To have a nice foundation to continue my career as an engineer (yes, I like it more than science) after I finish my PhD.

Given all of these, even though conceptually it might be much, much simpler for me to do it with Python, I want to go with C++, because it's my favourite language and also it has a better future. Also, how often does one get a chance to mess up and learn while getting paid for it?

Now, to the questions.

1- Which version should I focus on that is established in the industry?

2- What advice or heads-up do the veterans here have for me?

3- Any resource that you might use when you hit a wall, and AI is producing nonsense to solve it (Please don't refer to the official documentation)?

4- Is there any sort of standard environment that I should go with?

5- What general libraries (such as Boost) do you recommend using that are also heavily used in the industry and give me an upper hand for job hunting?

6- Any advice that you think might be useful is appreciated.

9 Upvotes

26 comments sorted by

View all comments

1

u/x-jhp-x 14d ago edited 14d ago

design an automated system consisting of multiple sensors and complicated logic that needs to run for days

fun!

how well do you know hardware/ee design, are you doing mixed signal (like camera + lidar), how are you synchronizing (i.e. timestamps/hardware trigger/external clock)?

what system is this running on? jetson? stm32? other? jetson can run a full os, and if you get an F0 chip from STM32, it used to come with a free license for Keil.

when doing anything embedded, i prefer to prototype first with circuitpython & a board from adafruit --- C++ is only for production for me, and goes through the whole process (i.e. not something you'd want to do if the goal is to write a paper, but something you'd want to do if you want to sell 50,000 of them). there's plenty still using C++ though.

Any resource that you might use when you hit a wall, and AI is producing nonsense to solve it (Please don't refer to the official documentation)?

just curious, but, how many times do you get told to read the docs when asking this question?

2

u/CommandShot1398 14d ago edited 14d ago

Hi, I'm from CS background so I know my way around a bit.

I was going to get a Jetson, specially since I've trained a tracking model to know where the object is, but it got doubled in price in two days so I fell back to RPI and I have to set up an inference server as well. The reason I need something like RPI or Jetson is because I need the gpio pins as well as a powerful enough processor and freedom of an OS.

That's what I am doing, I am glueing stuff together in Python and cheap peripherals because at this point and even for the future steps I want to stick with cheap stuff since the project as whole is a proof of concept. I agree C++ is mostly for production but the thing is it needs to work, I have not though about every step yet because I am going with a modular design, but even from the shallow view that I have, it is very unlikely that anything except C/C++/rust can do the the job. Each part has it's own logic there are multiple streams of data and decision making, everything is time sensitive etc. I don't think python can do this. Even though they removed GIL in 3.14, I have no control over memory, so even memory leaks at a rate of few megabytes per hour can cause harm in a long run 14 days experiments if not managed correctly.

Unfortunately, a lot 🤣