Answer the question
In order to leave comments, you need to log in
Why don't STMs use classes in programming?
I have been programming for a long time (I also create websites, wrote programs for the desktop, and for mobile phones, I also programmed PIC and arduino). Now I decided to study a series of STM microcontrollers. And having reviewed a bunch of examples (including those with a claim to professional style) of the code, I noticed that very few people use classes. I wanted to know what caused this or is it just a “tradition” like that.
Answer the question
In order to leave comments, you need to log in
OOP - speeds up development, but you have to pay for it in memory and speed. Therefore, in microcontrollers, where there is little memory and the speed of code execution is important, classes are very rarely used.
Dynamic memory handling within Embedded is not a very reliable thing. If memory cannot be allocated on the computer, it will simply reboot and that's it. For responsible embedded systems, this behavior is unacceptable. This time.
Second. The vast majority of libraries/OS are written in pure C. Classes are already C++. Mixing this business is not very good (this is a purely subjective point of view).
Third. About limited memory. She's stupidly small.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question