Linked by David Adams on Sat 11th Oct 2008 16:48 UTC, submitted by IndigoJo
General Development Eric Raymond is working on an essay, putatively titled "Why C++ Is Not My Favorite Programming Language". In his announcement, he calls it "an overcomplexity generator", "bloated, obfuscated, unwieldy, rigid, and brittle", and alleges that these characteristics appear in C++ applications also. I contend that many of the complaints about C++ are petty or are aimed at specific libraries or poor documentation and that many of the features commonly regarded as unnecessary (and excluded from intended replacements) are, in fact, highly useful. C++: the Ugly Useful Programming Language
Thread beginning with comment 333396
To view parent comment, click here.
To read all comments associated with this story, please click here.
Morph
Member since:
2007-08-20

no a software with the same quality, functionality and performance to Microsoft Office or to Adobe Photoshop written in Java or C# or Python... and because their huge dimensions, they are not written in C neither, they are C++ code).

The reason that MS Office, Photoshop etc are written in C++ and not in C#, etc is because they predate C#, Java and Python by many years. These apps have been around since the early 90's.
Take any large Java app and work on it solidly for 15 years with a team of hundreds and then you will have something that you can compare to MS Office and Photoshop.

If Microsoft was starting MS Office from scratch today, I'm sure they'd go with C#/.NET from the outset.

Reply Parent Score: 1

IndigoJo Member since:
2005-07-06

Really? Don't forget that .Net is a JIT compiled system, which means that the first time any part of the software is used, it's slow because it's being interpreted and compiled at the same time, yet it never reaches the performance levels of a native-compiled program. Why would MS put their customers through that - something which would become very public when they are selling a large program for hundreds of pounds or dollars - when they can just use something they can compile, and ship it out ready to go?

Apart from ThinkFree, can anyone name any heavyweight software, open-source or proprietary, which is based on a non-native platform?

Reply Parent Score: 3

ciplogic Member since:
2006-12-22

About your question:
- bloated C code: GNOME Desktop
- bloated C++ code: OpenOffice and KDE4 desktop
- slim Java code: Eclipse (the start is slow but after that is faster than Visual Studio written in C++)
- well written C code: Apache Http server, Linux kernel, a lot of other examples
- bad written, memory hungry code (C): GCC compiler tools and linker

C++ was not able to remove the legacy so the compiling of some C++ files may take hundred of megabytes, if they use multiple headers + templates on GCC (cause of including headers, expanding templates, etc.) still hard to match in a big sourcecode.

Java/.NET is useful in places where the speed matter (that is why they do benchmarks on Java) but mostly to simplify a complex business logic that C++ rarely can match. The C++ advantage remains still the huge codebase that is hard to be matched by any non C/C++/ObjectiveC language/environment.

Edited 2008-10-12 12:46 UTC

Reply Parent Score: 2

PlatformAgnostic Member since:
2006-01-02

It's possible (and done with all libraries and many commercial .NET packages) to have the code precompiled into native images and stored in the .NET image cache using the NGEN system. This has a mixed effect because some of the dynamic parts of the code become slower (the native code has to have extra checks for cases which were not known at pre-compiling time). On the other hand, the code pages become shareable and you don't pay the initial load time and runtime costs of JITting the code.

It's possible to have C# compiled all the way to native code and have no JIT at all. The Bartok compiler from the Singularity group at MSR does this.

Reply Parent Score: 2

werpu Member since:
2006-01-18

Really? Don't forget that .Net is a JIT compiled system, which means that the first time any part of the software is used, it's slow because it's being interpreted and compiled at the same time, yet it never reaches the performance levels of a native-compiled program. Why would MS put their customers through that - something which would become very public when they are selling a large program for hundreds of pounds or dollars - when they can just use something they can compile, and ship it out ready to go?

Apart from ThinkFree, can anyone name any heavyweight software, open-source or proprietary, which is based on a non-native platform?


Yes, basically all java web containers, Eclipse, Netbeans, Intellij, Google Android, Limewire etc...

Reply Parent Score: 2

evangs Member since:
2005-07-07

The reason that MS Office, Photoshop etc are written in C++ and not in C#, etc is because they predate C#, Java and Python by many years.


That's nonsense that people in the Java/C#/Python camp keep on bringing up but it has no basis in reality. Nobody writes large scale applications in Python, so I'll leave that out of this discussion.

Adobe is happy to rewrite Photoshop in Objective-C to target the Mac market. Why are they unwilling to rewrite it in Java or C# if it will guarantee "easy" portability?

Managed languages will always have additional overheads compared to compiled languages. For many end-user facing applications, these overheads are just unacceptable. Managed runtimes add tremendous memory overhead that makes them unpractical for things like office suites, photo editors, browsers, and most other pieces of software.

Note, this is not to say that managed languages have no place on the desktop. They're widely used in in-house business applications as they allow for a shorter development cycle than traditional C++ applications. Also, business desktops tend to run less applications than home user ones so the increased memory usage is not so easily felt.

The move from assembler to C to C++ became practical as hardware improved. Perhaps in the near future when 64 bit machines and operating systems become ubiquitous, and everyone is running with hundreds of gigabytes of RAM, we'll start to see more applications targetting managed runtimes. Perhaps not, as some would argue that the there aren't any long term productivity benefits in moving to managed runtimes.

Reply Parent Score: 5

PlatformAgnostic Member since:
2006-01-02

Adobe probably has no problems linking in arbitrary C++ code into a program that contains a smaller Objective-C 'View' component. That's a lot harder to do with Java (which doesn't have great support on the Mac anyway.. so that wouldn't be an option).

Microsoft's equivalent set of tools, the Expression Suite, is actually partially written in C#. It's entrenched like Adobe's stuff, but I'm sure they would refrain from C# entirely if it were incapable. Media Center is also written in Managed Code and seems to perform quickly enough (at the very least it doesn't seem to be CPU-bound).

Reply Parent Score: 2