age old debate

i wanted to touch on the age old debate between Java and .NET (and just Microsoft in general). java was originally devoloped as an applet language for the web, and for small compact devices that needed to run small applications in a minimal footprint (such as cable boxes, cell phones, etc). this was back around '95 when your only other options were either C++ or VB, perl, python, and other similar languages. what has happened to java along the way is probably the most severe example of code bloat that the industry has ever seen. Over the past 8 years, at least a dozen layers have been bolted on to java to make it do things such as CORBA, native method invocation (JNI), dynamic web page rendering (JSP), database communication (JDBC)...and the list goes on and on and on. Microsoft isn't exempt from attempting similar things w/ their database programming centric language, VB. who doesn't want to try and forget about ActiveX Documents, and the dreaded Declare statement for native DLL invocation.

they even took it a step further by using VBScript for Active Server Pages, which was actually a decent bridge to where we are now with .NET and web programming...but it quickly outgrew itself as a viable internet programming solution. the Java platform itself has remained relatively unchanged since its' inception 8 years ago, aside from all of the bolt ons mentioned above (which really aren't a part of the jave platform itself). Microsoft realized that the entire Win32 programming model needed an overhaul to make ANY kind of programming consistent across the board, hence the advent of .NET. virtually any kind of application you want to develop, and the API's are there. they were quickly heading torwards the same kind of fragmentation that now plagues java, and i suspect that the java crowd will get a revamped platform sometime in the near future, and will be exposed to the same learning curve that VB programmers faced when .NET first appeared on the scene. java isn't a programming language, it's a platform, just like .NET is a platform.

if one were so inclined, you could easily write another programming language to program against the java platform. the 2 camps (Sun and MS) each preach different advantages to the 2 platforms, and they are both somewhat viable. sun speaks of code portability (more on this later in this post), and MS preaches multiple programming languages targeted to the .NET platform. quite honestly, i agree with sun's approach much more than i believe in MS's approach, however with the coming of MONO, .NET will be just as portable (so they say). while i agree that language independence is a great sounding feature, the language itself is the easiest part to learn, all you have to do is pick up the syntax (there is a peculiar language called Eiffel that has been ported to .NET, eiffel forces a methodology known as coding by contract, which makes it a bit tougher to just spend a weekend reading a book to learn as you really need to learn this methodology to get the most of the language)...but i think you see my point.

regardless of what language you learn, you MUST learn the .NET platform and API's which is definitely no trivial task. at last count, there were over 2000 base classes and types in the .NET framework, perhaps significantly more. so in my opinion, that defeats language independence. on to sun's promise of code portability and platform independence. that statement alone is a paradigm, and almost an oxymoron...you are indeed tied to one platform...java! java has been ported to almost every type of OS out there, so you do get some independence there...but any reasonable java programmer knows that true code portability is a myth in the java world. what has happened is all the vendors (BEA, IBM, even Sun themselves) have bolted on vendor specific features, and this has led to a SEVERELY fragmented platform, any non-trivial application will need to be rewritten somewhat (and perhaps completely if you change out app servers)...that is not portability, and not an example of thier "write once, run anywhere" slogan.

Sun has lost control of the platform, and it's up to the vendors themselves to sort it all out. the vendors ultimately would like to keep customers on their specific implementations, so the likelyhood of that happening is pretty slim. as i say that, i've read that BEA and IBM are forming an alliance to address just that...so perhaps the vendors will end up playing nice with each other. it could be a little too late though as again, any changes they make to thier specific implentations will need to be propogated throughout current application already written (which is a substantial amount).

so, more about code portability and sun's implementation (through my warped .NET eyes at least). sun really does have a vision w/ the prospect of platform independence, however by virtue of this, the java platform suffers from HUGE perf issues. having that extra layer of abstraction from the OS warrants that, plus java is an interpreted language, similar to how a parser sorts through a scripted language. nothing is compiled down to machine level code until the last second...reports have shown java bytecode to be up to 20% slower than native code. this is something that will be quite dificult to overcome as sun would have to target a compiler for each platform they wish to run java on...this would be a maintainability nightmare from their end, and is certainly not a feasible solution. microsoft has the advantage here by being able to target their native platform (windows and win32), code is compiled down to a near native byte set. herein lies another key difference between the two platforms: sun licenses the java runtime (leaving vendor specific modifications wide open), whereas microsoft has published the CLR as an open spec, making it easy for anyone who wishes to author a compiler to run against .NET...they are tied to the .NET framework guaranteeing a consistent programming model across the board (so long as the implementor wishes to remain CLR compliant).

it's a matter of choice, as it's always been. sun definitely beat everyone to the punch when it comes to a simplified programming model, however it was too little too soon, there is simply no way they could have ever planned that java would have to morph into what it's become today. microsoft had the advantage of being able to learn from java's mistakes, and to be able to bake in new technologies that weren't even dreamed of when java made it's debut. it's my opinion that web services and SOA (service oriented architecture) will be the true definitions of platform independence. true independence results in the underlying workings being completely hidden from the consumer...web services definitely are a first class citizen for this type of behavior.

this post has gone on long enough (for now...), so i will conclude it with this: THERE IS ALWAYS MORE TO COME!!!

j

No comments yet