The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

I'd just like to point out something - just because ASP.NET (and JSP, for that matter) is overall technically superiour to PHP, it doesn't mean you should use them in every case, like Chris says. PHP is dirt-simple to get started with, and it doesn't take long at all before you have written your own applications and can customize others. The road to beginning JSP or ASP.NET is significantly bumpier unless you already know Java/C++ well, and if you are only doing a weblog or a simple one-time brochure style site, both ASP.NET and JSP are totally overkill, and you will only be wasting time by learning it.

Originally posted by voostind Since I can't deny .NET's technology is better than PHP's, I'm now looking into another one: JSP. I will not use .NET, nor will I tell my customers to do so. The technology may be good, but as long as Microsoft doesn't change its licensing policy, I refuse to work with it (as many other should but don't because they don't know the licensing policies). I'm not going to 'sell my soul to the devil'.

Java is much more my language than PHP (I'm an OO guy), so I think JSP is going to suit me just fine. Expect the 'Top 10 Reasons Why JSP Is Better Than ASP' in a few weeks...

Vincent

I've looked at JSP earlier, and it seems very good. The problem was that when I tried it, Tomcat (the JSP thingy for Apached) was pretty much crap. It took me friggin three days to get working - I've heard it's much better now, though.

Many of the good elements in .NET and ASP.NET are actually taken from Java and JSP. ASP.NET kind of works like JSP, and Web Forms are pretty much ripped off from JSP:s Jakarta Struts.

The advantages .NET has over Java is that it's MUCH faster and can be written in several languages. I've also found Java to be harder to get started with, but that might just be me. Java has the advantage of a friggin enourmous credibility, existing support for many platforms, and of course, you don't have to sell your soul.

I'd just like to point out something - just because ASP.NET (and JSP, for that matter) is overall technically superiour to PHP, it doesn't mean you should use them in every case, like Chris says. PHP is dirt-simple to get started with, and it doesn't take long at all before you have written your own applications and can customize others.

Of course. As I've mentioned earlier, I've written my graduation project in PHP just because it is the most popular server extension (I don't know where you read ASP is used more often than PHP, but that isn't true. Just look at Netcraft).

The reason I'm looking into JSP is because I'm certainly interested in Very Large Projects and I'm a Linux man. .NET doesn't work on that (yet), while JSP does.

I've looked at JSP earlier, and it seems very good. The problem was that when I tried it, Tomcat (the JSP thingy for Apached) was pretty much crap. It took me friggin three days to get working - I've heard it's much better now, though.

It must be. I just downloaded the latest binary, unpacked it and did a $CATALINA_HOME/bin/startup.sh and it worked!

The advantages .NET has over Java is that it's MUCH faster and can be written in several languages. I've also found Java to be harder to get started with, but that might just be me.

The speed-thing remains to be seen. On Unix for example, JSP is certainly much faster, because .NET doesn't even run... And I don't care much about the 'multiple language thing'. The expressive power of the various languages are equal, so why don't use just one? I know Java and C++, so C$ (sorry, that's C# ) is just a day's learning.

Originally posted by voostind Of course. As I've mentioned earlier, I've written my graduation project in PHP just because it is the most popular server extension (I don't know where you read ASP is used more often than PHP, but that isn't true. Just look at Netcraft).

PHP is used in greater quantity, yes, but I have always been under the impression that corporations tend to use ASP or JSP, rather than PHP. Not everyone, some use PHP, but mostly I see .asp or .jsp. If I'm wrong, could you please point out stats?

It must be. I just downloaded the latest binary, unpacked it and did a $CATALINA_HOME/bin/startup.sh and it worked!

Sweet! They are shaping up.

The speed-thing remains to be seen. On Unix for example, JSP is certainly much faster, because .NET doesn't even run...

Well, yes and no. Some daredevils wrote the J2EE Best Pracices Blueprint application, The Java Pet Store, using C#/.NET, and managed to implement it in 1/4 of the code and have it perform over 10 times faster than the latest published benchmarks of the J2EE application in independent tests conducted by VeriTest. See it here:http://www.gotdotnet.com/team/compare/petshop.aspx
Even if they somehow cheated as hell, that's pretty impressive! I don't see how the Linux implementation of .NET would be slower than Java, unless the Mono manages to produce a VERY crappy implemenation.

And I don't care much about the 'multiple language thing'. The expressive power of the various languages are equal, so why don't use just one? I know Java and C++, so C$ (sorry, that's C# ) is just a day's learning.

The expressive power of the various languages are equal, so why don't use just several? A more serious argument would be that it would take less rewriting to implement existing code into an application - i.e. you don't have to rewrite the syntax. But that's all a matter of needs. I personally couldn't care less about Javas cross-platform support, as it's all served through the web anyway.

adoption?

# People don't understand web services
# SOAP is insanely complicated
# There's no money around right now to spend on them
# SOAP "ties" you to UDDI - registries of web services owned and run by companies like IBM and Microsoft - people don't want to hand these guys so much power
# SOAP in fundamentally flawed and only theREST approach has worked out that XML services must be available via Google rather than a UDDI registry.
# or... because PHP rules the Internet and when we give SOAP permission to be successful, successful it will be

I worked for a time with a very large net consulting firm who had the largest web sites at the time (consumer catalog sites, I should clarify).

I was trying to push them into 'web services' in 1998 and 1999, before the term had been coined. 'Allow anyone to pull prices from the catalog programmatically and submit orders, track info, etc.'. Vehement responses AGAINST it at the time - "we don't have control over the user experience then", "branding issues", etc. They were/are a large MS shop, and I've no doubt they're examining web services now (because it's trendy) but I suspect, if they're still as involved in the creative end of things as they were, they'll not do it, because they'll end up losing out other revenue in the short term, and web services will marginalize them as a service agency in the years to come. Right now, exchanging data still requires a decent amount of thought/work to be coordinated. When that's as easy as clicking a few buttons, *they'll* be out of jobs.

Originally posted by voostind About Tomcat:
It must be. I just downloaded the latest binary, unpacked it and did a $CATALINA_HOME/bin/startup.sh and it worked!

Have you ever looked at cocoon? This is something I keep on coming back to... there's a couple of PHP re-interpretations coming along, but I haven't yet found anyone that's used the Original Java Version to see how good it is.

# Web Services are easy
# SOAP isn't complicated, and you don't need SOAP to run Web Services anyways
# Corps have lots of money to throw around, and the cost of developing web service-based sites in .NET is lower than any other language, since implementation time is so small
# Who cares? You don't need to use SOAP
# See above
# Riiight, and the US's public opinion won't drop when they attack Iraq unilaterally

On thing on the speed issue (.NET faster than J2EE?) - first of all for business, speed is never an issue - just throw more processor / memory etc at the problem. Secondly the Petstore claims from MS are widely accepted as hype. For why, see here: http://www.onjava.com/pub/a/onjava/2.../catfight.html

quoted from thread harry posted
I may be wrong, but I don't know of any credible organizations that have done performance testing of the two platforms. I would be wary of posts that say PHP "can produce a page in about 1/8 the time as a ASP.NET page can". Where does this information come from?

I think a little more research is in order given this explaination:
"PHP interprets all of its code inside of the PHP program itself, and since it is not accessing any other outside sources like COM objects."

ASP.NET does have the backward-compatibility to use COM, but does not use it in normal page processing. That statement may have been true for ASP 3.0, but it is not applicable to ASP.NET.

I'm not going to make any outrageous claims, but lets look at a few facts:

--PHP has been shown to be slightly faster than ASP 3.0.
--ASP.NET is 3 to 5 times faster than ASP 3.0 (an interpreted script like PHP).
--ASP.NET can use built-in "Output Caching". After the page is first accessed and compiled, it can be served from cache. No page processor is faster than cache.
--In default installations, ASP.NET is compiled, PHP and ASP 3.0 are interpreted.

Now knowing that, take your best guess at which platform is faster....

Also, the article you posted was interesting Harry, especially Sun's response (). I thought that the one line was the best:

The real question isn't "which is faster," but "if approach X satisfies my higher-priority criteria, will it be fast enough?"

Originally posted by M. Johansson
PHP is used in greater quantity, yes, but I have always been under the impression that corporations tend to use ASP or JSP, rather than PHP. Not everyone, some use PHP, but mostly I see .asp or .jsp. If I'm wrong, could you please point out stats?

I agree the fact that some 13 year old kid (sorry to any 13 year old kids for being patronising ) uses PHP for her website about her pony would hardly be considered an endorsement of PHP to a businees. The majority of medium to large companies use JSP or ASP, which is far more relevent than the over simplistic fact that there are more PHP sites on the web.

Also since when does something being popular mean that it is any good, I am sure more Britney Spears records will be purchased this year than Beethoven, but I am pretty sure Beethoven is regarded as the superior out of the two, much like PHP and .net.

Originally posted by M. Johansson
Well, yes and no. Some daredevils wrote the J2EE Best Pracices Blueprint application, The Java Pet Store, using C#/.NET, and managed to implement it in 1/4 of the code and have it perform over 10 times faster than the latest published benchmarks of the J2EE application in independent tests conducted by VeriTest. See it here:http://www.gotdotnet.com/team/compare/petshop.aspx
Even if they somehow cheated as hell, that's pretty impressive! I don't see how the Linux implementation of .NET would be slower than Java, unless the Mono manages to produce a VERY crappy implemenation.

I actually agree with Harry, that Pet Store Test is a total fix, the most obvious point being the Java code was written for portability and can use any database, the .net stuff was optimised for SQL server as such the comparision is worthless.

Actually the article states that MS's figures were in rebuttle to Oracle's figures, not directly to Sun's. Oracle's figures used the Java drivers, but made many optimisations for Oracle9i, and used a larger and more complex (and Oracle-specific) structure (and more expensive I might add).

So, while the numbers aren't to be trusted, the results are fairly obvious. On the "slower" Operating System, using the "slower" drivers, connecting to the "slower" database, the "slower" technology came out 30 times faster.

Originally posted by Jeremy W. Actually the article states that MS's figures were in rebuttle to Oracle's figures, not directly to Sun's. Oracle's figures used the Java drivers, but made many optimisations for Oracle9i, and used a larger and more complex (and Oracle-specific) structure (and more expensive I might add).

So, while the numbers aren't to be trusted, the results are fairly obvious. On the "slower" Operating System, using the "slower" drivers, connecting to the "slower" database, the "slower" technology came out 30 times faster.

Oracle made some minor optimisations to the J2EE pet store, but these minor improvements were made without comprimising the design blueprint principles from the original Java Pet Store, the oracle version was still database independent as laid out in the Pet Store Blueprint. The Microsoft version however implementated several aspects that were not specific to .net and gained a big performance boost from these.

1 - modification of the SQL query statements to return less data;

2 - replacing complex join queries with simple queries of a single table;

3 - storing the SQL queries within stored procedures in the database.

These broke several aspects of the Pet Store blueprint most notably portability / database independence and database normalisation. Microsoft also gained from the simple fact of having to write less code, due to everything being optimised for one database.

Look, most of you people here are more experienced and knowledgable than me, and I'm sure Microsoft really did make those kinds of specializations, but still... 10 times faster? And that's with the Java solution using the god of all databases.

I'm sorry, but I'd have to agree. If you can explain a 1000% increase in performance just by optimizing for a specific database I'd love to see that proven.

Yes, you can explain away some of the figures and the exact amount, but the precept is still the same. You can't improve Java's performance 1000% by simply optimizing it for Oracle (fastest db), running it on a Sun box (fastest server) on Linux (fastest OS).

It's not just that Microsoft used stored procedures, returned less data and stuck everything in one table, it's the whole focus of their virtual pet store. The Microsoft version was geared totally to performance, that affects code everywhere, not only in regard to optimising for the database. Microsofts code can to be less generic and can focus on speed, the java code often has to do extra things which are not even an issue for the microsoft version since it is not written with portability in mind.

I personally think .net is faster, but I seriously doubt it is anywhere near 1000%, when Microsoft come up with version that doesn't get the database to do half the work that is done by code in the Java version and when it can seemlessly migrate to other databases then I will give the tests more credence. Incidentally Oracle have put out an optimised version like .nets and claim it is up to 18 times as fast as the .net pet store, however I don't have much more faith in Oracles claims than I do in Microsofts.

Originally posted by neil100 I personally think .net is faster, but I seriously doubt it is anywhere near 1000%, when Microsoft come up with version that doesn't get the database to do half the work that is done by code in the Java version and when it can seemlessly migrate to other databases then I will give the tests more credence.

I completely agree with this in every aspect. The reason I referred to the test at all was the fact that there were some insinuations that .NET was not faster than Java - which I strongly doubt is the case.

Incidentally Oracle have put out an optimised version like .nets and claim it is up to 18 times as fast as the .net pet store, however I don't have much more faith in Oracles claims than I do in Microsofts.

Eartrrgghhhssawd2s. This reminds me how futile the debate about speed is. The Java/.NET comparision that H posted really hits right on with it's statement:

The real question isn't "which is faster," but "if approach X satisfies my higher-priority criteria, will it be fast enough?"

Will I ever learn? It's just like cost (which is also talked about in the artice). It's one of the most pointless arguments, too, since cost of software is so minor in comparison to development costs.

I'll try to heed what Mr. Hansen said earlier, and regard them both as very valid technologies, and not marry myself with one of them.

I'm being serious when I say I think the the answer is PHP (+ Perl and Open Source solutions).

People are very wrong to say corporations don't use PHP. The reality is, there are three corporate camps out there broken down like this;

1. Those using J2EE etc. - by far the biggest
2/3. Those using MS .NET etc. in at spot
2/3. Those using Open Source e.g. Perl / PHP

Notice I put 2/3 - there's alot of companies using Perl out there and they tend to be the ones open to stuff like PHP.

So getting back to the point of a J2EE vs. .NET battle, here's why I think PHP can win that one (perhaps sharing the crown with Perl) - basically the magic word is "interoperability" - the ability of seperate systems to interact with each other.

J2EE right now is geared to building N-Tier applications but messaging between layers is based on Sun or unpopular standards such as RMI or Corba. So it's all fine within your J2EE ecosystem but when it comes to talking to non Java systems, you're in trouble. Sun makes some support for SOAP, but only grudgingly.

.NET is tied right now to Microsofts technology. If you want to add something to your old Unix system to allow it to interoperate with you're new .NET application, you need to use another technology to do it. And that's going to leave you wondering why you chose .NET in the first place. Also, SOAP, despite all the push, is far from being a clear winner. MS has left those using DCOM feeling pretty uncertain with .NET. If SOAP backfires (like no one uses it), they may have lost alot of friends.

Also, both J2EE and .NET run strongly typed languages, which can be handy when building interop APIs onto systems, if that system was written within J2EE or .NET. But if it wasn't, or you want access a remote API, having a strongly typed language to perform that with can be a killer - you need to map every single variable that API will deliver. With a loosely typed language like PHP or Perl, you can make use of variable reflection to handle this kind of thing on the fly.

Explaining that last part by way of example, let's say you have this old C++ binary which writes a single variable to a text file. That variable could be a string, could be an integer or even a floating point (depending on what the binary was asked to do). You're asked to build a wrapper on top of the binary to turn that variable it puts in the text file into an API (e.g. a web service) so it can be accessed from a remote computer. With J2EE and .NET you're already stuggling as you're going to need some code which analyses the variable and works out it's type. Not so Perl or PHP, where those kind of problems can be left to the the underlying interpreter, allowing you to build the API faster than you could with J2EE or .NET

Also, with the above example, if you used J2EE, what protocol would you use to build the API? Sun's RMI? Not much good if you nood to make the API available to a customer not using J2EE.

And say the binary runs on a Unix system. What are you going to do with .NET?

This issue with interoperability is critical. Modern application design is not just OO these days - it's also N-Tier and all the benefits that offers.

One of the fundamental principles of N-Tier is any tier should be able to run on a seperate, phyically remote system. For that principle to work, applications must be platform independent and interoperable. Any solution that doesn't offer that is already dead.

Mattias. I'll not go into a debate with you. Just want to defend my previous reply to this thread.

First of all, I'm not saying PHP is better than ASP.NET, it has a lot of potential of being a great product that came out of Microsoft, what I'm saying are:

- PHP have been around for years and have been used for small and large scale systems.

And you said

True, but ASP has also been around (albeit in it's crappy form), and run on even more large scale systems.

As I understand ASP.NET is very much different than ASP, so why are you saying that the existence of ASP sums-up to ASP.NET's? And I disagree with you when you say that ASP are "run on even more large scale systems", you can't prove that, microsoft's products, especially IIS, are to expensive and unstable for large-scale enterprise system. In fact almost all our clients try to go with JSP-Servlet combo.

- PHP is FREE! I've read somewhere that to develop in PHP you'd be spending some hundreds of dollars compared to none using .NET. HA! That guy's dreaming! You can develop in PHP without purchasing a single software. In fact you can publish your PHP in the web for free.

I'm talking about software cost here and optionally web hosting! Besides whatever cost comparison you do between a product developed from PHP and ASP.NET will always have a resulting lower PHP cost, trust me with this one ok.

- Most important of all. PHP is easy to understand and use. Nothing can top that.

OK, I may be wrong here when I said "Nothing can top that" but this characteristic of PHP is one of the things that are praised by everyone, in fact the words "ease" and "simplicity" almost came synonimously with PHP.

Let's end this debate everyone. Both PHP and ASP.NET have advantages and disadvantages against each other, but clearly this thread showed that ASP.NET would be an overkill to use in small-scale systems. If you're developing a large-scale system however, then if you've tried and tested PHP before in large-scale system, then you have to look no further. If you haven't made a large-scale system using PHP, then I'm sincerely suggesting using ASP.NET, because PHP can get you into a lot of trouble in large-scale systems but nothing any resourceful person couldn't solve!

"I'm talking about software cost here and optionally web hosting! Besides whatever cost comparison you do between a product developed from PHP and ASP.NET will always have a resulting lower PHP cost, trust me with this one ok."

Going to have to argue, this statement has been quantified time and again, and I really don't feel the need to go through the whole formulaic thing again. Free is not free, simple as that.

As far as ASP never being used in large scale enterprise development because it's too expensive... Sorry, again, going to have to argue. The cost of software and hardware is always, always, always the lowest cost in any enterprise level application development project. Always.

I've evaluated PHP for our large-scale enterprise projects, and it simply doesn't fit because it isn't designed with for large scale apps. The creators will admit this, why can't the proponents? Sure, it can do it, but "can do" isn't enough for enterprise apps.

Why is JSP chosen? Because that's what it's designed for. Why is .NET already taking off in the Enterprise arena (more large companies are currently using .NET than are using PHP)? Because that's what it's designed for.

PHP's great, I've done several websites in PHP already and totally see the value of it, but let's use the tools for what they are designed for

Why is JSP chosen? Because that's what it's designed for. Why is .NET already taking off in the Enterprise arena (more large companies are currently using .NET than are using PHP)? Because that's what it's designed for.

Possibly, but your company has an enormous investment in MS technologies already. .NET may be 'taking off' in companies which already have huge investments in MS technologies because there's no alternative. Certainly, for web stuff, ASP *worked*, but was often extended (with mixed results) beyond what it was intended for. Regardless of whether ASP.NET is much better than ASP 'classic' or not, pretty much anything would be an improvement.

I don't see too many shops which are 100% Java (large or small) suddenly dropping that and going .NET whole-hog - because they've already made huge investments. .NET doesn't seem to be changing the minds of too many non-MS shops, and Java didn't seem to change the minds of too many MS shops. PHP changes few minds as well. "more large companies are currently using .NET than are using PHP" - cause it's a gradual progression from what they were doing before - MS is very good at making migration from one-version old software to current pretty easy, in my experience.

Why is JSP chosen? Because that's what it's designed for. Why is .NET already taking off in the Enterprise arena (more large companies are currently using .NET than are using PHP)? Because that's what it's designed for.

This is incorrect. In large companies, the guys who write the software on a piece of technology are not the guys who decide which technology to use. It all comes down to marketing. .NET has a very good (agressive) marketing strategy, as most Microsoft products have. The worst technology can achieve the largest market share, just by marketing. (I'm not saying this is the case with .NET; I'm just explaining how things really work.)

Another thing large companies are suckers for are things with money tags on them. If it's expensive, it must be good. If it's even more expensive, it must be better! Only recently those companies are finding out this isn't a golden rule, and that even Open-Source software can produce state of the art software, even for free.

Corporations love those little pieces of paper saying you're competent at something. As an MCSE in systems administrations, you might be able to configure a Windows system, but you have no idea of what you're doing. And you're easily hired. If you have no such piece of paper, the argument goes something like this:
Y: I'm a Unix system administrator
C: Yes, but do you have an MCSE?
Y: No, but ...
C: Thank you, bye.

And that's how large companies work. Even though Unix system administrators are normally much more qualified than Windows system administrators, they don't get hired because they don't have a certificate to prove it.

So how about Java? When the first JDK was released, its library was technically flawed in many ways, and the whole platform ran on only two platforms (Windows and Solaris). That didn't matter at all, because it was marketed as 'a cross-platform write-once run-anywhere object-oriented environment". By throwing lots of money at marketing it's easy to convince corporations that this is so. (And it wasn't anything spectacular either. VM's were a proven technology when Java came out. There were other (and better) object-oriented languages.) Luckily for us, the JDK is now a pretty solid product, but that's not the point.

PHP not being used in large companies has nothing to do with its technological state. The problem is that it's free, and has no marketing whatsoever. Even if PHP was technically superior to .NET and JSP, PHP would still not be used in large corporations.

This issue of technological superiority need to be clarified in my opinion. The two reasons why J2EE and .NET could be regarded as technologically superior is that they are frameworks (while PHP is just a language) and PHP is aimed only at web sites (excluding PHP-GTK).

If PHP was to gain a framework (by which I mean a solid class library, more development tools and in built mechanisms for deploying PHP applications, comparable to Java Entity and Session beans for example), perhaps a framework it shares with Perl, I believe PHP would be a superior technology by far. Right now, some of PHP's fundamentals are already superior: for web based applications PHP has the best cross platform support - it can run as a production level solution on xNix, Windows and Mac under a wide variety on web server. .NET is limited to Windows (Mono and dotgnu are not production level yet IMO) and J2EE requires expensive application servers.

Both Sun and Microsoft are using their frameworks as a means to sell their other technologies (which is only natural) but in doing so, they limit their use.

"I've evaluated PHP for our large-scale enterprise projects, and it simply doesn't fit because it isn't designed with for large scale apps. The creators will admit this, why can't the proponents? Sure, it can do it, but "can do" isn't enough for enterprise apps."

well if by the creators you mean Rasmus Lerdorf then yes and no, it appears that PHP has far outgrown anything that he had intentionally intended it to do, and from the interviews I have read appears to not be so interested in the enterprise possibilites of PHP.

Other key contributors however are actively involved with enterprise frameworks based around PHP.

Too many heads look straight through the possibilities that PHP opens up for them as they cant see past the .NET/J2EE hype, I have had many a pleasant argument with JAVA heads who for all thier brilliance could still not understand that load-balancing is not language specific, that multi-tier'd environments too are not language specific etc etc.

JAVA heads are the best cos they yak on about logic/content seperation blah, then yak on about JSP which encourages the opposite, then about struts and all sorts of other lovely stuff with obviously not a clue about how straightforward these things are to implement in PHP or many other languages, or more to the point the flexibility that PHP allows since you actually have to script the stuff yourself.... and development in PHP is much faster than you may assume.

That the frameworks already exist based around other technologies is not , as I see it a reason to assume that there will not be others because of course there will be. I think, like Harry, that PHP is a very powerful and superior base from which to build from. That PHP's OO is not up to scratch is a) changing and b) irrelevant as both JAVA and ASP & .NET have their own difficiencies (from the ideal at least ... not that there is an ideal implementation nor can there ever be since thats subjective )

"I've evaluated PHP for our large-scale enterprise projects, and it simply doesn't fit because it isn't designed with for large scale apps"

wrong, it isnt designed for the way you currently work & thats cool ! but it is quite capable of much more than you give it credit for, and the moment you start to do something even slightly different than the norm then it shines, brilliantly and quickly and cheaply.