Hi , I know that .net is so better than php . But I need an article or essay that cntrast them with sientific reasons . I need it because I can not answer the users of php in most cases. when I say ASP.Net is faster , they answer PHP is faster! they say that
PHP is compiled too and becuase of running in Linux server , it is so faster than .Net... (?) if anyone answer this , i will be so glad. thanks
PHP is never compiled in the sense that an ASP.NET page is compiled. After the first run of an ASP.NET page, if you use in-page code for your .aspx files, the page is compiled and the code is literally machine code. If you use code-behind, then your page will
always be compiled into the DLLs. PHP compilations involve the PHP engine changing it to the executeable form of the page (similar to how Java uses byte code in its "compiled" state). Furthermore, the only way to then achieve similar speed to ASP.NET is to
CACHE the "compiled" version of the PHP scripts. This is how the Zend Accelerator works. At no point does the PHP code ever become machine level code. As to running PHP vs ASP.NET on a Linux server, there is Mono (go-mono.com) so that you can run ASP.NET on
a Linux server, but maybe due to a poor implementation it has speed problems? I don't know, I have never used .NET on a Linux machine. My first guess is that ASP.NET is still faster on Linux than PHP. Scripts cannot beat machine code because at the end of
the day, you're running another program in order to execute the script, while the machine code runs as is.
Hi thanks alot for your answer. As I undrestood , only when we cache the compiled code of php pages , it's speed is equal to .net pages ( or lesser ). but i don't undrestood why there is difference between compiled code of .net and compiled code of php. and
is there any reftrence about this?(sientific essay or anything else) thanks Mahmoud Moravej
All of these are really moot points from a business perspective. Sure it may be interpreted, it may be weakly typed, it may be heavily intermingled with html, but how does it perform under load in real life situations. I'm trying to find some php case studies
right now. So far I've failed. Any cases of companies dropping asp.net in favor of php? I'd like to know stuff like that, and why.
It takes a pretty big dog to weigh a thousand pounds.
I have never heard of someone going from ASP.NET to PHP. Not on a business level anyway. For starters, ASP.NET is too new for that to have happened unless ASP.NET really failed in some area that the business required, and I don't see ASP.NET failing at something
and then PHP magically succeeding unless a programmer sabotaged it. There is not one advantage that PHP has over ASP.NET. (Not even dynamic generation/execution of code)
There are very important business advantages php has over asp.net. There's a larger pool of people who develop in it. There's a lot more prewritten php code (prebuilt frameworks) out there. A php developer is typically cheaper to hire than a .net developer
because there are more of them and it's easy to learn and get into. It is proven. Over 10 million sites use it. Asp.NET still has that 'air' to it that it's still an experimental technology, making it a larger risk. Again, these are business decisions and
these are what count. A business person cares that the job can get done, that it gets done cheaply, and that it works. Php can do all of this. I'm not sure what you mean that there is not even one advantage. I just listed a bunch of them.
It takes a pretty big dog to weigh a thousand pounds.
"It is proven. Over 10 million sites use it." That's not true. Simply because a server has PHP installed doesn't mean it has a site running PHP. And that's the case of the 10 million "sites". "Asp.NET still has that 'air' to it that it's still an experimental
technology." ??? if you say so....
You listed two advantages that are somewhat true. - PHP has a larger pool of coders, which goes hand in hand for the cheap pay. - PHP has a lot of prewritten code. However, the majority of PHP programmers are VERY bad coders, so you get what you pay for. Not
only does the code read horriblely, but they both let themselves get away with horrible inefficiencies that they might not even know exist due to the fact that PHP scripts. Did you know something like this was extremely inefficient in PHP:
for ( $i = 0; $i < 20000; ++$i )
{
//... do stuff
$firstvar = $secondvar = $thirdvar; // and any variances of this statement on a single line
}
// versus
for ( $i = 0; $i < 20000; ++$i )
{
//... do stuff
$secondvar = $thirdvar;
$firstvar = $thirdvar;
}
I had a loop
that actually executed a little more than 20 thousand times and by changing the code from the top loop to the bottom loop I GAINED 5 seconds in execution time, every time (it took like 20 seconds total, but I was doing a lot of stuff in a huge report). Anyway,
is the manager going to know this about PHP coders in general? No. A lot of them [PHP coders] know the lingo anyway. However, having worked with and stared at a ton of PHP sites that have sporadic problems (not the fault of PHP) that don't detect failure,
I think I can fairly say ASP.NET is more equipped for a business. All of my PHP sites have error checking at EVERY point an error appears. Now, I could have just rewritten the error handler function (the one that does the output), but that would have made
for messy output whenever the error occurs instead of simple messages to the user to check again later or something. The prewritten PHP code goes hand in hand with the .NET Framework. The only difference is that the PHP things such as PHPNuke and stuff have
been around longer and are maybe a little more functionally complete (though a lot of these even suffer from the poor error trapping). I realize PHP 5 adds error handling through try-catch, but well my sites are done and paid for and unless they pay me to
add that feature to them, I'm sorry, I will not. It also stands to reasoning that considering there IS a method to handle errors already, in PHP (@), and people still do not use them, then I doubt they try-catch will be used either. Plus, PHP 5 is literally
still experimental (just past beta, but not quite at final release). Does PHP get the job done? Usually, but so does PERL and everything else. There is no gain in going from ASP.NET to PHP, but there is going from PHP to ASP.NET (speed, cleaner code, and more
error trapping (though you could pose the same argument that .NET coders are not forced to do error handling, but all of the big sites, unlike with PHP do that I have seen)). A lot of people complain about ColdFusion stealing jobs from PHP because they can
get the job done in a shorter period of time and thus charging less for the overall job as a result for a much poorer quality product. PHP is the exact same way compared to ASP.NET. Since .NET Framework 1.0, I have never heard or felt that ASP.NET was still
experimental technology until you mentioned it just now.
mahmoud690
Member
40 Points
8 Posts
php vs .net
Feb 28, 2004 09:22 PM|LINK
pickyh3d
Star
9696 Points
1955 Posts
Re: php vs .net
Feb 29, 2004 06:00 AM|LINK
mahmoud690
Member
40 Points
8 Posts
Re: php vs .net
Mar 01, 2004 09:18 PM|LINK
CumpsD
Contributor
2293 Points
417 Posts
Re: php vs .net
Mar 06, 2004 12:28 PM|LINK
pickyh3d
Star
9696 Points
1955 Posts
Re: php vs .net
Mar 06, 2004 07:05 PM|LINK
Rex
Participant
915 Points
183 Posts
Re: php vs .net
Apr 21, 2004 12:10 AM|LINK
pickyh3d
Star
9696 Points
1955 Posts
Re: php vs .net
Apr 21, 2004 05:47 PM|LINK
Rex
Participant
915 Points
183 Posts
Re: php vs .net
Apr 21, 2004 06:00 PM|LINK
fetcher
Member
635 Points
127 Posts
Re: php vs .net
Apr 23, 2004 03:46 PM|LINK
pickyh3d
Star
9696 Points
1955 Posts
Re: php vs .net
Apr 23, 2004 03:56 PM|LINK
for ( $i = 0; $i < 20000; ++$i ) { //... do stuff $firstvar = $secondvar = $thirdvar; // and any variances of this statement on a single line } // versus for ( $i = 0; $i < 20000; ++$i ) { //... do stuff $secondvar = $thirdvar; $firstvar = $thirdvar; }I had a loop that actually executed a little more than 20 thousand times and by changing the code from the top loop to the bottom loop I GAINED 5 seconds in execution time, every time (it took like 20 seconds total, but I was doing a lot of stuff in a huge report). Anyway, is the manager going to know this about PHP coders in general? No. A lot of them [PHP coders] know the lingo anyway. However, having worked with and stared at a ton of PHP sites that have sporadic problems (not the fault of PHP) that don't detect failure, I think I can fairly say ASP.NET is more equipped for a business. All of my PHP sites have error checking at EVERY point an error appears. Now, I could have just rewritten the error handler function (the one that does the output), but that would have made for messy output whenever the error occurs instead of simple messages to the user to check again later or something. The prewritten PHP code goes hand in hand with the .NET Framework. The only difference is that the PHP things such as PHPNuke and stuff have been around longer and are maybe a little more functionally complete (though a lot of these even suffer from the poor error trapping). I realize PHP 5 adds error handling through try-catch, but well my sites are done and paid for and unless they pay me to add that feature to them, I'm sorry, I will not. It also stands to reasoning that considering there IS a method to handle errors already, in PHP (@), and people still do not use them, then I doubt they try-catch will be used either. Plus, PHP 5 is literally still experimental (just past beta, but not quite at final release). Does PHP get the job done? Usually, but so does PERL and everything else. There is no gain in going from ASP.NET to PHP, but there is going from PHP to ASP.NET (speed, cleaner code, and more error trapping (though you could pose the same argument that .NET coders are not forced to do error handling, but all of the big sites, unlike with PHP do that I have seen)). A lot of people complain about ColdFusion stealing jobs from PHP because they can get the job done in a shorter period of time and thus charging less for the overall job as a result for a much poorer quality product. PHP is the exact same way compared to ASP.NET. Since .NET Framework 1.0, I have never heard or felt that ASP.NET was still experimental technology until you mentioned it just now.