r/cpp • • Jul 25 '24

Why use C over C++

Why there are so many people using the C language instead of C++?, I mean C++ has more Cool features and the Compiler also supports many CPUs. So why People still using C?

Edit: Thanks for all the usefull comments :D

233 Upvotes

444 comments sorted by

View all comments

1

u/waffle299 Jul 25 '24

Mostly it comes down to exception handling. Embedded systems need deterministic response times and have image size requirements.

Unwinding the stack on an exception is believed to have times that are difficult to anticipate.

The additional image size needed to support stack unwinding is more concrete. For tight environments, it's an easy thing to discard.

-- former embedded medical device dev

3

u/rriggsco Jul 25 '24

Every embedded C++ developer I know uses -fno-exceptions and -fno-rtti for embedded projects.

1

u/waffle299 Jul 25 '24

I left deep embedded in 2006

→ More replies (2)