5 ms·
I prefer scripting languages over a pure Java stack simply because I can reload the page and see what's happening with the new code. Yes, you can use JRebel, ho
by roam 16y ago
I prefer scripting languages over a pure Java stack simply because I can reload the page and see what's happening with the new code. Yes, you can use JRebel, hook up a debugger and tweak settings to get some hot code replacement, but they've always failed me at one point or another, resulting in hours of fun. The compile-check-fix-compile cycle gets under my skin, especially when you're using frameworks and libraries that take a minute to bootstrap.
The JSTL is not a factor in speeding up development. A lot of people even prefer a Velocity or Freemarker template engine when they are using Java. And I've never worked with MyBatis but have done plenty of projects with Hibernate/JPA and let me tell you: I've often come at a point in a project where I was wondering how much time I had saved by not writing the easy SQL queries and how much time I had lost by trying to work around some random restriction in the Hibernate API. For all the "hate" Django's ORM gets, I've never run into the same obstacles.
With all that said, the Play! framework addresses a lot of these issues and is a lot more fun to work with.
- mrj 16y agoYes, but the question was about jsp, which doesn't require any fancy tricks. :-)
- roam 16y agoOnce upon a time some guy thought it would be a great idea to simply construct SQL queries, make the DB calls and loop over the result sets trying to create somewhat decent output, all in a single JSP. I'm so incredibly happy I never had to work with him again. When you're writing a very simple todo list: be my guest. When you're attempting to create any kind of decent application and do use JSPs like this: you're stupid.
- mrj 16y agoWho said anything about all that?
- roam 16y agoSee my reply here: http://news.ycombinator.com/item?id=1535945 http://news.ycombinator.com/item?id=1535945
- mrj 16y agoWell, I would never consider jsp for that. But for certain view-layer duties, it works, it's simple and it doesn't require fancy tricks.
- roam 16y agoAgreed :)
- kp212 16y agoWhoa, no need for the stupid comments. I wouldn't suggest a full fledged app in JSPs, yes thats insane ;-). Although, years ago I wrote blog where I could email my blogs in and I remember that first night I didn't want to set up a war and just wrote a straight JSP...I was only looking and I didnt want to wait. Obviously that is not a long term solution. However, having something that's wrong is better than not having anything done. You do make a good point, I think I will play around with Django, sounds like its faster than compile, war, deploy that java apps take. How much productivity increase do you see over java in terms of development?
- roam 16y agoI never meant to call anybody on here stupid, but it's how I felt about that guy back then. It's difficult to quantify the increase in productivity using Django - since I never wrote the same project twice and a lot depends on the Java frameworks you use and the type of apps you write - but I certainly feel more productive and: happier! A lot can be explained by the fact that I'm basically forced to do the whole compile-war-deploy cycle on my current Java project and that Python allows me to write real generic code. Be sure to first check out the tutorials in the Django docs because setting up a project for the first time can be a bit intimidating. Totally worth it, though ;)
- kp212 16y agoYou can do that with a JSP page, and Tomcat. You can use JSP very much like a scripting language (no need to hit a servlet, controller, etc), but obviously it can get a little messy to manage depending how large of app you write.
- roam 16y agoAnd that's why I thought he was talking about Java webapps in general. I mean, JSTL is pretty useless if that's the way you're going to use JSP. :)
- tomh 16y agoOne big problem; if you keep most of the Java code on the servlet side and you throw an exception, the stack trace will give you the line number of the offending code. OTOH, if you do all that heavy lifting in the JSP side, depending on your choice of server, you get a stack trace...either without a line number, or with a line number of the JSP which was compiled and turned into a Java program on the fly. And we all know what machine-generated Java looks like, right? Like a big plate of pain with some extra pain on top. Good luck bug-hunting that one.
- kp212 16y agoYeah you are right, lets just forget using jsp without the framework model.
- eccp 16y agoNot entirely true. On Tomcat 5 and 6, the resulting code is really close to the original, plus lots of out.write(). If the logs show an exception on org.apache.jsp.mypage_jsp._jspService(mypage_jsp.java:NNNN), you can find the generated Java class on TOMCAT_HOME/work/Catalina/localhost/myapp and it's rather straightforward from there. I do this on a daily basis to maintain a legacy app. Not sexy but, not hard either.
- idleworx 16y agoFrom my experience, I agree with you on Hibernate. MyBatis however turned out to be rather painless. I've also noticed that Play framework and looks really great, just haven't had the chance to play around with it much.