I got into a discussion a while back. The company I work at develop under Linux and does so in ANSI C. A lot of benefits could come from moving to C++ as far as design goes I think. Our existing code would just have to get rid of all implicit type casts since C++ is a bit stricter about that and it would compile and run as usual. But I was told that we would never start using C++. The reason was that "Linux developers know C", but it would be very hard to find Linux developers who know C++. Personally I find this kinda strange since I started out by learning C++ on Linux. But it made me curious and I wonder if there are any statistics anywhere or if you could help me get a general feel for the validity in this statement. Would be good for future reference since I have always thought that Linux developers with knowledge in C++ wouldn't be that hard to find, but I could be totally wrong.
A lot of benefits could come from moving to C++ as far as design goes I think.
Probably (depends on who would decide on the design in C++).
Our existing code would just have to get rid of all implicit type casts since C++ is a bit stricter about that and it would compile and run as usual.
It's not that simple. If you changed compiler options (or file extensions) to switch to C++ your code will not compile just like that (you will need to go over it and make changes).
Furthermore, your existing C codebase will make for a poorly-written C++ codebase.
It may also introduce all kinds of subtle bugs that to a seasoned C-thinking developer will be almost impossible to find (sizeof
operator behaves differently for arrays in C and C++ for example but a seasoned C/beginner C++ developer would not even consider that the familiar sizeof
in his code does something unexpected).
The reason was that "Linux developers know C", but it would be very hard to find Linux developers who know C++.
That's not a valid reason (if you make a job-posting online with "looking for C++ Linux developers you should get some good CVs - depending on your offer).
It may be the belief of whoever can make that decision in your company or it may be just an excuse they gave to get rid of you :-\
Here are some of the reasons (against switching) that may actually apply in your case - and that your manager probably considered:
Good C developers often make poor C++ developers (best practices in C++ are completely different and many times opposed to best practices in C. This is a problem because the C++ code looks familiar enough to a C developer that he will think his experience applies to it (and good design decisions in C often make for poor design decisions in C++).
They may even be good C++ developers, but if that is the case, that should be unknown to your manager (if they were hired as C developers, their C++ skills probably never came up in the job interview).
Depending on the size and structure of your codebase, moving to C++ may be a very good decision. You don't give enough detail for us to know if that is the case.
For example, I've seen a large C codebase that over the years ended up reinventing C++ poorly (pseudo-classes supporting virtual function tables and inheritance - with a structure holding a void* to a base structure, or a base structure having void* to specialized data created dynamically - and other monsters).
Would be good for future reference since I have always thought that Linux developers with knowledge in C++ wouldn't be that hard to find, but I could be totally wrong.
They shouldn't be hard to find, but that's only a valid point if you're at the beginning of your project. No good manager will consider lightly changing seasoned developers who know the problem domain with new hires just for a few design decisions.
If you can provide better reasons for switching they may consider it. Good reasons for switching (for a manager) involve lower maintenance costs, lower development costs, lower risks, less effort, better progress reporting and so on.
If you want to keep pushing for this change, you will have to find some good arguments in those areas on top of some good counter-arguments to his "Linux developers know C".
Your arguments should be good enough that they overcome the arguments I've given above.
Developing Linux precludes knowing C++? Weird. One of the most common UI's for Linux is KDE, and that uses C++ extensively.
In my company, I think we easily have a hundred developers that know C++ and Linux. While it was hard to find them, it wasn't particularly hard. Good engineers are hard to find independent of the precise skills you're looking for.
We don't seem to be the only who came up with that idea. Look at Mozilla; FireFox is a big C++ project. Same goes for WebKit, C++ too.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With