Apathy is the suck. Login and vote now.
By dnene
via blog.dhananjaynene.com
Published: Apr 14 2008 / 10:57
Java : if (compete with PHP / Ruby / Python) { stop fixing the syntax and start fixing the runtime }
A lot of people are wondering whether Java is under threat from a set of nimble languages - PHP / Ruby / Python / Perl. This post suggests the solution is in reforming its runtime not its syntax.
Comments
signal9 replied ago:
I wouldn't say Perl is much of a contender. a lot of people went from Perl to some Java framework. I would say Ruby is the language that will give Java a run for its money. But if I was going to invest in a new framework, I would probably look at some of functional programming runtimes and languages.
Nikita Ivanov replied ago:
Perl... "nimble" language... :) Voting down for that... I mean I haven't seen yet someone comparing Java to Perl in anyway...
Nikita Ivanov.
Tantalus replied ago:
That's called 'missing the forest for the trees.'
Dhananjay Nene replied ago:
Yep ! Guilty of mashing up perl into the discussion :(
Tantalus replied ago:
It's not just the compile cycle and it's not just the lack of dynamism -- it's that the lack of dynamism is implemented in a verbose way.
In most LAMP web apps these days performance of the web app is not your limiting factor, it's scaling your database, network latency, load balancing...we are all used to scaling horizontally now, so the increased performance of Java over Python/Ruby doesn't give you much, and that's compounded by that I can offload as much as possible to the client with javascript these days. So why would I want to write something in a language that's going to give a code base 5 times the size of the equivalent Python/Ruby/Perl code?
Dhananjay Nene replied ago:
>In most LAMP web apps these days performance of the web app is not your limiting factor, it's scaling your database, network latency, load balancing...we are all used to scaling horizontally now, so the increased performance of Java over Python/Ruby doesn't give you much>
So thoroughly not true !! In fine tuned Java apps (doing a tremendous amount of processing I might add), if you've designed your application really well the response is getting streamed back in the same time the PHP script is still busy parsing the request. There are a whole bunch of things you can do in Java applications such as pre-computing and caching your most traversed data, creating highly efficient data structures (a primitive long based hashmap I wrote which got used quite heavily could knock the socks out of any dictionary in any python / ruby code). If you really really want to scale - if you know how to make java scale - and if you have a dedicated server(s) - stick to java unless you just want to punish yourself enough to write your app in 'C' as an apache mod. I have read such comments about scaling horizontally and scaling the database etc etc. and I just find these to be a bunch of incorrect folklore. Well designed java apps scale and scale beyond the reach of the other languages.
Having said that, I would seriously look at not using Java today for all low end and most middle end apps. But again it is not because of the verbosity of code - to an experienced programmer the verbosity hardly hurts even though it does exist. What hurts him is waiting for the compile cycle. That kills his productivity. Another point that doesn't get talked about is the fact that ruby's compactness can actually hurt. When you are running a large development team with a varying range of skill sets, I think ruby code can actually be far harder to write and even harder to maintain for junior developers if they are not well grounded in OO and compact programming techniques.
Voters For This Link (18)
Voters Against This Link (1)