rapidcoder wrote: |
---|
You have a C project - just hire C programmers and you are done - they can immediately start hacking. |
Great quote. The "easy to find" programmers are indeed hack jobs. It's just as hard to find a competent C programmer as a competent C++ programmer.
To answer the OP
crazy frag wrote: |
---|
What are the cases when we should use C or Assembly over C++ ? |
Normally, you would use C and not C++ when:
1. the project already has or expects a C language code base: POSIX-compatible OS kernel, typical (especially Linux-related) open-source software, general-purpose software that existed for the last 20 years, etc.
2. the project's target platform only has C compilers available. Even though C++ is more portable that C in theory (I'm serious), writing a C++ compiler is a high-cost job, so in practice C++ compilers are not available for many non-mainstream platforms.
3. the project's requirements need little besides interfacing the hardware (the "portable assembler" case) - some device drivers and firmware projects fall in this category. That's the kind of jobs C was meant for.
You use assembly languages instead of C or C++ when
1. The target platform has no C compiler or the overhead of C is unacceptable (e.g. you're writing a 256-byte demo)
2. The existing compilers do not meet your requirements (e.g. fail to utilize the available instruction set or fail to optimize efficiently)