5

My question is this, why do people still use C when they have C++? I've studied C because it is considered the language on which programmers communicate and is recommended for any programmer to know. I've then passed to C++ and I now think, why do people still use and program in C? As far as I see, C++ is more powerful (has OOP aspects in it), it is as fast as C and overall just seems to be better. I've seen people dislike C++ because it is too hard to code in.

Vadiklk
  • 3,696
  • 5
  • 28
  • 44

2 Answers2

13

C is much simpler, and more fun to program in.

But what's more, the compiler is much much easier to write so there are still lots of environments where you can either only get a C compiler or the C++ compiler is far inferior (buggy, slower, generates bloated binaries).

Makis
  • 12,468
  • 10
  • 62
  • 71
  • 11
    "More fun" is subjective here - I personally think it's more pain. – sharptooth Mar 11 '11 at 09:24
  • 5
    +1 for the point about the compilers. People who've only used the big, mature compilers like MSVC and GCC don't realise what the long-tail of crappy embedded toolchains looks like - a vendor who can barely manage a C compiler in 2010 is not going to be somebody you'd want to go to for a C++ compiler. – Will Dean Mar 11 '11 at 09:25
  • @sharptooth: of course it was subjective, but then again it's a valid reason in my opinion. – Makis Mar 11 '11 at 21:48
6

C is often used for hardware programming, some microcontrollers and similar hardware often have a compiler which turns C code into native instructions for it. It makes programming those pieces of hardware much simpler than writing raw assembly.

Argote
  • 2,155
  • 1
  • 15
  • 20