top | item 4065980

Ask HN: Why not Java for web development?

10 points| RobertLong | 14 years ago | reply

While I'm a fairly young developer and a freshman CS major. I've heard of the problems and horror stories associated with Java web development. But recently, I discovered Play Framework and I'm beginning to wonder why Java is given such a bad name in web development?

I'm studying at a California State college and nearly every school in the system teaches Java as their core language. Very few of these colleges have a single class that teaches web development. For someone who wants to pursue a career in web development, this is highly discouraging because I feel I am not learning the technologies I need for a job (such as Ruby and Python).

I read stories every day saying there is a lack of Ruby and Python developers. Yet, there are tons of great developers who are being taught Java and could pick up Play as easy as I have.

So I ask all of you, why not Java for web development? What's wrong with Play? And why are all these companies ignoring the fact that there is a shortage of Ruby and Python developers because most college students are learning Java?

20 comments

order
[+] gacba|14 years ago|reply
And why are all these companies ignoring the fact that there is a shortage of Ruby and Python developers because most college students are learning Java?

I'll answer your other question as it seems to have been ignored:

I don't think anyone is actively ignoring these other great languages. It has more to do with inertia. Once a company invests X in their software (where X can be 100K to 100M), they're reluctant to throw that away when it works. We as engineers may like the hot new thing, but the company having paid for the hot old thing isn't just going to throw it out because you don't like it anymore. :)

This is why we had the Y2K problem from a massive investment in COBOL. We'll have other issues from a massive investment in Java over the next few decades as well. It is what it is. Learn Java. Learn Play. Learn Ruby, Python, PHP, C#, whatever you want to learn. You'll be learning all your career. The more languages you know, the better a developer you will be. Embrace it now, forever will it dominate your destiny.

[+] andrewguenther|14 years ago|reply
Why not Java for web development? People do use Java for web dev. Google uses it almost exclusively as far as I know. You will find that Java is in fact very prominent in large companies.

What's wrong with Play? Nothing is "wrong" with Play You just don't hear about it as much because you read HN. HN is about startups. Startups like to be on the bleeding edge and boast very rapid development cycles. Java is just not conducive to this. (I would like to note that I have never personally used Play) As far as I know, Play has not gained the traction that other event driven frameworks have. This has a lot to do with the fact that Play didn't really start to come to light until after Node.JS started to explode and server-side javascript became heralded as the second coming of Christ (by some, not most).

And why are all these companies ignoring the fact that there is a shortage of Ruby and Python developers because most college students are learning Java? Because it doesn't matter what the college students are learning. Java is a good language to teach OOP with. But that doesn't mean it is always the best tool for the job.

Very few of these colleges have a single class that teaches web development. For someone who wants to pursue a career in web development, this is highly discouraging because I feel I am not learning the technologies I need for a job (such as Ruby and Python). You aren't learning them. Just like you probably won't learn the technologies you need for the next job you want at your current job. Welcome to development. Never stop learning. You stop learning, you're dead. I'm serious. Who knows what the cool thing will be five years from now? Doesn't matter, you're going to have to learn it anyway.

I would like to elaborate further, but don't have the time at the moment. Please feel free to ask me anything else you're curious about.

[+] bobfirestone|14 years ago|reply
In production Java has a lot of upside. Compared to ruby or python it is screaming fast. Twitter has moved large portions of their app to java from rails because of this.

The reason why interpreted languages are hot with startups and why twitter was originally built on rails is the speed you get in development. Also production speed differences are being offset by cheaper faster hardware.

If you hit twitter or facebook scale issues and need more of a speed bump than you can get by throwing more boxes at the problem. Congratulations you've won and if you built on ruby you can go from mri to jruby and get all the java production speed without giving up the ruby development speed.

[+] why-el|14 years ago|reply
Twitter moved to Scala, not Java. Java can be valuable if you really get into it, to a point where you begin to understand the internals of the JVM, because that is not going anywhere soon.
[+] tjr|14 years ago|reply
There is nothing wrong with it per se. It's more of a cultural thing.

Web application development culture tries to be fast, both in terms of developing the initial application as quickly as possible, and rolling changes out to the user as quickly as possible. Having to compile code has traditionally made Java less desirable than Python/Ruby/Perl etc. for the fast cycle of web development.

The Play framework eliminates this problem, but there's cultural momentum built up. After eschewing Java for years due to this, it seems unlikely that Java will quickly recover any warranted popularity amongst web developers.

Java also tends to be more verbose as a language. This can be a good thing in certain settings, but again goes against the desire for fast development.

There is in fact a lot of Java web development going on, but more in situations like developing internal web applications for use within big corporations rather than developing nimble startup code. If you wanted to get a job doing internal web applications for some place like Transamerica or AT&T, Java skills would be good to have.

That said, if you're really into Java/Play, then there might not be a lot of competition to become a leading expert...

