comparing .net vesus PHP

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

caxibrema
Forum Newbie
Posts: 3
Joined: Sun Nov 30, 2003 9:43 am

comparing .net vesus PHP

Post by caxibrema »

hi all,

i have already some good experience with php and iam learnin asp.net now and after a deep study and comparison of these languages i concluded this things:

---------------------------------------
PHP
- run in a major of OS

ASP.net
- run only in windows like systems
PS: an open source implementation of the .net framework is in development (http://www.go-mono.com/)

PHP advantage
------------------------------------------

PHP
- is dificult to debugging (need third parties software)
- dont have a good ide. i´ve already used zend studio and it quite complicated and useless.

ASP.net
- has an integrated development environment very good, which supports debugging, editing many kinds of documents e.g. images,etc. , managing databases

asp.net advantage

-------------------------------------
PHP
- doesnt support data and html caching natively, u need third parties software
ASP.net
- suports natively

asp.net advantage
--------------------------------
PHP
- its interpretated at time of execution (im sure until 4.x) but im not sure about php 5.0

ASP.net
- its compilated in a sort of IL (intermediate language) and translated into native code (JIT) only in the first request of the client.

asp.net advantage
-----------------------------------
separation between presentation and business code
PHP
- u need a third party api (i.e. FastTemplate)

ASP
- supports natively. business code is put in a file, usually aspx.cs, and presentation is put in other file, usually aspx.

asp.net advantage
--------------------------------------
asp.net uses rad (Rapid development, like vb).
Php dont have an default ide (zend?). when i have to do an web application using php i usually make the design in dreamweaver mx and after i use an editor like ultraedit...

asp.net advantage
-----------------------------------
talking about oo, i cannot say bad things about php because the new zend engine (2.0) had included a lot of concepts of oo paradigm like encapsulation, exception handling, etc... so PHP is doing quite well in oo...


finally what i want to conclude it that PHP its suitable for small/medium applications (where u dont have $$ for buying vs.net, etc or when u want something simple) and asp.net its something more enterprise

anyone know the new model of zend engine 2.0? pre-compilated to an intermediated language or still interpreted. And anyone know any benchmark of PHP x asp.net? because i only found an benchmark comparing php with asp.

feel free to disagree with me, i want to put clear the diferences between them. in the botton i put some references i used for studyng..


thnx
Sérgio


references:
PHP5: Ready for enterprise
Diferences between asp.net and php
Straterra
Forum Regular
Posts: 527
Joined: Mon Nov 24, 2003 8:46 am
Location: Indianapolis, Indiana
Contact:

Post by Straterra »

You say PHP is difficult to debug and you have to have third party software? WRONG! PHP tells you exactly what errors you have. You also say that PHP doesnt support data and html caching natively. What do you mean by this? And you say that it is in ASP.Net's favor because this is compiled, which I think is foolishness. PHP is very special because you don't have to recompile it after EVERY SINGLE change. You also said that PHP doesn't separation between presentation and business code and you need a third party software. This is pure nonsence. You don't need ANY third person software to do anything. Basically whatever a $$$ program can do, a person can do for themselves. By doing it themselves they can customize it even more! You use Dreamweaver...then this means that you have very little experience in HTML, correct? This is not PHP's fault. You should learn HTML rather than rely on third-party software to do things for you. I may sound like I am bashing..but..this is a PHP forum. I think there IS supposed to be biased people. But, in my opinion, PHP can be used for ANY size development, small to large, and much MUCH cheaper than ASP.Net. I hate being confined to a WinOS..and PHP pretty much runs on any OS!
User avatar
EvilWalrus
Site Admin
Posts: 209
Joined: Thu Apr 18, 2002 3:21 pm
Location: Springmont, PA USA

Post by EvilWalrus »

mind you, and even though i hate PEAR, but PEAR has a cache classes that are callable upon runtime of your script.

Compiled != Better

Most of the time, a compiled language, rather than interpreted, takes up more processor and memory time to decompile, interpret, and run.

Good IDE != Good language

As simple as it is, Editplus does all of my editing needs when coding. As for debugging? Capture your own errors, and debug them yourself. Why waste time reading an IDE readout for your errors, when you can fix them and correct them in runtime with PHP?

Just my two cents...
ilovetoast
Forum Contributor
Posts: 142
Joined: Thu Jan 15, 2004 7:34 pm

Post by ilovetoast »

Given that nothing you can say will ever convince me that the words Windows and Server belong in the same sentence, .Net is not suitable for the enterprise no matter how they want to evangelize or attempt to position their product.

.Net is Micosoft attempt to beat on Java and PHP simultaneously. Problem is it does neither. Java is far better in the enterprise and PHP is far better for the average Joe's web app.

gg
Straterra
Forum Regular
Posts: 527
Joined: Mon Nov 24, 2003 8:46 am
Location: Indianapolis, Indiana
Contact:

Post by Straterra »

I...took the right side on something, for once!
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

PHP vs. ASP

Post by RobertGonzalez »

I am a novice to PHP (been coding for about 6 months). Coming from a pure, in-the-box HTML background, PHP is the coolest, easiest to learn web language I could find. When looking around for something to give on the fly dynamic, database driven web sites and web applications, PHP+MySQL delivered the best. There are more FREE tools for PHP beginners, more tutorials and more programmers willing to help and share technique.

PHP also runs on servers that almost all web hosts offer, many of them at reasonable rates, and it is widely supported. All things considered, PHP seems to be the most equitable choice no matter the scope of the project or backend processes you want to accomplish.

I am still far from knowing all the 'technical' terminology behind the differences between ASP and PHP. But from the perspective of writing programs and applications, PHP was certainly the easiest thing for me to pick up on.
Deemo
Forum Contributor
Posts: 418
Joined: Sun Jan 18, 2004 11:48 am
Location: Washington DC

Post by Deemo »

being mainly a c++ guy, writing code should be universal

which is one reason i dont use vb :P

php is more universal than asp, and is very similar to c
i dont know the syntax for asp.net, but having to actually buy the program for it is a BIG turnoff
qads
DevNet Resident
Posts: 1199
Joined: Tue Apr 23, 2002 10:02 am
Location: Brisbane

Post by qads »

coming to a php forum and posting something like this will get you flammed, beat up in streets even..

** me looks at Straterra **

4 months ago, you didnt know How to calculate the difference in milliseconds of two dates and now u know enough to bad mouth php?...talk about prograss eh?
Straterra
Forum Regular
Posts: 527
Joined: Mon Nov 24, 2003 8:46 am
Location: Indianapolis, Indiana
Contact:

Post by Straterra »

What did I do? What ya lookin' at me fo'?
User avatar
lazy_yogi
Forum Contributor
Posts: 243
Joined: Fri Jan 24, 2003 3:27 am

Post by lazy_yogi »

Straterra wrote:You don't need ANY third person software to do anything. Basically whatever a $$$ program can do, a person can do for themselves
True, but in M$, it does so much for you which makes the rapid development environment.
It's the same concept as using C++ with its full libraries and templates or sticking with C and re-writing everything from scratch. Why bother re-invent the wheel all the time?
Straterra wrote:this is a PHP forum. I think there IS supposed to be biased people.
You're an idiot.
Straterra wrote:and PHP pretty much runs on any OS!
.NET has been developed with the option for use on any operating system. As soon as people in the Open Source community get going, .NET will be freely available to use on any other operating system. Do you think M$ should actually encourage its use on other OS's so less people use windows? That they allow it is enough.
EvilWalrus wrote:Compiled != Better

Most of the time, a compiled language, rather than interpreted, takes up more processor and memory time to decompile, interpret, and run.
This is true, but the option to compile would be nice to improve speed once a project is completed. Interpreted is better for faster development, but compiled is better for a completed project. It'd be nice if languages offered both. Ah well.
EvilWalrus wrote:Good IDE != Good language
Yes true, but Visual Studio is a truly amazing IDE that saves enourmous amounts of time and aids in the rapid development environmant. If you haven't tried it out, you really should
ilovetoast wrote:.Net is Micosoft attempt to beat on Java and PHP simultaneously. Problem is it does neither. Java is far better in the enterprise and PHP is far better for the average Joe's web app.
Have you even tried it?
M$ languages have much stronger OO than php as well as much faster developement of quality backend's and front ends(php's ease encourages hacking, whereas M$'s ease encourages more naturally good OOP coding style and good design patterns). Their object model for HTML components along with their hiding the fact that HTTP is stateless and hence removing needs for server-side sessions are exceptional. Don't even get me started on J2EE.


I know this is a php forum, but how about a bit of open minded-ness instead of this M$ bashing <span style='color:blue' title='I&#39;m naughty, are you naughty?'>smurf</span>. They might be an evil company (most companies are ... I mean the whole purpose of a business is to make money !) but they worked hard to build an exceptional product. And they succeeded.

By shunning new technologies, you only inhibit your learning of new concepts.
Straterra
Forum Regular
Posts: 527
Joined: Mon Nov 24, 2003 8:46 am
Location: Indianapolis, Indiana
Contact:

Post by Straterra »

lazy_yogi wrote:
Straterra wrote:this is a PHP forum. I think there IS supposed to be biased people.
You're an idiot.
Straterra wrote:and PHP pretty much runs on any OS!
.NET has been developed with the option for use on any operating system. As soon as people in the Open Source community get going, .NET will be freely available to use on any other operating system. Do you think M$ should actually encourage its use on other OS's so less people use windows? That they allow it is enough.
I am not an idiot. The simple fact is, people who subscribe and actively post on this forum most likely will prefer PHP. If they didn't, why would they be using it and why would they be here?

Secondly, we all know how alot of ported software is after the port. Alot of M$ software is glitchy enough and unstable on Win32 OS's. Why make it even more so by porting it?
User avatar
EvilWalrus
Site Admin
Posts: 209
Joined: Thu Apr 18, 2002 3:21 pm
Location: Springmont, PA USA

Post by EvilWalrus »

lazy_yogi wrote:
EvilWalrus wrote:Good IDE != Good language
Yes true, but Visual Studio is a truly amazing IDE that saves enourmous amounts of time and aids in the rapid development environmant. If you haven't tried it out, you really should
Sure, it's good... as far as programming goes, i do Delphi, C/C++, VB6, Win32ASM, and some various here and there languages. I'm *very* familiar with the visual studio layout, but, if i could code my C/C++ in EditPlus, i would. It's much better (for me anyways) having something small and powerful, rather than something huge and bloated to fit my needs.
ilovetoast
Forum Contributor
Posts: 142
Joined: Thu Jan 15, 2004 7:34 pm

Post by ilovetoast »

There is no cause for name calling lazy_yogi. Straterra made a valid point that in a PHP forum you are going to find people who have already made some type of decision that they prefer PHP to ASP.

First let's recognize one thing. .Net is not intended to be M$ answer to PHP. When it was developed it was primarily intended as, marketed as, and evangelized as an answer to Java. It happens that it can serve the roles PHP does, but that doesn't change it's initial targets. It is therefore of consequence to recognize that many of the higher order elements of C#.Net should be compared vs. Java not PHP.

Second, do not not make assumptions about people's level of knowledge or experience. It is unseemly. I have tried .Net and I have developed and deployed enterprise projects using it and using Java/C++ to abandon it. Oh, and then there's the MCSD for .Net Certification I took the time and effort to obtain.

I'm not going to go into Java vs. .Net. I feel it is beyond the intended scope of this thread and this forum. You have your opinions, I have mine, and I'm content to leave that alone. I'm also not going to go into the evils of M$ and the large turd that is a Windows Server (too much at least). Again I have my opinions, you have yours and I'm not interested in going down that road.

However, I will provide a more detailed PHP vs. .Net comparison from my perspective. I invite your comment and rebuttal as I feel that your arguements for .Net are worth hearing for myself and I'm sure others here would agree.

To begin (the you is the general .NET/forum reader user not yogi):

1. Operating environments compared.
PHP is open source and can run well on a variety of systems ranging from Windows to Linux to BSD to MacOSX and more.
.Net is closed source and is intended for use only on Windows machines. Yes there are open source implementations in the works, but neither the option of mono or wine are suitable for commericial deployment by comparison. That may change in the future, but for now it is a fact.

Given the instablity, the insecurity, the high cost of ownership, the relatively poor performance, and the overall turdness of the Windows Server, this is an issue of consequence to many.

2. Debuggin/IDE.
I have been writing in PHP for years and I have NEVER felt the need to use an IDE or a third party debugger. See my anti-WYSIWYGI/pro-Text Editor manifesto. If you can't debug PHP using its internal error messages than the sad reality is that you don't know PHP as well as you should to be using it. The third party debugger just allows you to overcome your personal shortcomings that should instead be overcome by reading the darn manual. I have never had a bug in my code that the PHP error messages didn't lead me to solve.

More importantly this is a spurious arguement and merely indicates a lack of knowledge of what .Net is. PHP is a programming language. .Net is an Application Framework. These are two fundamentally different entities. If you want to whine about debuggers/IDE's then compare .Net to a third party framework for PHP. If you want to compare directly then you should compare the languages of .Net, such as C# and asp, to PHP. Apples and oranges people.

If you want to talk about RAD, code libraries, and such then you should at least make a fair comparison. Include PEAR, PECL, the numerous other "libraries" of reusable code for PHP and IDEs like Zend Studio to the tools of .Net. Other comparisons are simply artificial and unfair ones designed to give the impression of .Net superiority.

So I'm turning on the lights and reminding people again, PHP is a programming language. .Net is an Application Framework. To this end from this point forward I'm not giving creadibility to any further comparisons by using the incorrect terms as have been previously laid out. A valid comparison is apples to apples. So for the sake of correctness I'm going to refer to .Net as "lang.Net" from this point forward to simply reinforce the truth behind the comparisons being made.

The first post calls .Net, asp.Net, true. But then they proceed to make arguements vs. PHP that are predicated on the Application Framework of .Net and NOT of the language specifics of asp.Net. Is this deliberately deceptive or is it the accidental result of someone posting on a topic they are not well-informed on?

3. Data and html caching.
Refer to my discussion of #2 above. This is another spurious arguement in favor of .Net rather than a realistic comparison of lang.Net vs. PHP. .Net is an Application Framework and so provides these elements as a part of that framework. PHP is not. Period. gg. Compare apples to apples and consider solely lang.Net or consider PHP + third party solutions and you'll see that both can provide data and html caching.

4. Compiled vs. Interpreted.
If you buy this arguement then you really did drink the Kool-Aid Crazy Steve Balmer was serving up. As someone who works more with C++ than PHP or Java or .Net I will tell everyone here. .Net applications are not "compiled" in the sense that C++ applications are compiled. It's just not true, sorry.

What is going on when Microsoft claims it is "compiling" is more in line with caching. They have simply chosen to call it compiling to give people the impression of speed. The uniformed and unwashed masses hear "compiled" and they think "fast." They hear "interpreted" and they think "slow."

Realizing that, let's move on to "compiling" (in M$ parlance) or caching your PHP. Zend has been doing THE SAME THING SINCE 2000. Sorry for yelling, but lies like this one are insidious and deserve to be shouted down. Zend describes their caching in their FAQ, here. If paying for the Zend Accelerator is not your bag, remember php-accelerator offers a free PHP "compiler" (in M$ parlance).

If we're going to make comparisons, let's at least be honest and compare apples to apples. I am a broken record, yes. In this case compare ASP.Net to PHP.ZendAccelerator or PHP.php-acclerator. In both cases you have simlar caching/"compiling" architectures that by BOTH M$ and Zend claims show a 3-5x speed improvement vs. un-cached/"un-compiled" versions of the same script. Strange isn't it that M$ "compiling" gives the same touted speed improvement for ASP.Net vs. that which Zend's more aptly termed "caching" does for PHP.ZendAccelerator.

4. Separation between presentation and business code.
This is just another restatement of #2 above. Comparing an Application Framework to a programming language alone is disingenuous at best, deceptive more likely, and deliberately ignorant at worst. Why does .Net get to enter the comparison with all of the extras associated with the framework instead of just the base ASP or C# language? Why does PHP have to enter the comparison without all of it's extras like Smarty/FastTemplate/PEAR and instead with just its base language? Sounds like someone's trying to slip one past those who don't know better.

5. RAD/IDE.
I lumped this into #2. Nothing like someone setting up a false comparison of .Net Application Framework vs. PHP programming language and then proceeding to examine it without first establishing the validity of the comparison. Why do I keep reiterating this point? Because the .Net advocates kept ignoring it in their posts.

I am waiting for one reason why the comparison of an APPLICATION FRAMEWORK to a PROGRAMMING LANGUAGE is nothing more than an intellectually dishonest affair.

6. OOP
Well, first a reference to an interesting FAQ about Objects in .Net. This part of the FAQ describes in depth the massive problem that exists with garbage collection and the lack of deterministic destruction of objects in .Net. It further provides added links that describe added details about this problem and the major effect it can have for various projects.

Now, it is certainly correct that ASP.Net forces the programmer into OOP. But the real question is is that good? Does the web designer who doesn't want to be a programmer want to also be forced to learn OOP? And how exaclty does forcing OOP on users constitute a good thing?

One of the wonderful things about PHP is that choice. I can choose to keep it simple, linear, and rapidly deployed for small tasks. Or I can choose to go OO completely for more complex ones. The choice is mine to make based upon MY needs or MY CLIENT'S needs, instead of being a decision made for me by M$'s "one ugly suit for everyone" approach.

I can write OO code using any OO design pattern I need to. I can implement some patterns and not others. I can do what needs to be done for my project and I can do it the best way, not just the M$ way.

"M$ bashing <span style='color:blue' title='I&#39;m naughty, are you naughty?'>smurf</span>"?
I think it is worth noting that this thread was started by a pro-M$ TROLL and not by any M$ bashers. Are we guilty for taking the bait? Yes, I am. I will take it every time I have the time to reply as it gives me a nice opportunity to vent the pent up frustration built up from years of having to slog through messes created by M$ crap. I have worked on literally dozens of "cleanup" projects fixing Winblows Server fiascos, VB coding debacles, and M$ security failures. If I call M$ I get some smug SOB who has no appreciation of the magnitude of the problems and no cares beyond tomorrow's M$ share price.

Just because other companies suck is not an excuse. I don't get to steal just because other people are thieves. Business ethics are not predicated on compromise or obfuscated by collective evil. When we stop working to be better as individuals and as businesses and as a society, we fail. When we fall back on the excuse of others are bad too, we enable that failure.

Where else am I supposed to vent? I didn't go to a .Net forum and pee in their soup. Yet someone comes here and pees in mine. The only acceptable place to troll is the Ottawa Lady Senators forum at ESPN.com. :)

Is .Net an exceptional product? Yes, it is. Did some people at M$ work hard to make it? Yes, they did. On these things I will agree with lazy_yogi. There is a time and a place for .Net as there is for all things.

But does that fact make .Net better than PHP? Hardly. Nor does it make PHP better than .Net in every circumstance. What makes XXXX better than .Net is not principally .Net's failings (thought it has some). It is the failing of the Windows Server platform.

7. Not mentioned - development and deployment cost.
If you don't have $$$$$ to burn then, sorry, .Net is not for you. That is now and always will be a fact. PHP is free. php-accelerator is free. PEAR and other script libraries (including templates and cms systems) are free. MySQL, Postgres and SQLite are free. BBEdit Lite, Notepad, vi and emacs are free. Apache is free.

In the final analysis, I stand by my previous statement:
.Net is Micosoft attempt to beat on Java and PHP simultaneously. Problem is it does neither. Java is far better in the enterprise and PHP is far better for the average Joe's web app.
I will take Java/C++ in the enterprise. I will also take PHP every time for the average Joe's web app/site.

peace
User avatar
EvilWalrus
Site Admin
Posts: 209
Joined: Thu Apr 18, 2002 3:21 pm
Location: Springmont, PA USA

Post by EvilWalrus »

Just... Wow. Great argument, and i know stand by ilovetoast. :-D
Straterra
Forum Regular
Posts: 527
Joined: Mon Nov 24, 2003 8:46 am
Location: Indianapolis, Indiana
Contact:

Post by Straterra »

Toast...I love it! I LOVE IT!
Post Reply