cancel
Showing results for 
Search instead for 
Did you mean: 

Does STM32 use C or C++?

wlee.1
Associate

What are the main differences between using C and C++ for STM32 microcontroller programming? Which language is better suited for different use cases, and what are some factors to consider when choosing between the two for embedded system development?

2 REPLIES 2

Sounds like a homework question..

C++ can be bulkier, and has more demands on dynamic memory allocation.

C++ hides complexity, C forces you to account for it and own it.

C facilitates a lot of bad programmers, with poor habits, C++ forces a more structured and object orientated approach.

Not all people using C have a million global variables with subtly different unique names.

If you can't determine which is suitable for your use case, you probably need more experience.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
S.Ma
Principal

C language is still the most common programming language for embedded microcontrollers.

(beyond embedded, C is still popular, at least by TIOBE index TIOBE Index - TIOBE

The C language spec has evolved, yet compiler adoption to the upgrades takes time.

Comments with "//" is one example.

Most of C++ improvements can be coded in C with less readability (structure with function pointers members....).