3 ms·
imho, Java is a great tool when it is deployed for its original goal: Platform independent GUI clients. Unfortunate its now mainly used on the server side, wher
by kephra 14y ago
imho, Java is a great tool when it is deployed for its original goal: Platform independent GUI clients. Unfortunate its now mainly used on the server side, where it fits badly.
The main reason I'm not using Java on server side is memory footprint. A typical Lighttpd, fastcgi, Rails, MySQL stack runs well within 256mb of memory on a Xen instance. A typical Apache, Tomcat, JBoss, Hybernate, Spring, Oracle stack requires 4GB or more on a root server.
I think most startup coders shy Java, because they know it mainly by maintaining enterprise dead horses and bloatware.
See: Tate, Bitter Java, ISBN: 193011043X
- cturner 14y agoUsers generally dislike java on the client side because the widgets don't integrate with their platform quite right. Java apps don't "feel right". A good web app is generally easier and cheaper to build and better than a bad GUI app. I think the server is where Java shines. Good Java is almost as fast as good C (if it's not, you're using bloaty libraries or being cavalier with memory), and when something breaks you get a stack trace that a support team can make some sense of, and the build/dependency system is a lot nicer. Sun sold Java as a plug-together ecosystems. They encouraged a mindset of putting together big teams of developers who live in padded IDEs and lean on bloaty frameworks, and not to think about resource usage. This won a mental traction with companies who wanted to believe that software work and developers should be a commodity, but has lead to a lot of bad systems. The results cause people to have some strange ideas about Java, like that it's slow. The Java world places a lot of emphasis on inheritance, which may be an anti-feature. Before I became fluent with python I used to create thick abstract class hierarchies that aimed for perfection and reuse. In truth the result was a bloaty, brittle mess. Python's awful inheritance model forced me to learn how to think in ways other than inheritance. Your example technology stack isn't a like-for-like criticism. You're criticising Java because Oracle takes up stack of memory and because you'd choose to use hybernate and spring. Why can't you use lighttpd, fastcgi, Java and mysql? The rails ORM isn't sophisticated, and it'd only be a couple of days' work to hack something up equivalent in Java. The result will be faster than rails and less memory intensive. You missed the obvious advantage of rails over java for web development - a lot of web development involves heavy string processing, and the tools you get in ruby/python style languages for list processing and string manipulation are a luxury compared to what you get in Java! That was the main reason I moved away from Java for web work. With Java you try to build things to be configurable. You might need to do a different option later, and you know that it will be a laborious refactor. Whereas with scripting languages, the configuration language and the programming language are the same thing. So you just write the thing to do what you need it to do. And if you needs change a bit later, you throw away what you had without it feeling like the death of a child and then do the new thing and get on with your life.
- sandGorgon 14y agoI seriously recommend that you re-look your stack. Java is simply the most performant (RAM and CPU) stack vs Rails in a pure apples-to-apples comparison. The two stacks you have compared are apples to watermelons - here are a couple of questions: 1. Why both Tomcat and Jboss ? Choose one or the other. In fact for the best performance you can run your application on Jetty. 2. Mysql vs Oracle ? you need to compare equally. I hope you do realize that JDBC/JNDI are perfectly compatible with Mysql - more so, since they are the same business entity. 3. Lighttpd vs Apache is again an unfair comparison. You can perfectly run Lighttpd in front of Tomcat. I seriously suggest you re-evaluate Java if you are purely looking for performance. Developer productivity is a whole different story altogether.
- kephra 14y agoall true - but my unfair comparison was between the typical java enterprise dead horse, and a typical startup stack. I did not compare Java best practice for one reason: The enterprise bloat is how Java is perceived. Its not about why Java is not suited for startups, but why Java is not choosen by startups.