Feb 15
As you already know that from Java 6.0, JVM wont be running Java alone. Its going to run a lot of scripting languages too. Rhino, the Mozilla implementation of Javascript is the one that is officially announced. There are already too many tutorials in the web on how to run Javascript in Java 6.0.
Mid last year, there was so much hype about Ruby on Rails and that it is going to shun Java to oblivion very soon. The ease of development with Ruby on Rails made that trick. But then experts opined that Ruby will hold its own niche just like PHP and wouldnt be replacing Java in the enterprise market, now that Java has become more a standard than a technology.
Following the Ruby hype, JRuby came into existence. Ruby interpreter, which was originally written in C, was written completely in Java and guess what, Ruby will now run on your JVM. Please visit the JRuby homepage for more details.
JRuby … Ruby on Rails… Thats right. JRuby on Rails. A new Java web application framework comes into existence. Just like any upcoming web frameworks, there is less of configuration and more of tier based stack ups.
So, two years down the line you will be working with a programmer who writes a completely different language and will ask you to speed up your JDBC code. You have to buddy. He calls your code and shares your JVM.
Share and Enjoy:
These icons link to social bookmarking sites where readers can share and discover new web pages.
Tags: java, jruby, rails
Feb 15
With Java 6.0 round the corner, most of us are still making Java 1.4 code. And when we see these kind of snippets in the net we just get embarrassed.
List<String> list = new ArrayList<String>();
Iterator<String> iter = list.iterator();
String s = iter.next();
Here is a very very good FAQ/Tutorial on Java 5.0 Generics. Must read.
http://www.arunma.com/files/JavaGenericsFAQ.pdf
Share and Enjoy:
These icons link to social bookmarking sites where readers can share and discover new web pages.
Tags: java
Feb 15
Most Java programmers, just like me are always under the misconception that Java is slower than C/C++ or any of its Object Oriented counterparts. An interesting article that i read recently really made me proud to work in Java.
After looking at those Swing applications and Applets, anybody would easily come to a conclusion that Java is sluggish. Taking hours to load. Eclipse is slower when compared to C driven Desktop applications. Right. Its very very true that C applications are faster than Java applications in the desktop front. Meaning. C/C++ can just run small programs a bit faster than Java. But research reveals that C/C++ cannot even come closer to Java in the server-side front. C/C++ performs very badly in the web-applications and server based programs, where Java rules.
Java developers often feel shy when C/C++ developers come and say that we have another “layer” called JVM above the machine code which converts the bytecode to machine code and hence our code can NEVER be faster. This WAS true. But it isnt now. At least after the Just In Time compiler came into existence since Java 1.2. The Just In Time compiler just “compiles” the code into machine language. So, your java code doesnt get interpreted every time it is run. And not only compilation, it just optimises your code too.
Does the Hotspot JIT ring you bells? Thats right. Its the Sun’s own JIT which looks into your code, finds places which is frequently run, optmizes the code, compiles it into machine language. So, the next time you hit the same area, you get a blistering response. Same is the case with JSP. When you try hitting the JSP thrice or more times (first hit will always be tedious. you know why), your JSP class is fully compiled, optimized and “hotspotted”.
Refer http://www.idiom.com/~zilla/Computer/javaCbenchmark.html for benchmark results
The above results are for Java 1.4. You know that there are so much of optimizations done in the JVM for JDK 1.5.
So, the next time somebody comes to you and says “C/C++ is faster”, just tell them back, “You are living in a smaller world, buddy”.
Share and Enjoy:
These icons link to social bookmarking sites where readers can share and discover new web pages.
Tags: java