If you were about to throw out your C++ compilers because of my post on the productivity benefits of managed code and scripting languages, hold your horses. Although managed code is pretty darn fast, sometimes performance still comes first. As Ole Eichorn points out in the comments:
This is a companion discussion topic for the original blog entry at: http://www.codinghorror.com/blog/2005/08/despite-the-incredible-slowness-and-the-sparseness-of-features-this-is-really-really-cool.html
Apart from legacy code, unmanaged code is a thing of the past, and for good reason.
“EVERY mainstream program is written in C/C++”
Which missed the point. Exactly how many NEW OS/database/Office packages/whatever mainstream programs, HAVE been written in the last 10 or 5 years since the introduction of Java and .NET languages respectively?
If Microsoft had to start all over again and write a brand new OS completely from scratch (with no eye toward compatibility with previous OS’s), how much of it would be written in C++? How much of it would be written in C#? And how much of it would be written in some sort of scripting language?
C++ = 25%
C# = 75%
Scripting language “X” = 0%
This of course proves nothing as the numbers would be completely different for some in-house line of business application.
Name any X which isn’t coded in C/C++. Where
X = webserver, application server, financial
application, image analysis package, etc
I live in the New York area where there are many financial institutions and financial service providers. I’ve spoken with many people associated with those fields and can tell you that there currently exists several systems that were developed with managed code (java/C#), and that many new trading systems are being developed entirely in managed code.
Most of the applications listed are legacy applications written years ago, before Java even (the dark ages). The same arguments made against managed code today were made by the assembly programmers back when C++ came out. Heck, Excel is still a mish-mosh of C/C++/assembly because there are some parts they are either too scared to touch or they really need the performance. Is the web server embedded in VS2K5 written in C++ or is it just the C# demo web server?..gah, can’t think of it’s name…Canolli?
You could look at the WEBRick server, Tomcat has a web server embedded in it. I think JBoss and Gemstone do as well. for the Ruby on Rails applications as a “mainstream” application… if you squint real hard and spend a lot of time reading weblogs.
I think Corel Office for Java ended up as StarOffice, which is also Open Office, and NeoOffice J for Mac. I’m not entirely sure about it’s lineage and I’m too lazy to Google.
yeah, but StarOffice is straight C++, as far as I know. So I don’t think it shares any code with the Office for Java project. Here’s a review of the latest version (StarOffice 7) from pcmag:
From the review:
But StarOffice tends to be more intuitive than Microsoft Office
“yeah, but StarOffice is straight C++,”
duh, as are OpenOffice and NeoOffice/J. I don’t know what I was thinking. The “/J” threw me off. hehehe
I’m really amazed at the statement:
"Apart from legacy code, unmanaged code is a thing of the past, and for good reason."
What do you think all the .NET managed code is written in? Native C/C++ duh! I suppose if you don’t know how to write safe code then managed code would be a safe place to start. I’ve been coding for 25 years and have written in more languages than I care to count(C# included). C/C++ is hands down the best coding language out there. Using Managed Code is just unacceptable in my opinion. There is just way too much stuff going on in these managed extensions to justify their use. The performance and control just isn’t their. Not to mention all of the deployment and maintenance problems of someone else changing the way your app behaves. To make matters worse, whenever there is a security hole in the managed code every hacker in the world hears about it and your app becomes a security risk whenever it’s running! Yikes!
I agree with u… When talking about performance, C++ wins C#,java or any programming language used these days… so @Matt, I don’t agree with ur theory cause simply if Microsoft will do its OS from Scratch these days, They will use C++ too (thinking about performance not easiness to its developers!!)
@Sam: whenever there is a security hole in the managed code every hacker in the world hears about it and your app becomes a security risk whenever it’s running
That’s also true for security holes in operating systems, servers, database engines, third-party libraries, and whatever else your application depends on to run.