Hello All,
So far, I have been writing code for ARM Cortex M7 (STM32F7691) using C language. But I am planning to write more structured, OOPS style coding for my next application. And so, I am thinking about using C++ instead of C. Please let me know the following,
1. What will be the performance difference and also the final code size (excluding the programmer's skills )?
2. Does arm cortex m7 has good c++ compiler?
3. Specifically, Does OOPS methodology causes performance overheads?
Thank you.
Hi,
1) Overhead depends on the functionalities you want to use in C++(exceptions..). Be careful with template/generic programming, as it adds a lot of code in your back. . Some libraries are HUGE and slow(ish) ,like Boost. You will find so much info searching for c vs c++.
OOP for C has been done but not as powerful/clean as C++ IMHO.
2) Kind of. Gcc is old on ARM. But manages to create ok code.
3) Memory proximity, indirect pointers (virtual classes) can cause performance overhead. There will be space overhead too in the resulting binary in C++ because more information has to be carried.
So, if your board can take it and you want it, go for it. Otherwise, stick with C.. or your own language :)