▲ | estimator7292 4 days ago | |||||||||||||||||||||||||||||||
Have you written significant amounts of C or C++? Most people don't write C, nor use the C compiler, even when writing C. You use C++ and the C++ compiler. For (nearly) all intents and purposes, C++ has subsumed and replaced C. Most of the time when someone says something is "written in C" it actually means it's C++ without the +± features. It's still C++ on the C++ compiler. Actual uses of actual C are pretty esoteric and rare in the modern era. Everything else is varying degrees of C++. | ||||||||||||||||||||||||||||||||
▲ | QuiEgo 4 days ago | parent | next [-] | |||||||||||||||||||||||||||||||
Sending out a strong disagree from the embedded systems world. C is king here. (Broad, general, YMMV statement): The general C++ arc for an embedded developer looks like this: 1.) discover exceptions are way too expensive in embedded. So is RTTI. 2.) So you turn them off and get a gimped set of C++ with no STL. 3.) Then you just go back to C. | ||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||
▲ | rramadass 4 days ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||
Right on the money! Other then hardcore embedded guys and/or folks dealing with legacy C code, I and most folks i know almost always use C++ in various forms i.e. "C++ as a better C", "Object-Oriented C++ with no template shenanigans", "Generic programming in C++ with templates and no OO", "Template metaprogramming magic", "use any subset of C++ from C++98 to C++23" etc. And of course you can mix-and-match all of the above as needed. C++'s multi-paradigm support is so versatile that i don't know why folks on HN keep moaning about its complexity; it is the price you pay for the power you get. It is the only language that i can program in for itty-bitty MCUs all the way to large complicated distributed systems on multiple servers plus i can span all of applications to systems to bare-metal programming. | ||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||
▲ | lelanthran 4 days ago | parent | prev [-] | |||||||||||||||||||||||||||||||
> Have you written significant amounts of C or C++? Yes. > Most of the time when someone says something is "written in C" it actually means it's C++ without the +± features. Those "someone's" have not written a significant amount of C. Maybe they wrote a significant amount of C++. The cognitive load when dealing with C++ code is in no way comparable to the cognitive load required when dealing with C code, outside of code-golfing exercises which is as unidiomatic as can be for both languages. |