Nice troll, Harry. I didn't think I'd waste an hour of my time this Saturday afternoon watching a sinking ship of misinformation (some would say disinformation, but I'll leave that for the Jim McDermott's and Harry Belafonte's of the world to imply). Please
send over some links to some commercial sites you've done using ASP.NET.
I have the feeling that by "BS," he meant to emphasize how you only showed a one-sided examination. Also, through out the 10 points, you gave TWO .NET links. One link was actually a good one (the list of currently .NET supported languages). Of course, you had
no problem throwing php.net and zend.com links out everywhere possible. ------------------------------------------------------------------------------------------------
"But in general, I don't make many claims about either PHP or .NET. So where is the BS?" And here's you again:
"Obviously this isn't quite the same as C# or J# but the point needs to be made -- PHP is very flexible, and offers useful solutions for the Internet. Don't expect to find yourself to be writing a successful Website in Cobol.NET -- it's likely each .NET
language will eventually "tune in" to a particular type of application development." Or, just for kicks, you again:
"In fact with PHP 4.3 in the wings, it may be that PHP can claim superior OO support, when you consider that FAQ." I guess you never saw COBOL.NET from Fujitsu? How is PHP going to claim superior OO support, when ASP.NET has true OO support (not to say
PHP can't come out on the same level though)? Oh well, there goes those claims... No matter what you said about ASP.NET, you went further to say that PHP could do it either just as well, or even better. This, as everyone knows is not the case. ASP.NET does
not beat PHP in every area possible, but PHP does not add up to equal ASP.NET. Actually no, I take that back. You can program with PERL.NET, COBOL.NET, C++.NET (Managed C++), PASCAL.NET, DELPHI.NET, C#, VB.NET, and tons of others to make an ASP.NET page. If
you can do it in PHP, you can find one of these languages to do it better (even if it's not the same language on each page), which makes ASP.NET better. ---------------------------------------------------------------------------------------------
"The one big thing I failed to emphasise is, although PHP itself lacks a solid class library, thanks to both Microsoft and Sun, it doesn't need one because you can use both (plus some real C/C++ just for fun) within a single PHP script. Find out more here:
http://www.sitepointforums.com/showthread.php?s=&threadid=79713" There you go again! You're forgetting you can just plain use [Managed] C++ in ASP.NET, as well as the amply powered C# in a single script and guess what, these come with a solid class library
that is huge. You're fascinated to hear that ASP.NET may be slower based on one persons analysis that probably completely misconfigured his web server (I guess that's ASP.NET's fault). I'm guessing he did things out of order, which broke the .NET Framework.
With your comments about C++ and Java coders loving PHP: That is so general it hurts. I could say pigeons love PHP, but what does that tell you, a few pigeons, half pigeons, most pigeons? Anyone that is truely experienced with C++ and/or Java would love C#'s
development scheme (especially Java people--if they didn't just go with J#). If they're Java people, then they can simply develop with J#. There's no way that a non-MS hating C++/Java coder would take the time to learn both ASP.NET (in any language they choose)
and PHP, then turn back and tell me they like PHP more simply because it's easier. There are reasons some C++/Java people like PHP more than ASP.NET (other than MS being involved), but being easier is not one of them (at least it shouldn't be). A true Java
developer has no reason to like PHP more than ASP.NET; C++ is another story. ----------------------------------------------------------------------------------------------- With all of this said, PHP is a great scripting language. It does what it needs to
do VERY well. It's quick, easy to learn and just as easy to use. The solid function libraries are pretty robust in PHP too, so they're worth mentioning for PHP. I still use PHP myself on personal sites that don't need extensive compilation and/or are small
projects that don't get anything from the often repetitive object orientation of everything when dealing with smaller projects (of course this doesn't matter when dealing with bigger projects as it makes MUCH more sense to have this). If you want to see one
site I recently made in PHP for the military recruiters (for free--and for myself) that uses XML databases then go to my main page :
http://www.chrissharp.net. I realize the site rather sucks, but it does exactly what I wanted it too and it is really quick. On a side note about your comments on C++ not being touted as the language of the future (your
first comments) ... because many people believe Java is. Me? I don't think Java is going to servive in a few long years (because of Sun). I love programming with C++ and I don't have any problems with the language. Obviously, it would be nice if it came with
a string type and things built into the language, but I don't have problems with that not existing either (and there are of course string classes made for it). After all, C++ didn't start off with the goal of being "easy" and because of that, you can do a
lot more. The OO support in PHP is not as good as C++'s, in any way. It does what it has to do, in a quick and dirty way, but C# (and the others) beat it face down. For those of you looking at PHP and its non-binding variables (i.e., $NotBinded could be an
integer, string, or double, all within the same function, with out redeclaring it) then you might want to look into JScript.NET. I don't use JScript because I prefer the binding data types.
I thought I'd post about Generics here, since I asked about them earlier (on the C# forum). Generic's are templates.
http://research.microsoft.com/~dsyme/papers/generics.pdf In case anyone was really scared about the use of strict data typing in ASP.NET. Any C++ programmer will love this. Oh well, I guess
PHP's jumping between data types is good (and safe)? It's nice being able to do the following:
$AnyVar = "string";
if ($AnyVar == "string")
$AnyVar = 1;
else
$AnyVar = 0;
if ($AnyVar) // C# would have if (AnyVar == 1) ... which is one thing I wish wasn't always there
$AnyVar = 1.23;
else
$AnyVar = 0.23;
But it's not exactly the safest thing to let variables jump between types like that (no matter how helpful it can be on small projects).
> As the "PHP fanboy" himself thought I'd drop by and say hello ;) > >So as to this: "That article isn't just a "PHP fanboy" / "Pure hate for .NET FW", it's 97% BS!" > >Would you care to be more specific? There are one or two minor mistakes (e.g. calling ASP
>a language becuase I'm so used grouping VBScript under the name ASP) which if I could, >I'd correct. But in general, I don't make many claims about either PHP or .NET. So where is >the BS? Well, I'll give it a try. You articulate the advantages of PHP quite
well, but I guess my complaint with your article is with your 10 "NET Myths". Those arguments may be perpetrated on sitepoint regularly, but they are hardly good examples of .NET strengths. It’s easy to knock a straw man down. It seems you know a bit about
PHP, but your knowledge of .NET and specifically ASP.NET is severely lacking. It’s ok though, since it is very new, very few people really have a grasp of it’s capabilities. I don’t profess to know everything about .NET or PHP, but maybe I can help the debate
a little. If my facts are not correct, please, by all means, correct me. First, I’m going to limit my comments to issues of serious software development. If you want to hack out a form-to-email script for your Aunt Rosie in some procedural language, then go
for it. I call that a function or a method, not a software application. >^^^^ From SitePoint Forum (http://www.webmasterbase.com/article/870) ^^^^ >4. PHP is not compiled, other than when it's interpreted at runtime, whereas >.NET enjoys all the benefits of
being compiled. >Here's news for the .NET crowd -- you've finally caught up! Microsoft's use of >the word "compiled" in regard to .NET is not what a C++ coder would call > "compiled". Zend, the corporate face of the PHP project, have been doing >this for a
while now ASP.NET is compiled. It is very similar to Java in that it’s compiled to “byte code” first, then compiled again to machine code before execution. So is it compiled like C/C++, no, it is closer to the way Java is compiled. As far as comparisons to
Zend, what percent of PHP implementations (hosting companies included) use Zend? My guess the majority of PHP code running in the world is not compiled. I know it isn’t nearly as close to ASP.NET implementations that execute compiled code (100%). So in real-world
usage, we are really comparing interpreted code (PHP) and compiled code (ASP.NET). >^^^^ From SitePoint Forum (http://www.webmasterbase.com/article/870) ^^^^ >7. Language.NET has superior object orientation. > >For those who know PHP and its limitations, you
may be amused by this .NET >FAQ -- sound familiar? In fact with PHP 4.3 in the wings, it may be that PHP >can claim superior OO support, when you consider that FAQ. This FAQ doesn’t have anything to do object orientation! You are confusing completely separate
issues here. The FAQ deals with the .NET Framework’s code and object management (very low level). These are very similar issues the Java Virtual Machine deals with. Automatic garbage collection is an interesting debate, but has nothing to do with OO. PHP is
very, very, far removed from this platform architecture. If you want to talk OO, then you must make comparisons to C#, VB.NET, Jscript.NET. I guess this is my biggest complaint with pro PHP posters, they usually have very poor understanding of true OO principles.
A LANGUAGE IS NOT OBJECT ORIENTED UNLESS IT SUPPORTS THE FOLLOWING: Abstraction Inheritance (through unlimited multiple levels) Polymorphism Encapsulation Then we can get into more granular OO details like member overloading (an extremely powerful feature
in C#). PHP is so far removed from this level of sophistication, flexibility, and power, it is humorous to even make the comparison. And really, any serious developer says that they would rather have the choice of working in OO or procedural code, really doesn’t
fully understand the advantages of OO programming in my opinion. I know there are some very capable PHP developers out there, but by judging the content of PHP posts I read, most do not really know what OO means. A PHP developer talking about OO principles
is akin to a hockey player lecturing a football player on how to kick a football. They are often in two completely different worlds. >^^^^ From SitePoint Forum (http://www.webmasterbase.com/article/870) ^^^^ >8. .NET offers superior templating and web development
features. >Microsoft has come up with some nice features with .NET that are certainly >enticing, like the datagrid, and the templating mechanism. But you could easily >reproduce these with a little PHP (try DaDaBIK, for example). DaDaBiK (or any other template
design) vs. ASP.NET programming model? Please. I challenge any PHP developer to actually examine ASP.NET in depth. It’s not a matter of just “templates”. ASP.NET has a full event model, automatic state management (view state), true programming control of html
elements, built-in form validation controls, built-in application security classes, built-in page caching. Need I say more? You also mentioned PHP’s popularity world-wide and with corporations. PHP is very popular, but I think some of the surveys are a little
misleading. I understand that Netcraft shows PHP to be running on more websites than IIS/ASP. My guess is the average PHP server is much smaller than the average ASP machine. Netcraft counts Joe’s Home Page running PHP on a tiny Linux box the same as one of
Monster.com’s web servers. Tell me how much web traffic goes to ASP sites compared to PHP sites. I will bet it is a whole different story. And finally, for all you aspiring web developers out there, do some job searches at dice.com or monster.com to see which
development platforms actually get paid jobs. Try searching for PHP, then ASP. Here are my results at dice.com for a nation-wide search: PHP 57 jobs MySQL 55 jobs ASP 2231 jobs ASP.NET 140 jobs .NET 1717 SQL Server 1711 JSP 630 jobs Java 3168 jobs Now tell
me how PHP fits into this mix? Looks like the real debate is between Java and .NET, and so do the people putting their money where their mouths are. Troy T.
From the little code you've provided I would have to say that I believe any performance bottlenecks you are experiencing is likely coming from your use of ADO.NET, not any issue with the ASP.NET engine.
It is very similar to Java in that it’s compiled to “byte code” first, then compiled again to machine code before execution. So is it compiled like C/C++, no, it is closer to the way Java is compiled.
Not quite. ASP.NET (in fact, all .NET languages) is first compiled to IL (intermediate language), which is not quite the same as bytecode. This is what is produced, for example, when you "build" a project in Visual Studio .NET. Unlike bytecode, the IL is
then further just-in-time compiled to processor-specific (in most cases, x86) instructions (you can also pre-compile the IL to native code with a utility called ngen.exe, at the cost of some optimizations vs. JIT). So what ends up getting executed is, in fact,
fully-compiled native code. It is certainly arguable that C/C++ code may be more fully optimizable, and so may have some marginal performance advantage over managed (.NET) code, but that doesn't mean that managed code isn't fully compiled. In the case of ASP.NET,
what typically happens is that on the first request to a page in a given directory, the ASP.NET runtime takes care of batch compiling all of the pages in that directory. Once compiled, the compiled versions are cached on disk and in memory until the Web application
or the server is restarted. So you take a bit of a perf hit on the first request of the first page, but after that you are simply executing compiled code, which is likely to be far faster than interpreted code. Sorry to jump in in the middle of this, but I
thought it important to clarify that point. Regards, G. Andrew Duthie
I think he knew what you just said (although I read it the same way that you did). I think what he meant to say "It is very similar to Java in the way that Java compiles..." In a sense it's the same thing, because it merely translates into something that is
readable by a single compiler opposed to having it jump from VB.NET, to C#, to Managed C++ (which the initial compilation to IL has to do). I definitely see why you posted and I know that you're right, but I'm just mentioning for him, that he probably just
meant what you said, in less words :).
You quoted: Robert makes a good point about the initial request. ASP.NET compiles the code to two different levels on the initial request. The first (given you aren't using code-behind pages) is compiled to CLR "byte code" similar to how Java works. The
second compilation produces "machine code". That machine code is executed on all subsequent requests. Now, I would like someone to explain how any script in the world is going to be faster than machine code. To which you responded:
I'm not quite sure that is correct. The .NET runtime compiles and executes almost exactly like Java, in that the MSIL code is what is stored and loaded when a program is called. The conversion of MSIL to machine code is done each time MSIL code is run by
a JIT (Just-In-Time) compiler. Although I would quibble with the notion of "CLR 'byte code'", which I believe to be an inaccurate way of describing IL, the description of how compilation in .NET works is essentially correct. The managed language (C#, VB.NET,
etc.) is compiled by either Visual Studio .NET, a command-line compiler, or the ASP.NET runtime (in the case of code in a < script runat="server" > block in a .aspx or .ascx file, for example) into processor-independent IL code. This IL code is what is contained
within a .NET assembly (DLL or "portable executable", as they're sometimes called). When the code is executed for the first time, it is JIT-compiled to processor-specific native code, and
the native code is cached. This means that the code is not recompiled from IL to native code on each subsequent execution. It is true that when an ASP.NET application is restarted, or the server is rebooted, the MSIL to native compilation step
must be taken again, but that's not the same as it happening each time the code is executed. Regards, G. Andrew Duthie
-- ****************** -- Not quite. ASP.NET (in fact, all .NET languages) is first compiled to IL (intermediate language), which is not quite the same as bytecode. This is what is produced, for example, when you "build" a project in Visual Studio .NET. Unlike
bytecode, the IL is then further just-in-time compiled to processor-specific (in most cases, x86) instructions (you can also pre-compile the IL to native code with a utility called ngen.exe, at the cost of some optimizations vs. JIT). So what ends up getting
executed is, in fact, fully-compiled native code. It is certainly arguable that C/C++ code may be more fully optimizable, and so may have some marginal performance advantage over managed (.NET) code, but that doesn't mean that managed code isn't fully compiled.
-- ****************** -- Thanks for the clarification and correction. I stand corrected, but I think my overall point is made about compiled vs. interpreted code. Troy T.
gbrown
Member
335 Points
67 Posts
Re: Php performance vs ASP.Net Performance
Oct 12, 2002 04:38 PM|LINK
pickyh3d
Star
9696 Points
1955 Posts
Re: Php performance vs ASP.Net Performance
Oct 12, 2002 05:57 PM|LINK
pickyh3d
Star
9696 Points
1955 Posts
Re: Php performance vs ASP.Net Performance
Oct 12, 2002 06:18 PM|LINK
$AnyVar = "string"; if ($AnyVar == "string") $AnyVar = 1; else $AnyVar = 0; if ($AnyVar) // C# would have if (AnyVar == 1) ... which is one thing I wish wasn't always there $AnyVar = 1.23; else $AnyVar = 0.23;But it's not exactly the safest thing to let variables jump between types like that (no matter how helpful it can be on small projects).ttuttle
Member
80 Points
16 Posts
Re: Php performance vs ASP.Net Performance
Oct 12, 2002 07:52 PM|LINK
Halo_Four
Member
10 Points
2 Posts
Re: Php performance vs ASP.Net Performance
Oct 12, 2002 09:39 PM|LINK
G Andrew Dut...
Member
227 Points
46 Posts
ASPInsiders
Re: Php performance vs ASP.Net Performance
Oct 12, 2002 11:17 PM|LINK
Code Camps in the Mid-Atlantic
pickyh3d
Star
9696 Points
1955 Posts
Re: Php performance vs ASP.Net Performance
Oct 12, 2002 11:36 PM|LINK
pickyh3d
Star
9696 Points
1955 Posts
Re: Php performance vs ASP.Net Performance
Oct 13, 2002 12:10 AM|LINK
G Andrew Dut...
Member
227 Points
46 Posts
ASPInsiders
Re: Php performance vs ASP.Net Performance
Oct 13, 2002 01:14 AM|LINK
Code Camps in the Mid-Atlantic
ttuttle
Member
80 Points
16 Posts
Re: Php performance vs ASP.Net Performance
Oct 13, 2002 04:20 PM|LINK