I have a uni project comming up soon that involves some sort of database driven website. The group that I'm in for this project have narrowed our options down to either Perl or jsp.We all have experience in java (yet none in jsp) while two of us have experience in CGI using Perl.I haven't looked much into jsp but I'm guessing (hoping?) that there is a cgi.pm equivilent which will do the ground work for us.
Doing some reading around the web I've come across sites listing the advantages of jsp varing from "jsp runs faster than Perl" to "Java programmers are paid more than Perl prgrammers".I wonder if any monks with a foot in both camps could give me a *less* biased view of the two technologies.
IMOHO it would be a lot easier to do this type of thing in Perl than Java and even though I think it would be good to learn to use jsp, an assessed uni project might not be the best time :)
Many thanks,Nomis52
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: CGI (Perl) vs JSP
by perrin (Chancellor) on Mar 10, 2002 at 19:26 UTC | |
With the speed issue gone, you have two things to consider. The first is what it's like to use JSP. In my opinion, it's not so good. JSP uses embedded Java code, which is actually much worse than embedded Perl code because of all the casting and the difficulty of treating Java types generically. I think you'd be much better off with a good templating tool for Java, like FreeMarker, WebMacro, or Velocity. You can read more about why this might be a better choice in "The Problems with JSP". If you want to use a Perl tool that is similar to JSP in terms of embedding code in pages, you can read about the best perl options here. The other thing you should consider is the experience that your team has. If you are mostly more experienced at Perl than Java, you will definitely write a better site quicker by using Perl. I personally find Perl to be more productive, but someone who had written as much Java as I've written Perl might disagree. If you do decide to use JSP, do yourself a favor and at least get a decent tag library like the one that the Struts project provides. It basically turns JSP into a templating tool, which is a bit silly since the other templating tools are probably simpler and faster, but it does let you use something decent and put "JSP" on your resume. | [reply] |
Re: CGI (Perl) vs JSP
by Dog and Pony (Priest) on Mar 10, 2002 at 12:00 UTC | |
JSP itself is an easy system to write code and pages in, it works more or less like PHP or a Templating system for perl. You also have the advantages of easily put logic in external classes, and call those as you are used to. For frameworks that add extra functionality, tapestry might be of interest for instance. On the other hand, I thought that setting up and configuring the system was a real pain in the behind. Java has some real strange quirks about how it is configured. This might be because I missed something, of course, but if I relate to the ease of installing perl (if it isn't already there), this is a nobrainer. That also includes mod_perl and friends. JSP seemed like a pain also when building the applications, or pages. Lots of Manifest files and such that needs to be properly configured, although I gather that some tools are available to manage this for you. Again, I might have missed something... While I wholeheartedly support JSP and Java over MS-technologies like VB, ASP and .NET, I don't really see any benefits over using perl. The above "problems" I mentioned are easily overcome, but I think that perl can do everything JSP can do - I won't judge if any of them are "better" though. I think that is a matter of taste. On a personal level, I would probably build anything small to medium in perl, possibly with additions of PHP, Java or whatever does the job best at the moment. Anything medium to big, I would probably pick java, with additions of perl etc. This is, even though I do understand the OO ways of perl, and realize that almost anything can be done in perl, I feel more comfortable with complex (business) logic in java. I also feel the tools are way better for such for java, something I hope will be better in perl as time passes. :) In conclusion, perl is most likely your friend in most cases, and should do the trick with less time, just as fast, and less hassle. Only reason to pick JSP would be to learn - I am very much for learning as many different approaches as possible - if nothing else, it probably makes you a better perl coder because it opens your mind to new ways of doing things. Good luck with the project, in any case! :) You have moved into a dark place. It is pitch black. You are likely to be eaten by a grue. | [reply] [d/l] |
(jeffa) Re: CGI (Perl) vs JSP
by jeffa (Bishop) on Mar 10, 2002 at 16:05 UTC | |
A company i used to work for replaced all CGI scripts with JSP ("um, have you considered mod_perl instead", "oh well, um, a-hem, um, we need JSP!"), and the site looks the same and runs about the same. Personally, i think that was a big waste of time. Starting from the ground up in JSP would be okay, but i really think a company needs to understand WHY they HAVE to use JSP. The main reason i can think of is that their programmers are really less than average. ;) jeffa L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat) | [reply] |
Re: CGI (Perl) vs JSP
by snapdragon (Monk) on Mar 10, 2002 at 14:35 UTC | |
I'd ignore the whole speed issue for the moment. The design of your system will impact speed more than language choice at this point (I'm thinking of issues like web page caching, persistent database connections, precompiled SQL statements...). As for the pay point.... I have to say that in general Java developers are paid more than Perl developers. But the difference is not that big - have a look on some job web sites sometime and compare salaries for development positions requiring similar experience. I've written a bit more than I intended to (sorry about that) but I've tried to give the best advice I can. I think that Perl would be the way to go (but then you might expect that this being perlmonks and not javamonks). Have a look at this link - it's got a good review on issues of Jsp vs Perl (and other server side langhuages too: PHP etc.) It does not specifically deal with Jsp but it does talk a lot about Servlets (which you would probably call at some point from a Jsp page) and compare preformance issues. And then make you own mind up (go on choose Perl.... you know you want to...). | [reply] |
Re: CGI (Perl) vs JSP
by hossman (Prior) on Mar 11, 2002 at 02:09 UTC | |
I write Java Servlets & JSPs at work, the "CGI.pm" of JSPs are the HttpRequest and HttpResponse classes (and instance of which is magically created for you) which have all of the methods you would expect. The Chief Architect at my company is no bone-head, he did a lot of performance analysis of both Weblogic proxied through Apache & mod_perl, assuming that people wrote "imperfect" JSPs & CGIs (ie: not optimal code) and determined that the performance of JSPs in Weblogic was pretty much the same as mod_perl. He choose to go ahead with Weblogic &JSPs because he thought it would be easier for people with very little programming experience to write JSPs then to write perl scripts. (NOTE: he didn't try any Perl templating systems.) If everyone on your team has strong Java experience, you might as well stick with that. The meat of your work can be done in support classes that won't be any different from any other Java classes you've written, using JSPs to generate the HTML should be relatively trivial to pick up. Your whole team can probably learn the syntax of JSP tags faster then you can get the remaining guys of your team to learn Perl from scratch. | [reply] |
Re: CGI (Perl) vs JSP
by cjf (Parson) on Mar 11, 2002 at 08:59 UTC | |
Now why would I say that you ask? For a few reasons of course: Also, after you're done your project, see my thoughts regarding Sun here | [reply] |
Re: CGI (Perl) vs JSP
by dash2 (Hermit) on Mar 11, 2002 at 13:29 UTC | |
Never mind how much people get paid. Start worrying about that at your age and you will be a wage slave before you are thirty. With those sage counsels out of the way, I can tell you a bit about JSP equivalents in Perl.
dave hj~ | [reply] |
by drewbie (Chaplain) on Mar 11, 2002 at 20:13 UTC | |
My reason was that I (the programmer) had to do too much work to get the data in the correct format H:T required so the HTML guys could do their thing. With H:T I had to do all kinds of massaging because the syntax is very simple (by design). With TT, I just throw data structures at the template folks and they can use it how they want since TT can parse all kinds of data structures. Just my $.02. | [reply] |
Re: CGI (Perl) vs JSP
by Bukowski (Deacon) on Mar 12, 2002 at 16:04 UTC | |
However this is not all you need for your database. Assuming you are going to need some (real) database interaction (eg postgres, mySQL, oracle) you will need to investigate the DBI (database independent) and DBD (database dependent) modules for easy access to such datasources. Personally I can't see any point doing this in jsp - the experience is there in perl/CGI and the lesson in database integration will be just as valuable in perl as any other language.
Bukowski - aka Dan (dan@black.hole-in-the.net) | [reply] |
Re: CGI (Perl) vs JSP
by mortis (Pilgrim) on Mar 13, 2002 at 02:32 UTC | |
The first site was 2 developers for 4 months. The second was 7 developers for 6 months (with 30% of the features of the first, though it did have internationalization requirements that the first did not). For development speed and performance, (mod) Perl won. For code readability and management acceptance, Java won. Of course the experience (pain) of using both HTML::Embperl and JSPs/Servlets was what lead me to start Pas, which has (IMO) most of the best aspects of both approaches. | [reply] |
by perrin (Chancellor) on Mar 25, 2002 at 01:18 UTC | |
There are also nice systems built on top of some of these, like OpenInteract and Apache::PageKit. | [reply] |
Re: CGI (Perl) vs JSP
by Tyke (Pilgrim) on Mar 14, 2002 at 15:18 UTC | |
Otherwise CGI::Perl / an appropriate templating system, as suggested by other posters, is more than sufficient; and (IME) has fewer gotchas. | [reply] |