4 Web Scripting Languages Compared 237
monkey crunch writes: "ZDNet is running an article comparing PHP, ColdFusion, JSP, & ASP. Although they don't show the script sources, it's interesting to note that PHP garnered the highest performance of the bunch. From the article, PHP: 49pps, ASP: 43pps, CF: 29pps, JSP: 13pps" PHP did gather the highest pps, but it's interesting to also note what the article gave top honors. In any case, it's an interesting topic, but remember: use what's best for you. Don't use what you feel you "have" to.
Re:Embedded Perl??? (Score:1)
Re:Stats (Score:1)
At Security Space [securityspace.com] you'll find all sorts of interesting stats, such as what kind of servers [securityspace.com] people use, what modules [securityspace.com] apache servers use, what technologies [securityspace.com] people make use of and what people author [securityspace.com] their stuff in.
It's a really good site, which I use a lot to point out how many sites run open source products. Strangely I cannot find Tomcat there... Odd?
Re:PHP *is* relatively new (Score:1)
Re:ASP, JSP and servlets (Score:2)
You can write ASP in PerlScript, JScript, Python, VBScript, etc. And ASP+, Microsoft's next "version" of ASP, will support, among other languages, C#, which is just alias java c#
No no no (Score:1)
On Error Sucks (Score:2)
Re:and perl is where? (Score:1)
100% recycled BS. I am the only one who tires of this complant. Perl is not hard ot maintain, bad programming and design structure is hard to maintain. I have been involved in 25K LOC projects with an established coding standard and naming convention and variable scoping rules. Ease of Maintainance exceeded any C project I have ever worked with and a 25K LOC Perl project is probably worth 35k of C or C++ code for equivalent functionality.
Re:A Few Clarifications on ASP & JSP (Score:1)
it sounds like you didn't even attempt to use VID for anything more than an HTML editor. forget the autogenerated junk- that's crap. but if you know how to write web code, you shouldn't need or want any of that anyway. VID offers a ton of productivity enhancers if you take the few moments to learn and use them.
ASP is an ISAPI filter (Score:1)
Re:What about dynamic GIF/JPG figures and PDF file (Score:2)
Give me a break. You can generate dynamic GIF/JPG and PDF with all of the scripting languages in the article. PHP, being the kitchen sink of a language that it is, chose to bundle the GD library, and several PDF generation libraries into the language, and that's about all that makes it slightly advantageous in this respect. It's fairly trivial to create dynamic GIF/JPG images with JSP/servlets (Jason Hunter's servlet book had some examples), and there are at least three Java PDF generation class libraries that you can use to generate PDF from JSP/servlets.
I will no even get started about ASP and CF-both can readily access COM objects, which opens up a whole bunch of opportunities since there are so many libraries available. PDF and GIF/JPG is definitely not a problem with any of these technologies.
Whenever you're designing a comprehensive reporting application at work, coming up with a decent library to generate good-looking business charts is a problem with technologies like PHP, however. There is so much free and commercial Java and COM libraries available for JSP/Servlet and ASP or Cold Fusion developers, but not for PHP.
Hey, I LIKE ColdFusion (Score:2)
Say anything you want about what's better, what's worse ... but I'm sticking with this mealticket for right now. ColdFusion is great ... it's fast, easy, fairly elegant, and pays really well!!!
Re:JSP's and Older Techs (Score:1)
Of course, ASP shares these same problems, as JSP was modeled after it. The real solution to this problem is to use a scripting language which doesn't allow the intermingling of Java code and presentation. An example would be WebMacro or Velocity, template engines which use a very simple scripting language to access bean properties to display a page. A servlet inspects the HTTP request, performs all logic for deciding how to handle this request, constructs a bean representation of the data requested, and then passes this data to the template for display. This seperation is clean--the servlet is written by a Java programmer, the template by a graphics artist. They only need to communicate about what data will be passed between the two. It also enforces good style of not allowing arbitrary code to appear in your presentation layer--something which requires a fair amount of discipline--especially with junior developers--when working with JSP.
The main thing JSP has going for it right now is market push. JSP was just a clone of ASP in an attempt to win mindshare by providing something familiar. {A,J}SP really isn't very well thought-out, but most people don't realize this because they don't know much about the alternatives. Compound this with the fact that developers don't mind mixing code and content, and you've got a pretty strong force in favor of something which can make web monkey's lives a living hell. It's really a good idea to look at the alternatives. Unfortunately, none of them have really reached the critical mass of users yet, but as sooner we make the transition, the faster they'll mature!
Why test on different OSes? (Score:1)
Re:Web Scripting... (Score:1)
--
Problem is with web teams. (Score:4)
Thus, when you look at the "cost (Developer time)" score, what you are really looking at depends on the composition your team. It's just plain stupid to rank JSP/servlets as "C" and ASP as "B"; there are applications a skilled programmer can do with JSP that would be nearly impossible in ASP. In that case, JSP would be "A" and ASP would be "D". On the other hand, if you are relying your already overtaxed and underskilled Microsoft only IT app development department to deploy some very simple dynamic content, then ASP would rate "A" and JSP would rate "D" for cost.
By the way, about a and a half year ago I took my small company kicking and screaming to Zope. I built a standard page framework with consistent but customizable layout, navigational elements and decorations. Was this costly -- you bet. We wasted untold time arguing over content that users provided that had hard coded positions, dimensions, font sizes, and IE only HTML extensions. However, once I got these people out of the layout business into the content business, we ended up with a web site that is consistent, professional, and constantly updated with no technical skills required at all.
Moral: the cost to deploy is not necessarily related to the cost to maintain.
Re:phplib (Score:1)
And, AFAIK there is no template functionality built-in to PHP4... yet.
Re:ASP (Score:1)
However, JSP is definitely slanted towards java
Re:What about Cocoon? (Score:1)
On the other hand, if all your doing is web counters, message boards, and fancy dhtml crapola... then you care about this [] much.
Ever try SteelBlue (Score:1)
If you are intersted in web scripting languages similar to Cold Fusion, you may want to check out http://www.steelblue.com [steelblue.com] SteelBlue is a fully free and open source application server designed to produce dynamic database driven web applications.
The core design of the language is similar to Cold Fusion in that regular HTML is extended with special purpose tags for doing things like SQL, data type checking, making select boxes, etc. This is supplemented with a "Eval" language that is similar in syntax to C. There is also a library of a few objects that can be manipulated to do things like parse XML or manipulate JPEG files.
In addition hooks have been built to allow easy extension of the core language by anone who can write C or C++.
This code is newly open sourced, so we are looking for whatever feedback we can get...what we have gotten so far has been good, so people seem to like it. Now all we need to do is get more people to see it! -Al
ZDNET loves $$$$ (Score:1)
I guess open source just doesn't buy enough advertising. We probably should be grateful that they even mentioned perl.
The fact that they picked ColdFusion... (Score:1)
ColdFusion is not an OO language, it is not even a structured programming language (you can't write functions that you call elsewhere in the same file). This means that any non-trivial web apps rapidly grow into an unmaintainable mess of code.
And in spite of their benchmarks, any procedural code in CF is dog slow. If you hit on a bug (and there are quite a few) that causes problems with what you trying to do, you cannot switch app server vendors as you would with JSP.
It may have been faster that Tomcat, as configured by them, but this does not mean that ColdFusion is faster than JSP. ColdFusion is interpreted, more so than Java, and is not nearly as optimised and researched as Java virtual machines are.
The one thing I would give ColdFusion credit for is DB access, which is extremely quick and easy. You configure a DB connection in the CF administration interface, and you then refer to it by name in the code, no specifying all the connection info. This allows you to create dynamic webpages that show DB records much more quickly than with the competitive systems.
In this regard, ColdFusion does for Web Apps what VB did for Windows desktop client apps, in that it allows very rapid development of frontends for databases. Arguably it is "the VB of web development", even more so than ASP+VBScript. But as you can imagine, the resulting code frequently ends up about as maintainable as a lot of VB apps.
ColdFusion (Score:2)
I'd have to agree with the article that ColdFusion has a quick development time and is easy to use. Also, and I saw this refuted above, but it is also extremely easy to maintain and more portable than you'd think.
I develop web applications for the USPS, and we use ColdFusion in the project I'm currently on; there are no portability issues to speak of with the basic cfml code. There *are*, however, portability issues concerning the CFX tags (ColdFusion extensions written in C++ and compiled as shared objects) and *anything* that mentions Java. I attribute the Java problem with the fact that it's an environment nightmare to get anything written in Java to run on different machines. The CFX problem was unintended, but Allaire made an error when they compiled the server using Sun's native C compiler (for the Solaris version). If you use gcc to compile your libraries, forget it; it will ungracefully crash and burn.
So what are the downfalls? The same pitfalls come with ColdFusion as with anything not open-sourced. They don't fix their own bugs in a timely manner. I have personally discovered two bugs, one of which is really getting in the way of development (and stability), Allaire has officially recognized both and escalated the situation, but there are *no* patches to fix these problems and no sign of any help.
If PHP had problems as large as these, were notified about it, and didn't have it fixed with amazing haste, I'd be disappointed.
That's worth a lot more to me than being able to teach an idiot how to code and make it work, which seems to be the focus of corporate opinions.
It takes all kinds... (Score:2)
As for ASP, the mix ASP/COM is the Microsoft-blessed way to use the technology since the beginnings of 1999 (almost two years ago). So, yes, you must have a good C++ guy in your team, otherwise you will be unable to scale up for too long with ASP. PHP will take you a bit higher before entropy takes over. Python is even better (now if only Guido would put the braces back where Nature intended them to be...
Re:JSP/Servlets/EJBs in the financial sector. (Score:1)
It's proprietary to Sun's specs. There just happens to be a large enough user base out there to make it seem common.
2. A lot of packages don't, either. Or if they do, it's more 'java bandwagon' hopping than true support. Our latest experience is with the Adobe Acrobat 'bean'. Adobe seems intent on making it as hard as possible to do PDF work on non-MS platforms (no acrobat 4 for unix, for start) and the 'bean' they released is pretty low quality.
They had a press release in summer 1999 saying how they were supporting Java through this PDF bean thing - the code we see in the Java itself is all marked 1998, and it's not been updated since.
Not saying all developers are like this, but do some research before jumping into Java - just because people say 'works with Java!' doesn't mean it actually does.
4. There are some inconsistencies we've come across between platforms that don't lend themselves to 'write once run anywhere' java mythology. Keyboard issues, for one. Also, Windows Java support is different than Linux, for example. I'm sure it can all be 'worked around', but it's not simple. (these are more 'graphic' issues, perhaps not important for server-side java work).
Re:Altogether a poor article (Score:1)
the article mentions both python and perl on the 3rd page [zdnet.com].
Perl is the mother of all scripting language
the article actually calls perl "The granddaddy of open-source Web programming languages".
What the hell? (Score:1)
It makes absolutely no sense!
Re:JSP is not a scripting language (Score:1)
Re:Web Scripting Languages (Score:1)
PHP Hard to Learn? (Score:4)
On the other hand, I do think PHP needs a more consistent DB API. (I think they are working on it.) But ASPs is only consistant because there is only really one direct way, ODBC. If you only used ODBC on PHP all your code would be more portable among DBs. But it's much more fun to use FreeTDS to hit a MS SQL server with a Linux/Apache/PHP server than an expensive ODBC driver.
I've also found that all of our contractors that we have hired that know ASP learn PHP very quickly. They all have the same comments about the PHP code being much smaller and easier to read. VBScript that is used in most ASP pages just doesn't quite fit the web as well as PHP.
And another thing. ColdFusion is the cheap way to start a web project? I guess that fits if you rate PHP hard to learn and expensive to develop, but $5000 is a hard price to take up against free for almost anything else. Sounds like Dilbert logic to me. The most expensive product will obviously make our programmers more productive.
Irony in benchmarks and slashdot response. (Score:4)
For the first time the benchmarks where not the main focus of the article, but the ease of uses and development time in getting to market. I do stand behind their opinion of ColdFusio being something that is easy to get going and something built in one weeks time, but then you will run into the same problem w/PHP.. a bunch of code that is not reusable.
Tomcat/JAVA is a great development platform. The PagePerSecond is not that relavent because you can load balance hardware and
I do agree that there are some performance issues with Tomcat, but those are easily fixed by using something like Resin (GPL) or Orion (Commercial). Lots of small companies are looking for quick and dirty solutions that fit the budget. (Free)
--------------------
Web Scripting Languages (Score:3)
I've been developing with most of these "web" scripting languages this past year, and I can tell you one thing about all of them:
They suck.
Yes, it's true.. ColdFusion is nice for rapid, small applcations, but anything over that you will be grinding your teeth because of limitations of the language.
PHP.. PHP is in the same boat, but you can develop middle-sized applications before grinding your teeth. The language itself feels likc one giant hack and there is WAY to much built-in, no module support to speak of, and the "unified" DB driver sucks (ODBC has a performance hit). It's shoddy OOP and function support causes headaches.
Java Servlets take FOREVER and a day to develop; ColdFusion and PHP beat the pants off of Java anyday; However, like I was telling my boss, "With Java, everything looks like a nail..."
Can't speak for ASP, but I can say...
Python. It's a better language (syntax, semantics, libraries, modules, OOP) than PHP any day.
So, THAT's how Microsoft does it (Score:4)
"When performance does become important, various techniques are available that can make dramatic differences in speed. For example, Microsoft Corp. has rewritten the Nile benchmark we used in these tests..."
So that's how you get the big speed, to hell with the application, rewrite the benchmark itself! *grin*
Re:PHP *is* relatively new (Score:2)
PHPLib actually does a pretty decent job of addressing this problem in php3, but php4 didn't take that particular lesson from phplib.
They didn't "single out PHP", they made some constructive criticism. All you slashdroids need to learn the difference.
--
"Don't trolls get tired?"
JSP would've done better (Score:2)
Re:Why we switched from ASP to JSP/Servlets (Score:2)
Okay maybe not. I have used ASP, and I did not find it all that. I have used PHP, and I liked it better than ASP, but I find both a bit slow and 'limiting'. ASP is usually done in VBScript, so if you have had any experience with Excel or Word Macros then you would feel right at home.
I think perl is actually better, but for true speed I'd use C.
I have heard of JSP servers going down when the garbage collection suddently kicks in. Think of a busy web server that does not have time to do its garbage collection. At some point it needs to do so and when it does, everything else stop or slows. This is just a part of Java though. It happens in any one of these languages that the authors mentioned too. Perl is better about garbage collection I think than Java, at least in my experience with the two.
DON'T use tcl, or you will regret it.
I don't want a lot, I just want it all!
Flame away, I have a hose!
Re: WebObjects == great technology (Score:2)
It still does. The main Problem with JSP's (& ASP's and CFM's) are that they are all the same. It is *possible* to design a good app using them, but the default paradim encourages lazy coding and mashing all of the Code & HTML & Data Store logic into one file. A gauranteed recipe for non-reuse, non-OO encapsulation, and headaches down the road.
Model-View-Controler (MVC) is the core of most good design patterns. It seperates out the display logic, from the business logic, from the data store issues. WebObjects has this design pattern in its DNA, they've been doing it since way back. Multi-tier logical seperation of functionality is a GOOD THING.
No matter what tool you are using, read Design Patters by the "Gang of Four" (tm) and Refactoring by Fowler. It will allow you to make a good design using any technology. Design Patterns was written and based on several peices of old NeXTStep technology (Foundation). And, they've been improving WebObjects constantly over the years. Check out the OmniGroup mailing list on WebObjects [omnigroup.com], a lot of Apple developers subscribe to it.
I think people should use the right tool for the job. I happen to use WO because it lets me be more productive than any other middle ware technology I've used (and I've used all the major ones). BTW: re Java - WebObjects supports pure Java (and will support Linux in the next version due out RSN).
-POIU
---
PHP -- the best of the worst (Score:2)
--
Re:Altogether a poor article (Score:2)
The exclusion of Python is also unforgivable. Just a look at Python's API is enough to notice how serious this language is becoming.
What about Roxen? (Score:2)
/ The Arrow
I chose PHP (Score:2)
A Few Clarifications on ASP & JSP (Score:2)
And as far as JSP performance goes, i did not see it mentioned anywhere that JSP pages are compiled into servlets the first time the page is accessed. this means the first page view is extremely slow, but every page hit after that is significantly faster. ASP+ also will compile the pages as opposed to interpreting them on the fly as ASP does.
ASP, in my opinion, is easier to write mainly as a result of Micro$oft's extensive development tools (Visual Studio and it's close ties to MS servers). but JSP can run on almost any web server- with little or no code changes- and it's not that much more difficult to write. And now there is the J2EE spec which claims no code changes are necessary if the spec is followed (from experience this is not true, but *very* few changes were needed to move an app from NT/JRun to iPlanet). I haven't used the other languages mentioned, so i can't speak about them.
hmmmm (Score:2)
CF and ASP should be bottom, PHP should win, and JSP should be the web-scripting to come, I see huge potential in JSP, but it's so slow...
Porting the M$ ADO to PHP would be the greatest thing that has happened to PHP since the new scripting engine... But then again, we'd loose all our nice db classes =)
JSPs perform poorly on Tomcat (Score:2)
Tomcat != JSP (Score:5)
Neutron
JSP Performance (Score:3)
ASP, JSP and servlets (Score:2)
At my current (dot.com, internet travel) company, I'm writing Java once more, and it's a pleasure- the only problem is that the front end of our site is naked servlets, dating from pre-JSP days, and we use our own propriety template symstem to generate the html- the template system has really starting to creak at the seams and it's not flexible enough to cope with our needs... we'll be swtiching over to JSP (possibly mixed in with some XML/XLST) soon....
Cold Fusion vs. PHP (Score:3)
Re:and perl is where? (Score:3)
Sure, perl works great as a quick way to put out code that works - but remember that it was designed as a report language, not a dynamic content engine. While there's an apparent similarity of these two tasks, they scale very differently.
Re:Curious scoring (Score:2)
---
Re:Why we switched from ASP to JSP/Servlets (Score:2)
TCl is also used in Story Server and that program sucks. It is slow, it is not scalable, it forks processes as does ASP each time you go out of the . There are much better and faster things that tcl.
I don't want a lot, I just want it all!
Flame away, I have a hose!
A few notes on their ASP evaluation (Score:2)
This tends to make my job harder, not easier. But then I cut my teeth on Pascal, C and Java, not VB. I, for one, don't like my variables shape-shifting on me (and they do that, just as they do in Perl). Well, the solution there is to use JScript, or write your error-prone stuff into functions (such as ADO SQL queries, object creation, etc.) so you only have to write the error-trapping code a minimal number of times. Code reuse = good They are? The only decent one I've found is Visual InterDev, and it's lacking a lot of features that other MS development environments have and developers come to depend upon. And it's only in its second version.
The biggest thing that they left out is the documentation. In some places, the ASP & VBScript docs are great, sometimes they suck, sometimes they're just plain wrong, or nonexistent. Every time I go into MSDN, it's a crapshoot unless I'm looking up something I had looked up previously and need a refresher on (like which is the search string and which is the string being searched in instr(); the tooltip just says "string, string2").
The article also glosses over some of the completely undocumented, or barely documented, things that really drive developers nuts. Like when will 4-digit years be displayed, and when will 2-digit years be displayed? Answer: unless you write your own function to split the date into its pieces (day, month, year) and compose a string, it depends on the server's regional settings and the currently-logged-on user's regional settings.
web SCRIPTING languages. (Score:2)
Re:Web Scripting Languages (Score:2)
Java Servlets and JSP is basically a "Slow Prototyping" environment and the long time it takes to just change a single line of code and then give that a try simply makes JSP a bad choice.
PHP has been good to me for small projects, but recently a PHP based application blew up in my face when our client started a cooperation major web site. Basically, we got slashdotted and PHP showed that it did not scale well, despite having a really big machine.
Friends have made me turn to Perl/FastCGI and we are currently moving the above-mentioned PHP-based site to this. Let's see if this serves our needs.
------------------
Re:PHP IDE (Score:2)
On a side note, if someone were so inclined (maybe me when i have time) we could use mozilla to create a PHP Studio similar to what people are working on for zope.
Re:Tomcat != JSP (agreed) (Score:2)
Re:PHP Hard to Learn? (Score:2)
Now, at work we occasionally have to work with CF. I find it's coding style and syntax clumsy: everything needs a stupid tag around stranglely named commands like CFIF, CFELSE, CFENDIF, etc. And I can't seem to find good help resources online.
PHP's coding style let's you insert blocks of code into your html wherever you want, it doesn't require excessive tags, it's easy to modularize with include files (CF might allow this but I haven't found it yet), functions, and even object-oriented programming.
So I guess I just haven't had the right experience with CF or maybe I would like it better. But for my money (and PHP don't cost none!), I'd go with PHP.
Re:PHP Hard to Learn? (Score:2)
They get their design ideas together and hold a meeting to decide on a platform. I've been selling my friend (their most IT-non-stupid member of staff) on a Free solution (php) and he puts this point of view at their meeting. The management decides that Cold Fusion is what they want.
They buy Cold Fusion and hire a developer (spending about 2 grand) The developer screws up and doesn't deliver anything that looks like it's going to work. Panic, as they have demo and launch dates looming.
After getting the go-ahead from management, my friend locates an off the shelf php app that does most of what they need. He's now modifying it to fill in the gaps, and both their launch and demo have been successful.
Now I'm not drawing any conclusions about Cold Fusion - they were unlucky with their developer - but it's interesting to consider:
More proof of Java's inferiority! (Score:2)
Also, consider one thing: the only scripting language that ASP didn't beat out was PHP. So before you go assuming that all of Microsoft is evil, think about the things that they did right: ASP's performance, as shown in this article; DirectSound and DirectDraw, which still beat the pants off of OSS and svgalib; and Win2000 Professional, proof that an NT workstation can be as versatile as 98 and still be ultra-stable.
Safety and ad hoc adaptability (Score:4)
For two reasons, and they're both true:
(i) A lot of web programmers simply don't have the background to use professional development standards, nor the attention span nor attention to detail required for successful non-trivial programming in C or C++. As a result, if they used these relatively low-level tools the result would be fairly horrendous. It's *much* easier to generate buggy code in inherently unsafe languages than in safe scripting ones. Pragmatically, it makes sense.
(ii) The web moves at a break-neck pace, and there just isn't the time to produce a well engineered product using C/C++ before the requirements have changed yet again. Scripting languages allow you to make ad hoc changes without blowing your whole foot off every time. Errors tend to be comparatively minor, easy to diagnose, and the language usually stays in control rather than bombing out altogether.
In a nutshell, scripting languages make a lot of sense in this application area. That said, they're definitely not the answer to everything.
ColdFusion (Score:2)
Some shortcomings include the fact that it isn't a top speed performer, but to be honest, the bulk of websites out there will run perfectly well given a reasonable server environment and intelligently-written code. That last note, however, points out CF's biggest weakness: it's all too easy to code in for idiots, so you'll often end up with idiotic code if your project isn't managed properly. Yes, any web developer can pick it up and run with it; this is a Good Thing (I seem to recall something about 'more eyes' being good...) So long as you have a competent tech reviewing and leading code development, you can get some pretty nifty results from Cold Fusion.
Cold Fusion's greatest weakness is spawned directly from it's greatest strength: it's a damn easy language to learn and use. If you're good, you can do some slick stuff really, really quickly; if you're not so good, you can spawn a codebase that is impossible to maintain. Blame the meat, not the product.
JSP/Servlets/EJBs in the financial sector. (Score:2)
Re:and perl is where? (Score:2)
Re:Curious scoring (Score:2)
Whilst ADO may provide a common interface to all the DB implementations the datasources do not all support the same features - you would struggle to use an Access datasource for any 'real' db application, it's just too limited.
JDBC is almost identical to ADO in alot of its functionlity and the drivers supplied by various vendors seem more coherent than using ODBC connections through ADO. You often get many errors when using JDBC via ODBC and so far I have yet to see one which is a limitation of the Java side of things!
All in all I'm sure that there must be a better way of handling database access than through either ADO or ODBC... if only someone would ocme up with it!
Re:Curious scoring (Score:2)
---
PHP IDE (Score:3)
From personal experience I would put ColdFusion and PHP tied for the top slot. CF is cleaner and easier for building small apps but PHP has MUCH better support and is better for medium size apps. Not to mention the easiest to learn. ASP sucks. Really there is no such thing as ASP since its really a hodgepodge of VBScript, JScript and HTML. With Microsoft's .NET it gets even worse with 16+ languages available. PHP is simple, has decent string handling and excellent online support. PHP+Apache+MySQL is a killer combo. Want an easy install? Check out PHPTriad [phpgeek.com] for Windows. Chances are than any question you could come up with has been asked and answered in one os the the support groups [theaimsgroup.com].
Re:Tomcat != JSP (Score:2)
Also, I just have to note that nobody mentioned the testing methodology. Were they running the JVM for a long time? Or did they just fire it up for a few seconds? In the long case, the JVM will get into a steady state. In the initial case, most servers will be creating new objects and threads until they have adjusted to the load. A good rampup time is around 20 minutes.
Article (Score:2)
Now in all of the languages with low pages per second I want to make a few comments.
First just as an example since I do CF about half of the time where I work ColdFusion has features examples, caching queries, structures(NOT C like structures think associative arrays), XML transformations of data (WDDX), and several other features that can make things such as pages per second irrelevant.
I am also of the opinon that they did very little tweaking of these servers because my own test results reflected much higher amounts in almost every language, putting CF, Php, JSP all on the same playing field.
They used Tomcat beta 5 to determine that JSP could only do 13 pages per second.. what kinda valid test is that against polsihed products like php and CF??
The point is that part of the test IMO is totally invalid.
Now to move on to some finer points of the article that further reflect IMO the fact that the reviewers were biased.
They reffered to php as an esoteric language and rated it as a C, an A being the best, in programmer productivity, this has PHB speak, and marketing written ALLLLLLL over it.
So my basic conclusion is that this article is basically useless and it is nothing more than fun to read....
I wont even touch the fact that each langauges have different feature sets that make them very well suited to certain orientations of development....
Blah, Use your own brain and experience, once again ZDNet proves to me they have some clueless people.
Jeremy
Cocoon is slow (Score:2)
Maybe the performance will be better once version 2 is out. But I doubt it. The solution is probably in processing XML/XSL on the client
Re:Altogether a poor article (Score:3)
PHP is an evolved language, and it really shows. There wasn't a conscious and conservative philosophy behind it. That's both a plus and a minus -- but I think more minus than plus. Everything is there, and that's great -- but it's hard to find it, or when reading code to figure out where it came from.
I can also understand why they didn't cover Perl or Python, because both of these aren't really web scripting languages, they are general purpose. Of course, there are HTML embedded versions of both of them but they don't seem to have caught on, which is too bad. And Zope/DTML/Python isn't really scripting either, but considerably more than that (though I'm under the impression that Cold Fusion attempts to be something similar).
Re:So, THAT's how Microsoft does it (Score:2)
But the original poster dude seems to think it funny that Microsoft made the changes. So funny in fact that he stopped reading in the middle of a sentence, and thus completely missed the point of the article...
"Our design goals for writing test applications were to keep the algorithms as similar as possible on all platforms (for comparability) as well as to write code that was easy to understand and quick to develop. Fast performance was not a goal."
"When performance does become important, various techniques are available that can make dramatic differences in speed."
(My bold, again)
What's funny is the hair-trigger, knee-jerk, tenuous-as-you-like anti-Microsoft brigade, like this guy and the moderators who thought he was meta-funny.
On a more serious note though, it's important to realise that different products are often aimed at different niches, and a "one size fits all" benchmark is close to useless.
Altogether a poor article (Score:5)
a) Python, Perl: How do you write a serious article about web scripting languages leaving these two out? Perl is the mother of all scripting language, Python is a rising star with lots of supporters and amj already huge codebase. And both perform as well as any of the examined technologies.
b) Their priorities were "of speedy development, ease of use, and a complete and powerful API". In a real corporate environment, maintainability and portability would probably outshine all three, ruling CF and ASP out (my opinion, yuor mileage may vary) and leaving the stage for PHP, Python and JSP (more or less in this order, from worst to best).
c) How on earth would COM support make ASP harder to write? In my experience, access to COM objects let you write smaller and sipler scripts.
d) PHP is probably as easy as ASP to learn, it fells rather natural to any C/C++ programmer and it has probably the most powerful API for Web programming of the pack. The the author did not had the time or the will to learn the APIs ("Users must make a concerted effort to keep track of the indepen dently changing components of PHP they are using")
e) Also, the lack of an standardized database API in PHP is botha curse and a blessing. First, there are some PHP libraries out there addressing this issue. Second, the trade here is speed for convenience. Third, all data acess function were made similar, so changing database is not harder than it should be. And finally, PHP supports ODBC.
f) Tomcat is a reference implementation. There are faster alternatives out there.
I will not go on. Forget this article.
If you need speed, ease of use, a fair price (let us say, zero or less), good portability and good mantainability, use PHP, Python or JSP. Or even, if you are really sure your code will never have to leave a Windows box, ASP/COM.
Re:So, THAT's how Microsoft does it (Score:4)
"For example, Microsoft Corp. has rewritten the Nile benchmark we used in these tests in several ways to demonstrate optimization techniques. The company ended up with an application with quite different application logic and database design from ours (but that generates the same pages we do) that runs about twice as fast as the speed of our version on similar hardware."
There you go, and I added some bold of my own. How do you like that?
String processing (Score:2)
As an aside, I think Delphi is one of the most suitable traditional compiled languages for web development. That's because of the decent string support, the clean and readable syntax, the good speed, and excellent database connectivity.
The other main advantage that scripts offer is cross-platform portability. A set of PHP pages should port pretty well from Linux to Win32 depending on what they do. The same can't be said for binary DLLs or even their source code.
Since when has ASP been a language? (Score:5)
As far as I remember ASP was designed to be a sort of glue that holds together a bunch of custom COM objects and DLLs. It was designed to be an operating environment.
In my experience building dynamic web sites (not much.. few years) ASP and PerlScript, with a drop of VB in times of boredom, have always been a good, flexible team. Depends what you're doing..
there's more to web scripting than that (Score:2)
There are *many* technologies out there to do these things right. Apache with mod_perl and either AxKit or the Templating Toolkit (or others) can do it. I hear PHP can do it using the right libraries. Java servlets, for all their verbosity, can do it using something like go.com's Tea system.
I have never used ColdFusion or ASP myself, but I know many people who have, and I've repeatedly heard that they're great for quickly building something, but very bad for managing complexity.
Re:and perl is where? (Score:3)
Perl can't be taken seriously as a high-end web site development language.
Howso? Oh wait, I think I hear something:
For large complex sites (slashdot really isn't either - it's a very straightforward single application), perl just doesn't have the performance one needs, and it is very difficult to maintain.
Where's the proof? Mod_Perl takes up a whack of memory, sure, but the speed is right in line with the rest of them. What large, complex site doesn't have a cluster of machines with a shitload of memory on each? And as far as your maintainability arguement goes... I can show you code in just about any language which is a nightmare to maintain. Hell I could show you spaghetti code in C++ which I personally thought was impossible until I started cleaning up one particular in-house project.
Perl may seem to facilitate nasty coding practises but in reality it all comes down to the programmers. Are they going for geek machismo or are they working toward something which is maintainable? Perl has a wonderfully clean OO syntax; I prefer it to C++. The built-in regexps are great for formatting stuff after the database has had its try.
Perl ain't perfect, but it is certainly up to the task, IMO.
this article is pathetic (Score:2)
Re:Altogether a poor article (Score:2)
a) It still seems to suffer from performance problems.
b) It is not portable.
c) CF experience is not transferable from a field of application to another. With Java, PHP and ASP, I can easily use/hire developers without web/internet experience and have them learn something that will complement their knowledge (in Java, C/C++, VB, respectively). And the contrary is also true, I can easily take the web developers and grow them into full-fledged programmers. It does not seem to aply to CF.
As for your first point, I never said Perl is easy to learn. I was only pointing that leaving Perl out is unfair and incorrect. Perl codebase running real life sites probably outnumber CF,PHP and JSP codebases taken together. And what you say of CF is probably true for Python or ASP too.
PHP relatively new: (Score:5)
Is this a joke ?
PHP has been here since 1994. It's older than the other languages in the chart.
Also, they state that PHP has no uniform database API: This is false:
You can use ODBC for all kinds of database. However, you have the alternative of using the direct APIs to improove performance.
Re:PHP with JavaBeans, Best of Both Worlds (Score:4)
Meanwhile you will have ended up with two different languages to support in the same production environment. This may not be a problem for a small design shop where you have a couple developers that know both languages and the code that everybody works on; but in a big company environment, it makes life very difficult.
Despite being a useful "hack language" to create small, simple contraptions; PHP is not exactly the most readable/maintainable language on Earth. Add to that the thousands of Web designers who believe they became programmers by just writing some simple logic in PHP, and you have a lot of poorly written code in a poorly documented (yes, I know about the online manual. Go see for yourself how poorly Oracle functions in PHP are documented, for example.) language. Just like Perl, the flexibility and power comes at the expense of readability and maintainability.
I fail to understand why anybody would want to use PHP with JavaBeans if they know enough about Java to figure thise setup in the first place. I don't think there is anything in particular that you can do with PHP but not with JSP. I don't think the JSP functionality can extend any more, since anything that can be done on the server side in Java can be done in a JSP page.Re:Web Scripting Languages (Score:2)
Maybe it's just me (correct me, I'll thank you!) But I seriously fear that PHP doesn't follow the basic principles of parser construction, and that the object system was a total hack -- not even a messy language extension (which would be bad enough), but just a straight out hack.
Re:PHP IDE (Score:2)
It bring several advantages over the current ASP model (and some much-needed changes IMHO):
Code is stored separately from HTML
On first run, code is compiled into native x86 binaries which are cached until you edit the source again
There are no more "script" languages -- you can use full VB, C++, C#, perl, COBOL, or any other supported language. (I fail to see why more choice is somehow a problem)
You can mix languages in the same project if you wish -- your web classes can be written in high-performance C++, but glued together via Visual Basic for maintainability. You can even inherit and override the C++ classes in VB
Security model -- all ASP+ pages run under a security context. If the user under which your site is running doesn't have access to write to %systemroot%, then any attempt to write to that directory will yield access denied.
.NET runtime is planned.
All of the functionality is based upon the Common Language Runtime. Since all the languages are full-blown, you can do just about anything you wish (provided your service is running under a user context that supports what you are trying to do.) Also, a *nix port of the
-----
Re:Web Scripting Languages (Score:2)
True, the ODBC layer has a performance hit, but there are abstraction layers out there that give you a consistent API, phpLib for one. I don't use phpLib, I've got my own class library that I wrote. I can use mysql, msql, mssql, sybase, oci8 or pgsql by changing one variable in the little file I require() that's got db connection/auth data in it.
Also, pay attention to the PEAR project that's a part of PHP 4.x. They're working on a unified DB class.
--
Errata (Score:2)
scripting languages
an already huge codebase
access to COM objects let you write smaller and sipler scripts.
simpler scripts
The the author did not had the time or the will to learn the APIs ("Users must make a concerted effort to keep track of the indepen dently changing components of PHP they are using")
That the author did not had the time or the will to learn the APIs ("Users must make a concerted effort to keep track of the independently changing components of PHP they are using") does not change this.
Preview is your friend...
Re:Tomcat != JSP (Score:3)
I will chime in with my own little opinion that it is far cheaper to buy the hardware to get the performance you need from any technology you choose (within reason) than it is to train a staff to a new technology.
And the best example of tuning a Java web app I've heard was a bank's app running on a 16-way Ultra-Sparc. Not pleased with performance they considered moving to an E10K. Then someone pointed out that they were using green threads. For the non-Java guys, green threads (as opposed to native threads) are managed by the VM and cannot use multiple CPUs. Their app was pegging one CPU and leaving the rest idle. Moving to native threads gave them an instant speed, um, boost would be an understatement.
Abstract Database access (Score:3)
ZSQL Methods are completely independant of your actual database and you can change your external database with a couple of clicks (if you need an external one in the first place. Zope has a long running persistant object system of its own which keeps instances of things alive along with their data until you specifcally delete them - even between reboots!
The underlying Python DB access is specific to whatever database you use but in Zope Land it is wrappered around Zope DB drivers which the ZSQL Methods talk to. Similar to what the DB.php stuff in PHP4 does but with a more compelling reason to use it.
They also encourage code resuse as you can template your queries just like your HTML..
SELECT * FROM users
<dtml-if username>
WHERE user=<dtml-var username>
</dtml-if>
Then when you call them, their magic happens and out pops the results in a python list.
Made me wonder if they included Zope in this round up if Zope would have A or D for tools, its web interface being its own tool really.
Phill
JSP's and Older Techs (Score:5)
Re:phplib (Score:2)
----foo.php
$username = "Bob";
----foo.ihtml
Hi ! How are you today?
---
as noted, it's not as nice as the phplib templating, but it's better than nothing.
--
"Don't trolls get tired?"
What about Cocoon? (Score:3)
Anyone who has to design, implement and support large, web-based applications should check out Cocoon.
Neutron
webmacro (Score:2)
Check out WebMacro: webmacro.org [webmacro.org]
WebMacro is a Java servlet template engine which allows you to separate this stuff. You write pure Java code in the back end, and straight up HTML with some formatting codes in the front.
It makes everything really clean.
Re:PHP Hard to Learn? (Score:2)
You pointed up a good difference between open source products and proprietary ones: cost vs value. I haven't used Cold Fusion myself, but I have used Lasso extensively and that's one of the main proprietary competitors for ColdFusion. One of the big problems I've had with Lasso is getting help when I'm stuck. For a product that costs at least $1100--for a fairly stripped down package--, I want to have some kind of support at least for the first 90 days. About all you seem to get from the vendor these days is a mailing list and searchable archives. Big deal. You get that with PHP, and its free. So, my question given that Lasso, ColdFusion, and PHP do the same things, is what is the business case for using one of these closed source products? And in terms of a DB API, you're right everyone is using either ODBC or JDBC these days and PHP supports ODBC, so again, what do products like ColdFusion and Lasso give you that open source systems like PHP don't? Is it a warm fuzzy feeling that some corporation is "supporting" the thing? BTW, I'd like to point out that I'm not singling Blue World(Lasso) out by any means, its just that I've noticed a trend for diminshing support and candor among vendors in general thats been going on for a decade. This is one reason why open source appeals to me so much.
PHP *is* relatively new (Score:3)
Have you written any large projects in PHP? I mean really large, mission-critical projects. If so you'll quickly see that while it has strong points, it's far from perfect.
The database connectivity is far from perfect, and ODBC isn't the magic bullet some people like to think it is. While you can use ODBC to connect to an Oracle database, it will offer significantly lower performance than using the ora_ functions.
If you want an example of the lack of uniformity in the database API, look at odbc_fetch_row, it takes a statement handle, and optionally a row number. If the row number is omitted, it returns the next row. Now look at pg_fetch_row, it takes a statement handle, and a mandatory row number. If you omit the row number, it just plain doesn't work.
Look at the functionality of something as simple as 'break'. One would assume that break would exit any looping construct, whether it be for, foreach, or while. Well, you'd be right that it exits for or while, but it doesn't exit a foreach.
And there are other inconsistencies too, which are obnoxious, for example 'is_array, is_long, is_dir, and is_double' all do what you'd expect. but it's not 'is_set', it's 'isset'. If you take a reference to $this in the constructor for an object, it's not the same reference that the new class returns. (Bug 7454 [php.net])
And they're right, debugging support for PHP is horrible. The debuggers that are out there only work on certain versions, so if you're doing development against the CVS version of PHP in order to get the latest bug fixes, they won't work, because of changes to the Zend internals. error_log is the equivalent of debugging with printf, and if you add your own error handler, there's a bug which prevents it from showing the error message. (Bug 7283 [php.net]).
PHP has been here since 1994, but it's been massively rewritten at least twice. Once in PHP3, and again for PHP4. It has a lot of potential, enough that I'm using it on large, important projects. But I wouldn't dream of using it on a large, important project that had to be done in 2 weeks. The language still needs time to stabalize.
--
"Don't trolls get tired?"
Why we switched from ASP to JSP/Servlets (Score:2)
But in terms of performance, my company moved from ASP to JSP for performance among other reasons. My company creates Intranet solutions, Web-based training, dynamic-content Web sites, etc.
ASP has a few major glaring issues.
1. Performance: When scripts are asked to perform complex operations, such as dynamically creating one of our site administration screens that have more tables, frames, than a big horse can ----, ASP crawls. As our systems got more complex, we moved them to VB COM components, and later to VJ++ COM components for speed. When we started switching to the full Java technologies, the testers reported a big increase in speed and usability, even though the applications were getting more complex. Before we "officially" switched from ASP to JSP, I ran a few very practical tests on both, to see how fast they might run in our applications. JSP flattened ASP, normally by a factor of 10, sometimes by 100. (I did this test 18 months ago, with Apache JServ)
2. Less bugs in my code. ASP is a breeding ground for bugs. Because its interpreted, SYNTAX ERRORS can exist in your code and you won't know about them til some client calls up having used some obscure branch of an If statement that missed testing.
3. Less bugs in their code. Ever heard of a "Catastrophic Error?" If you haven't you haven't used ASP for long enough. If you use this technology for a long time AND REALLY PUSH IT HARD, it will snap on its own. This is my biggest problem with ASP. I've had cases where my code was correct and when executed would nearly bring down the server. The solution was sometimes as simple as switching the order of two non-initialized variable declarations.... this leads me to believe there are great flaws within the ASP engine. Because no one can probably believe this point, let me just give you an example....the following program might work:
Dim A = 5
Dim B = 6
Foo A, B
While this one might bring the server down:
Dim B = 6
Dim A = 5
Foo A, B
I've seen this happen! I haven't the slightest clue as to what caused it, but it often happens on very large scripts (running the above code isn't going to demonstrate the problem).
PHP with JavaBeans, Best of Both Worlds (Score:2)
Cons: Relatively new; few tools; lacks unified database API.
Bottom Line: Not mature enough yet for widespread corporate use, but holds promise.
--------------
I have starting moving my web development projects (at least the largest one I am working on) to a PHP/JavaBeans solution. I no longer have to mess with any of the database API's in PHP, as my JavaBeans do all the dirty work. Currently, JSP seams to be very immature, based on the research I have done.
Using a PHP/JavaBean model, I try to keep the API (HTML) layer as thin as possible. In addition to being able to add other interfaces easier (XML, Java Applet, etc.), I can easily migrate to a JSP front end if the JSP functionality catches up and/or passes PHP. There are currently some things my site currently does in PHP, which JSP does not support, and would take way to long (and more java skills than I have) to program into a bean.
This should prove to be an interesting discussion to read through.
-Pete
phplib (Score:2)
--
"Don't trolls get tired?"
Re:Why scripting languages? (Score:2)
Also, I think people often envision themselves running Amazon-scale services with thousands of hits per second and therefore need CPU usage pared down to the bone, but practically I think many Web sites are low-volume. The one I work on for my day job probably can expect 5000 or 10000 registered users, tops, and so the CPU is never heavily loaded at all, so there's no reason to give up the ease of programming and debugging for unneeded speed improvements.
Or AxKit... (Score:2)
For the person in this thread saying that Cocoon is slow, you might be interested to know that Covalent had to drop Cocoon and replace it with AxKit for the Apache mailing list archives at http://archive.covalent.net/ - I don't have specific details of why Cocoon couldn't hold up (it continually crashed when the hits went higher than 3 hits/sec), only that AxKit does hold up to the strain (Of course, I'm biased)
HTML::Mason (Score:2)
http://www.masonhq.com [masonhq.com]
All the goodness of Perl, embedded in your HTML.
<cynic>
But of course, they'll never get advertising dollars from this...
</cynic>
Recommendations for JSP server (Score:3)
Any others I should be considering?
If you like ASP, wait for ASP+ (Score:2)