Sunday, June 27, 2010

Write Once, run anywhere.. Or is it?

While reading this blog post I couldn't help but have a lot of ideas I needed to express. I will be formatting this post however in a way that the reader doesn't have to read both posts if they're short on time (though I would like it if you actually do read my friend's blog).

Should a product be tightly controlled to so that its quality is ensured? Could additional features and flexibilities be an obstacle for a product to fulfill its true value?

The issue here is with Java. Java is supposed to be the silver bullet of operating system-programming language decoupling.

Java is bytecode compiled. When on the actual target machine, it is probable that the JVM will do a JIT compilati0n. JIT is common among code that is bytecode compiled and is generally a reply to being less on performance on average than natively compiled code (C++ to x86 machine code for example). In some situations, JIT will produce machine code that is actually faster than code that had been remotely compiled and linked to encompass a vast array of machines.

So far so good. Java looks like a C++ killer, even on performance! A lot of people believed so as well. I am not sure however where things went wrong and Java scaled back to becoming yet another solution in the programmer's arsenal (or an additional item to the poor programmers confusion).

Almost with any program that has to do things that are not quite standard, the OS will allow you to do things that the general high level language doesn't have semantics for. Comes in JNI. A native interface for Java. It allows you to use Java to access OS specifics. Mind you, I didn't say use OS specifics from Java since once you're in that land, you've went out the boundaries of the design guidelines of Java. The write once, run anywhere gets broken.

Does this mean that Java is less or more portable. Is this flexibility akin to worsen Java's reputation?

I believe not. A tool must be open for use as the user wishes. While giving guidelines of recommended use for a tool, you should also think about it as such, not as a rule book.

To me, in conclusion as a reply to Tech Thoughts blog: In this contained context I elaborated in, I believe Java fulfills its promise as a cross platform tool (for where a JVM has been written at least) and allows the user to take a decision and break that advantage for the sake of a heartfelt use.

No comments:

Post a Comment