tags:

views:

344

answers:

5

Possible Duplicate:
Why artificially limit your code to C?

I started off with learning C, but then jumped straight into C++ simply because it supports OO and was also required for subsequent work. However, some companies insist on employing people with particularly strong C experience - and I've noticed this applies especially to hardware driver development companies.

+3  A: 

It could simply be that they do not have a C++ compiler for the platform they are working with... Personally I would always use C++ in preference to C.

Martin Milan
+1  A: 

C is much more portable - under the current level of standardization of C++, it simply can't be used when portability is important. It is also very hard for C++ code to be integrated (in a reliable and portable manner) into a C environment.

Ofir
+1  A: 

C string handling is very different than C++ typical string code. Certainly I wouldn't want any C++ string near my drivers!

More specifically, in good, modern C++ you don't really have to understand pointers and handle buffers at low level; but these are basic and crucial skills in device driver code.

Yes, it's possible to write good drivers in C++; but that C++ would really look like C with a few extra features. Most of the C++ library has no place in deviceland.

Javier
+1  A: 

A lot of embedded systems such as microcontrollers, PLCs, etc use C and not C++ because they don't need to have classes just one giant loop with some functions sprinkled about. Nothing fancy but enough to get the job done in a higher-level language. Since C is more familiar to people than assembly, it works well in ~98% of cases.

0A0D
A: 

I think that the reason is fairly simple, a lot of companies want efficient readable code. C is a fairly easy language to understand and grasp, and for many uses there is no reason to complicate development and code continuity by adding whole new concepts (classes, polymorphism, inheritance, etc) that OO languages make possible but may not be needed.

Hortinstein