Before discussion I am assuming the following:

  1. Server-side development
  2. Efficiency meaning less time to develop
  3. Efficiency meaning less maintenance hurdles
  4. Efficiency meaning faster execution!

Points 2 and 3 are pretty obvious: From the language and API advantages Java code is smaller and less dirty than C code. What is not that much obvious is that in 90% of the cases these are the most important types of efficiency. That is, from an economic point of view its much better to be conservative on developer and management time (human resources) than on, say CPU time or memory.

But I would also like to argue that in most cases Java code (server-side) is faster. A short story:
A macho programmer that I know decided to implement an highly threaded proxy server in C. Threaded programming in C/Unix (pthreads in the case) is quite awful. Also, other things for the project at hand are already available out of the box in Java, but not in C. It so happens that the proxy has a performance bug (still to be discovered) that puts the CPU at 100% utilization.
Yes, I know that with more careful programming (note: this guy is not bad at all) the C version could be much better. My point is that the human ergonomics of a language should also be considered regarding the performance of it, so as C is a dirty language, there is a bigger possibility of your code be less efficient because its easier to make (performance) mistakes.

There is also another reason why Java (especially on the server-side) can be faster: Clever engineers designed APIs and application servers for you to use and architected it with performance also in consideration.
You might have a deep understanding of your application domain, you might even understand server architectures to a certain degree, but do you really believe that you can do that better than dozens of engineers that concentrate solely on making clever application servers and APIs? I understand a little bit of infrastructure, but I prefer to outsource it, and concentrate on my core business.

By the way, a link on Macho programming

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Facebook
  • Google
  • connotea
  • DZone
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati

Please share your thoughts