ASP or JSP? 32
Fooknut asks: "I'm here, in the infant stages of development of a corporate website, and portal for my employer. I asked to build on JSP/servlets/EJB, so they setup a Win2k server with IIS 5 and JRun (allaire). Two weeks into the dev process they have a meeting with some managing "programmers" and the decision is made that JSP/Java was just a foolish thing to do, and that we should go with ASP. So here I am, chucking all of my hard work out of the window because someone "important" likes ASP better. Luckily I haven't written much code yet. These decisions are made by ASP lovers, people stuck in the MS rut, unwilling to try or hold a new skillset (I believe because they don't know how and don't want to know how to program anything else). Does it make business sense to put all your chips in the MS hat? Should a web dev co do one thing only, or should it embrace a variety of technology? So what are the advantages and disadvantages of JSP over ASP and vice-versa? Please don't post anti-MS comments, I really would like some serious comparisons."
ASP = rapid application development (Score:1)
Haven't had to think this hard in a long time.. (Score:2)
What the question really boils down to is 'are you willing to fight for the best system for you to do the job with, regardless of vendor'... While not a web developer (Although I was one, briefly) I generally don't care what is actually calling the shots as long as they get called on time and consistantly so. I'm sure the manegerial staff (And the 'heavy-hitter wioth a MS pref) don't really care either, so long as you can show them the why and why not. They're just used to that 'Microsoft thing', and in their mind the world's most valuable company can't be wrong..
Re:ASP = rapid application development (Score:2)
3 comments in 24 hours? Am I living on an island? (Score:3)
With MUCH difficulty, I have learned enough java to write servlets and database calls and server side java can now do much of what I would do in ms land with the power of java running on opensource servers with free database software on a cheap monthly host.
I will agree that down and dirty wins the business contest. But it also is really really stupid, just like all the management decisions that make down and dirty programming the rule of the day.
This battle is far from over. If you want the definition of easy, try php, not ASP. And java is actually quite easy, once you get past all the inane classpath issues.
While the corporate monkeys are all addicting themselves to mindless tech, there are a bunch of us learning how to do real work with slightly more clunky technology and actually enjoying it. It is going to be very fun to watch the slug fest in the following years. I have my own personal ideas of who might win the war, and it won't be the mindless ones.
Re:ASP = rapid application development (Score:3)
A wealthy eccentric who marches to the beat of a different drum. But you may call me "Noodle Noggin."
What about WebObjects? (Score:2)
Just a thought.
Summary: Used Both, Prefer JSP (Score:2)
Try Both (thru PHP) (Score:3)
But anyways, back to ASP vs JSP: JSP sucks! there's no other way to put it: JSP is a hack on top of a kludge: it's ugly syntactically, it tries to fit a square peg (Java) into a round hole (server-side scripting) and it has nowhere the built-in functionality and features of either PHP or ASP.
Now, OTOH Java *servlets* (not JSP) rock! Session management, persistent objects, the ability to leverage Java's impressive APIs; it's the answer to any serious enterprise-level solution.
So, what to do? PHP4 is supposed to be able to manipulate Java objects *directly* (it's in the spec but I haven't used it). If that works, you can now throw away JSP, put all your middleware logic in Java beans and servlets and use PHP to do the string-parsing and HTML pushing...
If I were you, I'd try to push for PHP as a 'peer to' ASP with the advantage of being able to use your old Java work...
engineers never lie; we just approximate the truth.
How about Zope instead of either. (Score:1)
and MS people working for me now think
it is the greatest thing since sliced bread,
and definately superior to ASP
Re:Try Both (thru PHP) (Score:1)
Server side Java should be more than JSP, which means that you need some plan and organization.
It is easy to put too much functionality in JSP. Think of it as a template language with various flavors of Java classes for the backend. It if is mostly Java code it should be a servlet. I don't know if there is an equivalent rule in MS land.
One division that was recommended by a senior guy, who recently came on board, and which makes a lot of sense to me, is to have JSP 'views' with a servlet 'controller'. (Ala MVC) The controller uses a ResourceDispatcher.include() to get the views that it needs, passing them data as request attributes. We'll be trying this. I liked when I heard about it, and it has only grown on me since.
This also means that specialized HTML/presentation people can hack the JSPs without being as likely to fsck things up.
Flawed logic? (Score:2)
Hmmmm. From what I understand, JSPs are a superset of servlet functionality. JSPs, in fact, get converted into servlets before being executed. You should be able to insert any valid Java servlet code you like into an JSP page.
Maybe you were using something that only conformed to the JSP 1.0 spec? You should be working with JSP 1.1 at least. There are dozens of vendors with different implementations, which is a key advantage over ASP, BTW.
PHP4 is supposed to be able to manipulate Java objects *directly* (it's in the spec but I haven't used it). If that works, you can now throw away JSP, put all your middleware logic in Java beans and servlets and use PHP to do the string-parsing and HTML pushing...
What you describe is the entire idea behind JSP. I love PHP, but the idea that PHP will provide better connectivity to Java then JSP (which is Java), seems a bit unlikely.
BTW: I love PHP. Great platform.
- Scott
------
Scott Stevenson
ASP with Java Middle-Tier (Score:2)
If you're a Java lover but you're forced to use ASP, you can put your business logic into Java classes and call them from your ASP pages! That way the suits will be happy, and you'll still be doing most of your coding in your language of choice (Java). Here's a great article that shows you how to do that. It's quite easy! http://www.4guysfromrolla.com/ webtech/080999-1.shtml [4guysfromrolla.com]
A bit of advice from a guy who's learned it the hard way.... no matter what language you're coding in, your ASP or JSP tier should just be a thin "glue" to hold together the objects that contain yer bizness logic. Those objects can be either compiled DLL's or Java classes, it really does not matter- just as long as you keep it out of your ASP and JSP pages where it's ugly and not very reusable. With prior proper planning, you can create a set of middle-tier objects that will make your ASP/JSP pages a snap to code.
IMHO, the ASP/JSP tier should be so thin it really shouldn't make too much of a difference whether you use ASP or JSP. The meat of your code should be in the middle tier. I haven't done any real work in JSP, so I can't directly compare it to ASP, but I would agree that Java is a nicer language than VB to code in, so it's a good choice for your middle tier logic objects. :) Good luck on your project!!!! :)
Key advanges of JSP (Score:2)
1. Multiple JSP implementations are available from multiple vendors [esperanto.org.nz]. Many of which are free (You either have to buy NT, or software from Chilisoft to use ASP).
2. JSP functionality can be stored in JavaBeans
3. JSPs can be deployed on virtually any platform in existence. And while ASPs can be deployed to environments other than Windows, ActiveX library support cannot [esperanto.org.nz]. Therefore, if NT/W2K runs out of juice (witness Toys R Us), you can't move up to Solaris or AIX.
4. JSPs are compiled into servlets for faster execution (does ASP do this?)
5. JSP engine can run on a different machine than the webserver
For more information, check out The JSP FAQ [esperanto.org.nz].
- Scott
------
Scott Stevenson
Re:ASP = rapid application development (Score:2)
I'm a former VB/VC++ drone, [it paid the bills] so I'm rather familiar with it in practical use..
Reality Check (Score:1)
If page templating is all you need to do, then something like Allaire Cold Fusion is probably better. Use JSP if you have existing business logic in JBs/EJBs, and ASP if you have existing applications in COM.
Re:Try Both (thru PHP) (Score:1)
kinda disturbing (Score:1)
If you're on a Microsoft platform, use ASP. That's such a no-brainer answer, I can't see how it's even questioned. You can even use Java, just like Mr. Booty suggests.
If you're not on an MS platform, use JSP. DUH! (unless you like to fiddle with those 3rd part ASP for non-MS solutions.)
If you have a little free time, go check out php at php.net. No fooling with zope or zend just yet, just try out good old fashioned regular PHP. Version 4 just came out, and if any of my current projects demanded a Linux environment, I'd be very excited. And I fully plan to be excited when I have to do a Linux-based project.
ASP or JSP. My guess is, the answers to this question were so obvious, the asker wanted to get everyone else's opinions just to make sure he wasn't getting snookered by something he couldn't see. "A good programmer looks both ways before crossing a one way street."
--
Peace,
Lord Omlette
AOL IM: jeanlucpikachu
Re:Flawed logic? (Score:2)
You are correct, JSP is translated to Java and then compiled as a servlet. Now, what does that mean for the end-developer?
* Is JSP faster than PHP/ASP? No, not out of the box. Both PHP and ASP are compiled to bytecode, so loading time between a PHP/ASP page and a JSP servlet are not far off. The true advantage of JSP comes from the ability to communicate with Java beans that can do very nifty tricks (like DB connection pooling, persistent objects, etc). Other than that, a JSP servlet is not static (i.e. always loaded); it has to communicate with static beans/Java classes to get those advantages. Now, this was true a few months ago with JServ and GnuJSP, Tomcat might have changed things a bit. But what if PHP can do the same trick as JSP (i.e. communicate with persistent Java objects, so you don't have to replicate them with each page invocation)? I think some benchmarks would shed some light on this one.
* JSP is syntactically ugly. Both ASP and PHP have an advantage there.
* JSP is nowhere as widely used as either PHP or ASP. The 1.0 and 1.1 implementation where so very different, forcing people to port stuff over. I.e. there's a much larger libary of ready-made code for either ASP or PHP over JSP.
* Most importantly, (to me at least): JSP is Java; as much as I love Java for serious programming, it sucks for scripting: it's a rigid, serious programming language. PHP/ASP OTOH have all the nifty shortcuts to make code easier to develop and read (e.g: variables within strings, automatic conversion between strings and numbers, etc, etc).
As I said, I love servlets. For serious applications, servlets kick ass. For RAD, servlets are a pain and a half. PHP/ASP Java connectivity can bridge that gap and get rid of that half-baked technology Sun came up with to be in the server-side-scripting market (i.e JSP)...
engineers never lie; we just approximate the truth.
Re:JSP vs ASP, What about Enydra ? (Score:1)
modern day geek. [dhs.org]
Re:Summary: Used Both, Prefer JSP (Score:1)
if (smart) useJSP(); (Score:1)
B. it compiles to bytecode when run on the server. nifty..!
C. JSP = JAVA server pages, you have a WAY more powerfull development language than VB. They are just begining to plan to ad treads(just an example
D. performs better under heavy loads
Even better... (Score:1)
But enough Karma whoring...
J.
Re:ASP with Java Middle-Tier (Score:1)
I have been working with ASP for a while now (IIS 3 days) and it has really matured as a platform...JSP still seems to be relatively new and I have not been impressed with what it offers, other than cross-platform capability. In reality, most companies will lock a platform in as a part of a strategic plan so the need to change platforms should be remote on most sites...in two years time you may have to change, but will you be working at the same place...python may even have taken over the world.
As observed, within ASP objects can be coded in Java, so this may be of some benefit.
And the presentation layer should be very thin and should also be pretty straight forward...logic should be limited to some loops, some conditional statements, some output and formating.
ASP with JScript (Score:1)
I've never used or seen JSP code, and I think it's safe to say that PHP is definitely on a path that puts it in the ruuning for the lead in the future. It justs needs some more data handling abilities and we're all set. The future looks bright. Cheers!
-Yoink!
Re:Flawed logic? (Score:2)
ASP maybe, but PHP is not (unless you mean it's recompiled in memory each time the page is requested?). I know there's a PHP4 compiler lurking on the horizon, but I believe its purpose is to encrypt the code prior to distribution rather than to speed things up.
JSP is syntactically ugly. Both ASP and PHP have an advantage there.
I would tend to agree PHP has the edge here, but have looked at very little ASP code.
JSP is nowhere as widely used as either PHP or ASP. The 1.0 and 1.1 implementation where so very different, forcing people to port stuff over. I.e. there's a much larger libary of ready-made code for either ASP or PHP over JSP
My feeling is that JSP will rapidly overtake PHP in terms of activity of developer community, because 1) it is from Sun 2) based on Java. Sun has much more influence than the PHP team. I also suspect JSP will grow quite rapidly in the next year. Not that I
nifty shortcuts to make code easier to develop and read (e.g: variables within strings, automatic conversion between strings and numbers, etc, etc).
Amen to that.
that half-baked technology Sun came up with to be in the server-side-scripting market (i.e JSP)
Like I said, I think JSP is going back in the oven for a bit.
- Scott
------
Scott Stevenson
ASP vs JSP (Score:1)
Many of these problems are not as severe these days. But I still find programing in ASP much simpler then in JSP.
------------
As for the language limitations? Neither ASP or JSP is a language. You can use serveral languages ASP always allowed Vbscript and Jscript. JSP is supposedly supposed to support other languages since version 1.1 even Pascal.
------------
Programming Communities> ASP is commercial once you are Microsoft's friend you get many freebies but free code is hard to find. JSP comes from the JAVA cult, they only want you to use JAVA technologies and think that JAVA is gonna take over the world someday. You have to deal with way too many closeminded people. JAVA is closely controled by it's mentors and you have to spend lots of mulla for different pieces of technology. PHP is nice and free
That's it for today.
Re:ASP with JScript (Score:1)
Re:JSP / ASP/ PHP Benchmarks (Score:1)
Go to some third party to get a decent benchmark,somebody that doesn't have anything to gain by saying JSP is faster.
Re:Try Both (thru PHP) (Score:1)
Re:Flawed logic? (Score:2)
Now, about JSP: instead of me trying to convince you why it should be thrown away, read this [servlets.com] great article from Servlets.com --hardly the place for Java critics...
engineers never lie; we just approximate the truth.
Re:if (smart) useJSP(); (Score:1)
Excellent! I have lots of traction problems using VB on wet roads, and treads will make a big difference.
Re:Flawed logic. (Score:1)
Let's look at the criticisms one by one:
"Java code too tempting."
This is true of any scripting language. I've been forced to clean up amateur ASP projects that were 90% inline VBScript, 10% HTML, 0 VB objects. PHP3 was even worse, because you were almost forced to inline everything (which put me off PHP to the extent that I never bothered to look at whether v4 fixed that problem).
The proposed solution, however, removing the _ability_ to inline code, is far too restrictive. Why should my proof-of-concept JSP need to be coded for maintainability? If I've got a deadline tomorrow, I might _want_ to sacrifice good coding style, secure in the knowlege I can split the load properly between servlet and JSP over the next week, so long as the app is running. In the real world, there are too many situations where you want to inline code, although you should plan on fixing it later if the page is anything more than a one-shot.
"Java Code Required"
There is no real advantage to being able to type "$Request.ContextPath" instead of "Request.getContextPath()", unless you count three keypresses as critical to your project. They are two different syntaxes for the same thing. This is like saying that WebMacro is a bad thing because it forces you to use WebMacro.
The remaining complaints in that section are solved by using custom tags.
"Simple Tasks are Hard"
Once again, "#parse "header.wm"" is just as complicated as "<%@include file="header.jsp"%>". The only difference is that the latter is a lot less likely to upset GUI web design tools, which makes it easier to keep the web-designers happy.
"Lousy Looping"
The JSP/taglib example of "foreach" is identical in complexity to the WebMacro version, once more with the advantage of being more friendly to existing web design applications.
"Useless Error Messages"
That's an implementation issue, not a problem with JSP's themselves. A decent JSP compiler should spot constructs that will cause errors in a compiled class, and flag them. If your JSP compiler is not decent, it's the fault of the people who wrote the compiler, not of the JSP spec.
As an aside, the setup I have here allows me to step through the JSP compilation process, and attach a debugger to running servlets and JSP's. Being able to set breakpoints, walk through methods etc. etc. makes it a lot easier to find the more obscure of my mistakes.
"Need a compiler"
So how do you run a dynamic site without a compiler (or an interpreter, if you want to be picky)? Osmosis? Telepathy?
It's not particularly hard to get hold of a Java compiler. They're available for free (beer) on most platforms (Solaris, NT, Linux, AIX, HP-UX, MacOS, we've even got one client running an application server off an AS/400). I'll admit, if you're not running on a platform with an available JDK, then JSP isn't for you.
"Wasted space"
The disk-space argument isn't even worth mentioning. You're never going to have so many JSP's that it'll cost you more than a few dollars worth of hard drive space, if that.
Sure, Java uses up a lot of memory. But that's Java itself, not something specific to JSP. I don't know what system he was using to test on, but the average size of a JSP on the production web-app closest to hand is 6-7K, not 30+K. The JSP compiler doesn't load all the HTML as static class data, it gets pulled off the disk at the start of the service() method, and is available for garbage-collection as soon as the request is done.
Anyway, enough counter-rant.
Charles Miller
--