[+] latch|14 years ago|reply
Play might eliminate the compile/refresh issue, but it doesn't close the gap with other web frameworks in terms of overall productivity.

Some of this is part of the framework. JSON continues to be treated as a second-class citizen and static actions can't be unit tested. Some of it is Java: dependency injection sucks, lack of meta programming capabilities, static typing.

It's a lot better than Struts, and if you _had_ to use Java, you'd probably want to use Play. But if you had the choice, what compelling reasons is there to use Play over rails/sinatra/django/web.py/node ?

[+] RobertLong|14 years ago|reply
I find Play to be very fast to develop for so far especially compared to Rails. While I haven't dove deep into either, the workflow in Play is very fast and the syntax is still kept fairly short.

For me, all of my education on Rails came from online tutorials and books which I have been able to learn the basics from, but not enough to get a job with.

How can students like myself without access to classes on web development really learn the subject? And why would anyone hire a web developer from a school that doesn't teach web development?

[+] Edmond|14 years ago|reply
I know you are just starting out so you have to start somewhere. I'll recommend you stick with Java and add PHP or any of the other "sexy" web-dev technologies to your skill set.

In general knowing more than one platform serves you much better than becoming stuck with one of these web-dev frameworks that may not be around in a few years.

Java is MASSIVE, if you ever want to be a serious technologist in a big corporation, Java is a requirement, and don't let anyone tell you that is going to change anytime soon.

Java is a very mature and versatile platform with a host of advanced technologies built on top of it (check out apache.org). There is a reason the likes of Google build their platform on top of Java not Ruby/PHP/Python or any of the other more talked about platforms.

If nothing else Java can be a good way to get some problem solving exercise. Unlike some of the other web-dev frame works that abstract a lot of stuff from the developer, in Java you'll have to deal with more low level concerns which can be good for your own training as a developer.

PS: I am the founder/developer of a Javascript APP platform that you as a student may find interesting: www.appynote.com. It is built on top of Java:)

[+] RobertLong|14 years ago|reply
I currently use PHP and ZendFramework at a startup that I'm working at right now. However, I definitely think the workflow could use some work and that combined with my aspirations to be a well rounded web developer has led me towards other web frameworks.

I currently love the startup atmosphere and don't plan to ever work for a large corporation. Do you think that there is any place for Play Framework in the startup scene?

For example if myself and a couple excellent Java programmers from my school tried to apply to an incubator, would we be taken seriously or written off immediately just because we picked Java for our language of choice?

[+] Turing_Machine|14 years ago|reply
Just learn them, dude. If you've learned one language (and understand it) picking up another is usually no trouble at all, especially nowadays when there are tons of tutorials, manuals, and support forums available for free.

Figuring out how to learn another language on your own is probably one of the most important skills you can master because the language is used in your school classes (no matter what it is) is very unlikely to be the "hot" language ten years from now.

Learning another language is also an excellent way to discover new ways of thinking about programming.

As to why those other languages are more popular, there are a number of reasons. Less boilerplate required to get something running, no compile step, dynamicity...(and of course there are also drawbacks -- type safety and so on).

[+] RobertLong|14 years ago|reply
I've been trying to learn Ruby and Ruby on Rails for the past 6 months. I've gone through tryruby.com, rails for zombies, watched many of the RailsCasts, and built a couple apps on my own to learn the language, but I still consider myself a novice.

Sure I can implement many gems into my application and just hack together other peoples work, but I really am gaining no knowledge of the Ruby behind all these gems and have no clue what the best practices for Rails are.

Online materials for Ruby and Rails are always made for different versions of the languages/frameworks and that can make things very complicated at times for someone just starting out.

So what do you recommend to REALLY learn Ruby and Rails?

[+] rjhackin|14 years ago|reply
Java is a good language for web development. It's mature and most of the big companies use java. Java in terms of popularity might have slowed down but JVM as a platform will stay for a longer time. I use java for my day job, but I did learn php, python and ruby on the side just to build some small apps as part of learning. It's fun to learn additional languages and to know where each language shine.

I haven't worked on Play that much so I'll let others who have used talk about it. Spring framework is another really good one you can give a try.

The reasons why startups prefer anything other than java might be rapid prototyping, bleeding edge and probably hosting costs.

[+] gexla|14 years ago|reply
"So I ask all of you, why not Java for web development? What's wrong with Play?"

There is nothing wrong with using Java for web development. There are loads of people using Java for web development. Otherwise nobody would have bothered building things like Groovy and Grails, Jruby or Play.

"I read stories every day saying there is a lack of Ruby and Python developers. Yet, there are tons of great developers who are being taught Java and could pick up Play as easy as I have."

Tons of Java developers just sitting around looking for a job? The problem isn't a lack of X developers. It's a lack of AVAILABLE x developers to be picked up.