For: Lots of language bigotry and computer compiler complaining.
I've always been a C++ hater, and recently a Java hater. However, I've had enough years of C coding to know that it's productivity is pretty low compared to more advanced languages. I think it's ridiculous to write an office application in C. But today, it's also ridiculous to write an office application in Java or C#. Whence shall C++ die?
Why I "hate" java:
- The evolution of the language has been a complete re-invention of all the standard libraries and toolkits already available through C and C++.
- Using JNI(Java native invocation) to access said libraries is like playing with a box of bullets and a framing hammer to shoot a deer. Yeah, been there, done that.
- It's a major memory hog. It shouldn't require 16 GBytes to run a first class production web server. Yes, been there, done that.
- It's a CPU hog. While it does good on benchmarking, this is completely at the expense of memory management. Hit the memory wall and expect a massive wait time while java takes out the trash. This is the reason there is a "server" and a "client" VM now.
- Language iteration has been awful. The base types are not first class objects, and can't be "boxed" into them easily. There are multiple threading models (though the latest is actually nice), and lots of "styles" of code around. I say they shoot the duck and make a coherent standard library.
- AWT is foo to work in. Swing is slow. The obvious way to go is SWT - which is "abhorred" by the pure java community. Get a grip!!! SWT is wonderful to work in - it's the java client that we all deserved years ago. Eclipse is the prima donna example.
- Failure to provide customer optimized native code. Yeah, I know this wasn't the goal of Java - but step through the looking glass and imagine a world where developers write the code and distribute the app as bytecode. When you install the app on a machine it builds a fast, sleek native version that always starts fast, and works on every operating system out there - flawlessly. In other words, the ultimate software delivery model for almost every customer out there. Yes, it's hard to do. Too bad java missed this boat.
The good things about java though:
- Interfaces, OOP, threading, sockets. Java taught the world that this stuff should be in the language and basic. My original fascination with java started here.
- Applets. Yes, I love them - too bad they are under-utilized.
- Eclipse. I'm in love with eclipse. Java is actually usable with eclipse.
Now onto the goodies.
I've been doing much work with C# latily. WOW. Big WOW.
Let me list the goodies:
- Coherent architecture, methods, naming conventions, types. It's just a JOY when you KNOW that the length of some type is .Length.
- Structs live on!
- Invoking native code is easy. I'd say 7x faster, as I've written wrappers for both java and C#, being completely non-proficient in either. One day, versus a week to get a simple library interfaced.
- Built-in XML parser. No dabbling with multiple libraries, adding JAR's to your distribution, etc.. I know, it's semantic, but the JCP could have standardized on something like this long ago.
- Pointers when you need them, mixed managed and unmanaged code. Yes, warn me that I'm using a pointer - no, I know what I'm doing.
- Follows Java syntax and form, provides the goodies to build native GUI's without huge sacrifices.
- Follows Java's example in threading, sockets, and other base libraries.
Now, the list of badies:
- No native code, still have to live with a VM.
- Again, memory is killed for CPU sake, though I've noticed that C# doesn't hit the memory wall nearly as easily.
- Complex native structs just require pointers sometimes - I wish there were easier ways to manage structure members without having to write a complete getter/setter interface sometimes - but it's a small price to pay compared to pinning memory and locking the whole VM ala java.
Is there any hope for the average application developer? How about systems developers that want more productivity when the want it? How about developing an office application without sacrificing your soal to the dark one?
I think I've found it.. it's called D. It's a relatively new language, only 4-5 years old. However, it's not afraid to break old code and it's really moving in a nice direction.
From my basic overview of the language, I am hugely impressed.
- It's clean, fast, compiles to native code, and supports all the goodies of java and C# without the big overhead.
- Contract programming and unit test code "built into" the language
- C# type delegates (basically functions as pointers you can juggle as needed)
- C# type strings in switch statement (No more strcmp or overloading junk)
- Resizeable arrays
- No header files, methods are definitions
- Threading, sockets, exception handling
- Associative arrays ala perl hashes. BIG timesaver here.