Author Topic: Yet another post about using C++ in embedded system  (Read 1066 times)

0 Members and 1 Guest are viewing this topic.

Offline YTusernameTopic starter

  • Regular Contributor
  • *
  • Posts: 83
  • Country: tr
    • Atadiat
Yet another post about using C++ in embedded system
« on: January 27, 2019, 10:29:40 pm »
Hello All

I just finished reading a great book that addresses a lot of points of using C++ in embedded system. So I decided to write what is not really a technical article rather than a review of a great book that has the answer to “Should we hate or love C++?”

https://atadiat.com/en/e-embedded-c-developers-hate-or-love-cpp/

Comments are most welcomed
 

Offline 0xdeadbeef

  • Super Contributor
  • ***
  • Posts: 1575
  • Country: de
Re: Yet another post about using C++ in embedded system
« Reply #1 on: January 27, 2019, 10:48:16 pm »
I'd say it depends. For very large project, where realtime and code/RAM size are not of utter importance, I'd say object orientation of C++ might have certain benefits.
For small scale applications, low level stuff or very high realtime requirements, I'd personally stay away from C++.

One more thing to consider:
Any high level language feature creates additional code that makes runtime/memory consumption less predictable, might cause data consistency issues and makes debugging harder.
I.e. even in C, things like structs should be handled carefully, as structs can be copied using the "=" operator and passed as as parameters or return values on the stack. So there's a heap of additional code created for something that looks like nothing at all. Now in C++ thinks like operator overloading might make the code look much cleaner but create lots of code on opcode/assembler level that doesn't match the C source. So debugging issues becomes much harder.
Trying is the first step towards failure - Homer J. Simpson
 
The following users thanked this post: YTusername


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf