May 29, 2008

Developer Efficiency (C# vs. C++)

Ever have one of those nights where you can't sleep. Sometimes me brain will not stop thinking so I can fall asleep.

Lately at work I have been working on adding new features to our companies web site. We recently rewrote the site in C# and ASP .NET which has been wonderful. I've been able to use C# for the past 6 years or so, and overall find it better than Java, C/C++, and any other language I know for general purpose programming. Other languages may have some better features than C#, but overall I prefer C#.

Unfortunately most of our code base is in C++. Every time I have to go back and work in our old code base I feel like I hit a brick wall. I just feel so much more productive and effective when I use C#. Before everyone starts yelling about the merits of C++ let me clarify.
  1. Our C++ code base is not very well organized or designed
  2. I have much more experience with C# (Though I'm not a C++ novice either)
  3. The added features/power of C++ are not worth the extra complexity most of the time
C# has most of the important features from C++ and many that C++ doesn't have. There are very few cases where I wish I had something extra in C# that is in C++, but the opposite happens quite frequently. With modern computers today, what little performance hit you get from using a memory managed language that complies to byte code, is far outweighed by the many benefits (such as programmer efficiency) gained.

Also I find it much easier to move from one project to another and one company to another when using the .NET framework. The .NET framework includes most of the standard features/classes/functions I need on a daily basis. It doesn't have everything, but close enough for most things. With C++ there is the STL, but beyond that different companies use different libraries for everything else, and often write some of their own libraries. If we hire a developer familiar with C# I know that they should be right at home in our new C# code base, because most of what we use is already in the .NET framework. If we need someone for C++ then we either make sure that already know all of the different 3rd party libraries we use, or we assume it will take them a while to get up to speed. Regardless they will have to get up to speed on our in house C++ libraries.

From both a technical and managerial standpoint I am glad we are moving more and more towards C# and away from C++.

No comments: