ASP.net vs PHP

Posted by porov, 03-01-2007, 03:06 AM
What is better? I hear asp.net is better for large scale websites, and php for more simple ones, is it true?

Posted by maxymizer, 03-01-2007, 03:24 AM
It's not true but you just started another flame war.

Posted by porov, 03-01-2007, 04:01 AM
Haha, really, i didnt mean to..

Posted by Burhan, 03-01-2007, 04:10 AM
Search This thing comes up quite often, and nothing useful comes of it. People try to defend what they know against that which they do not; then usually a few people jump in to quote some statistic. Next thing you know, 5+ pages of "mine is better than yours" type "discussion".

Posted by maxymizer, 03-01-2007, 05:53 AM
What fyrestrtr said

Posted by cis4life, 03-01-2007, 10:20 AM
I'll say what I have to say (from someone who uses both daily) ASP.NET Its a great language, alot of power and functionality. Can easily move between web and desktop application (code wise) and its "moreless" a compiled lang. (I know I know about its bytecode, don't want to get into that discussion). So it runs exceptionally fast after the first time its run, which is great for a site with major traffic. The Cons: It's a windows only lang. (Has be run on a windows server. And I know about Projects like MONO, but I'm talking about native support) Personally I love Windows Server, but it does limit you to a platform. This is probably its biggest con, cause as you know, if your on a budget, Windows Server isn't cheap. I would say that it native support for MSSQL Server is a con, but now with SQL Server Express, thats no longer (to me) a vaild agrument. PHP I love PHP. Its portable, now also has OOP support, and myself as a java and c# programmer, I was able to jump on this language and build complex apps inside a day or two. Very easy to get into. PHP has a large community, and I have seen some high traffic PHP sites (meaning it can be interrputed really fast) The greatest benefit to PHP is that you can develop on it for nearly free. You can host it on free OS's, PHP is free (although so is .NET) and its native support for mysql is top notch, and MYSQL is free. The only con I really see, is that if your not a c type programmer, and you did moreless basic type programming, you will have a bit of a learning curve. My summary: Both languages are EXTREMELY well suited. Its a perference thing. Don't sit here and listen to .NET fanboys or PHP fanboys agrue and rave because its the only language they know. I have seen exceptionally well coded .NET and PHP sites, and I have seen poorly coded .NET and PHP sites. Both supports the major players in the DB formats (MSSQL and MYSQL). It boils down to this... 1.) If your on a budget, I say go with PHP (Free everything) 2.) If your wanting to build a site and a complimenting desktop application, go with .NET You will be able to reuse alot of code (if coded correctly of course) 3.) If your wanting to use a free OS or hosting on a linux box, go with PHP 4.) If your not c type programmer and BASIC makes more sense to you, go with .NET 5.) If your using SQL Server, or SQL Server EXPRESS, "I" Say go with .NET although PHP can hook into these as well, its just that .NET has great native support for MSSQL, and MSSQL Express 6.) If your working with webservices again "I" say go with .NET, you can handle webservices with great ease. But so can PHP. So this is a perference for me. Speed wise, they both run well. Don't bog yourself with nanosecond arguments from lang. fanboys. Thats it from me, thats my 2 cents Cedric

Posted by andre3, 03-01-2007, 06:35 PM
i say php is better..... than asp

Posted by That Guy, 03-01-2007, 06:53 PM
Very nice post cis4life, it helped me out. Thanks!

Posted by che1959, 03-03-2007, 01:18 AM
For me, it all boils down to the point that php is free. ASP prices money to get the tools to develop and there aren't enough free resources to learn how to develop with it. Plus, PHP is fun to learn.

Posted by Renard Fin, 03-03-2007, 04:32 AM
Nice comparison cis4life Now THAT is what I call a constructive post. By the way, just my 0.02, Yahoo front end is entirely build on PHP, so I guess it can scale fairly well if you are good programmer.

Posted by FXMarket, 03-04-2007, 12:29 AM
The idea is that rich websites such as corporation websites often have the .aspx extension, so that's a fact php is not better than asp.net but asp.net prices a lot more! that's idea I think. Depending on your site type, business priority, and what you afford to pay - The result is similar -- performance, reliability, speed, database..

Posted by Jatinder, 03-04-2007, 12:40 AM
Renard, can you point me to the link/resource which substantiates the above. Not that I doubt you word, but I will love to have something which I can show to my clients who worry that PHP will not scale.

Posted by Renard Fin, 03-04-2007, 03:30 PM
Ugh! Gotta have to find that on the Internet. I've once read it on a french magasine where there were an interview with founder of PHP himself (Programmez magasine). I will edit if I can find something.

Posted by Jamie Edwards, 03-04-2007, 03:47 PM
I think PHP is a nicer language because it is not OS-restricted and I allows the programmer to do bad things without an application falling apart ASP is a better language and more akin to a proper programming language, rather than a slap-dash scripting language. Because ASP has stricter rules (explicit types, rather than implicit types and so on) it naturally encourages tighter programming and inherent secure programming. My language of choice: PHP - for portability, mainly

Posted by Renard Fin, 03-04-2007, 04:14 PM
Cant edit apparently. So here are some links: http://devzone.zend.com/node/view/id/874 http://www.internetnews.com/dev-news...le.php/1491221

Posted by nikola8, 03-05-2007, 09:15 AM
I prefer php becouse it's free and hostng is cheaper.

Posted by NetFX, 03-05-2007, 07:10 PM
depends on what your coding preference is in learn BOTH and make your own mind up. other people have. ASP.net deisgn apps for desktop,web,webserice,PDA php web. PHP free, hosting prices less than windows but if you have a 9-5 it wont hurt your pocket i code in asp.net but am learning PHP As for which is more powerful well IT ALL DEPENDS ON THE CODER and the equipment (hardware) he has at his disposal

Posted by MrRadic, 03-05-2007, 07:52 PM
ASP.NET is free.....you can even download VS Express completely free. Hosting is cheaper by what, $1 - $2/mo? Windows hosts are generally better quality. Also, ASP.NET is 2 - 3 times faster than PHP, we're not talking about nanoseconds -- we're talking double to triple the traffic with the same CPU usage. Get your facts straight.

Posted by NetFX, 03-05-2007, 08:02 PM
CAn you send me the app in .net vs PHP where it shows .net is faster so i can conduct my own tests please since you ruled out the CPU's being same I only ask to get my facts straight too THanks

Posted by drhowarddrfine, 03-05-2007, 09:24 PM
PHP is a better language for one reason only: ASP.NET is not a programming language at all.

Posted by cis4life, 03-05-2007, 09:48 PM
i have written complex programs in both .net and php, and take it from someone who does this for a living, speedwise .net and php are not all that different. show me one program that runs .net 2 to 3 times faster, show me just 1. if your gonna talk the talk, at least have YOUR facts straight before coming here with rubbish. i write medical and simulation programs for a living and .net and php are my languages of choice. so unless u can show us (no talk, tanglable proof) your finding, don't just start talking out your a--.

Posted by jt2377, 03-05-2007, 11:21 PM
http://arc.apotheon.org/cheats/php.php?content=phpbegin lol. it's funny and so true about PHP. you need to trace PHP's history. it started with mixed perl/C/C++ so the syntax is all f'ckup and weird. PHP: $foo->bar vs C#: foo.bar i use both and i like C# for its elegance, strong type and better OOP (for example PHP have no namespace) it's really point less talking about which tool is better. it's what you perfer. syntax and OOP wise. C# is far better than PHP. BTW, ASP.net is a framework(platform) while PHP is a lanauge. it is a better comparsion if you compare C# and PHP. PHP: loops: Highly useful for dealing with arrays, the foreach loop has a simple structure. An array is related to a scalar variable name on which the contents of the loop operate. Both "normal" linear arrays and associative arrays can be accessed in this manner for iteration through their contents. foreach($foo as $bar) { echo $bar; } There's an alternate syntax, of course. foreach($foo as $bar): echo $bar; endforeach; The while loop is simple and handy. while($foo == $bar) { do stuff, hopefully including a change in the value of $foo or $bar eventually; } An alternate syntax exists for this as well: while($foo == $bar): do stuff, et cetera; endwhile; lol. no bracket and with bracket. does it confusing you?

Posted by drhowarddrfine, 03-05-2007, 11:55 PM
But you don't know the difference either?! .NET is not a programming language!

Posted by TCP/IP Warrior, 03-06-2007, 12:52 AM
You are right... .NET is NOT a programming language... it is a FRAMEWORK where languages can be born, live, and GROW... Something that PHP doesn't have.

Posted by Landho, 03-06-2007, 01:44 AM
Thank you for finally pointing out that .NET is not a "language" but the framework... and i second jt2377's post in that it is easier to compare C# with PHP. Indeed, depending on your project should help drive you to either solution - consider things such as who will be developing it and what they're preference is, who will be hosting it and what they're preferences are, and who will support it long term and what they're preference is.

Posted by cis4life, 03-06-2007, 03:33 AM
dude, everyone knows that .net is a framework. when i say ".net" im saying i program in the .net framework (vb.net and c#) so dont try to twist what im saying. so lets not play the word game here, i've been doing this professionally for over 15 years. and dont have to play "lingo" to make myself feel im smart. the question here was simply, which was better, .net or php and that is a legit question cause .net is the programming framework your program will be ran from, c# is just the syntax. just like the php engine is the driving force of php, php code is just syntax and has no barring in speed and so forth. Last edited by cis4life; 03-06-2007 at 03:37 AM.

Posted by maxymizer, 03-06-2007, 05:54 AM
This turned out to be just like fyrestrtr said it'll be.

Posted by drhowarddrfine, 03-11-2007, 12:21 AM
cis4life, I was out of town so couldn't get back to this. He was trying to compare two languages. How can you compare PHP to a framework? Show me the code to add two numbers together in .NET and not use C# or VB, etc. It's comparing apples/oranges. If you want to compare the languages of .NET to PHP then you have to go through all of them, both managed and unmanaged; so now you have to throw Cobol in the mix. Nobody is playing any word games here. Call it what it is and .NET is not a language.

Posted by jt2377, 03-11-2007, 02:03 AM
It's meaningless to compare ASP.net and PHP. It come down to if PHP give you a better coding environment or .Net. It also come down to what will cost you more. There are many reports that sugges Microsoft is better while some suggest OSS is better but is it really a black and white choice? if you have a team with skills in .Net/Windows, why do you want to force them to work on LAMP? it also come down to your time. Time is expensive cost to consider. If you have nothing to do but to read/learn all day long then sure go with whatever but if you don't have the time and you need to ship the software. why in the world would you care if you go with Windows or Linux? if you don't have time to learn LAMP, why do you want to ship something written for LAMP. oh, you think your skill is so mad from renting a couple of cheap dedicated fancy desktop as linux server. you can call yourself a *nix admin? that's so far from it you're kidding yourself. let's review. 1. Do you have the time? (my fiirst job after college was working at a small building automation engineering firm to create in house application to automate some engineers daily tasks. I chose Visual Basic.net (.Net 2). why? because i already know how VB work and familiar with its syntax, it will be a waste of time for me to learn Perl, PHP or java(that's what they want but i make my case because i know VB and can do it now. if you want this done right away, you can let me do it in VB or you can hire someone else to do it in Java. LOL. they pick me. i think because i was out of school and work for peanuts and the owner is kinda cheap. anyway. see my point. Do you have the time to learn a new lanaugae or can you leverage what you know now and ship something out. oh, it take me 8 months to create a custom in house app that automate about 80% of their work. It's not perfect but hey, i did it and they can use it. 2. Do you know the technology well enought to make it work? If you have to learn something from scratch. why not stick with what you know for now and learn whatever you want during your off time and do it on the next project. Windows vs Linux / PHP vs ASP.net is all a pissing game between programmers who try to show off who got the biggest d!ck. Why do i care what tool i use as long as i enjoy program with it and make me money? Isn't PHP engine is created with C++? Why don't you all just learn C++? Last edited by jt2377; 03-11-2007 at 02:07 AM.

Posted by cis4life, 03-11-2007, 11:17 PM
Once again thats wrong. With .NET, no matter what syntax you use, its still in the end is converted to the same (moreless) byte code, and thus the execution of code is moreless the same, so we don't have to go through all the .net languages, cause in the end its all the same. As I said before, it's all about preference and budget. If you can code well, speed wise it will work fine. There are plenty of high traffice php sites as well as .net site. Budget/your hardware setup and preference.

Posted by softpro, 03-19-2007, 11:40 AM
The first person replied to this post was right, you started a war between who likes what but I still haven't seen one good comparators in technical way between php and asp.net/c#. When you're comparing languages/platforms, you have to state technical facts about the platform and how it's built and run and what are things that one has and the other doesn't, what are the advantages and disadvantages. A technical comparison should not include cost/price/os it's run on/database etc, because you're comparing two language platforms and not how much it prices or where it's run. I again use both php and asp.net, and I have been asked many times, what is the difference even after describing the simple cost differences, ide etc, clients want a technical difference comparison and not cost or os it's run on. I'm looking more into this, but those of you don't know, here is a couple of point s that you can include in any technical comparison doc, and this is a huge plus. *** ASP.NET has multi-threading and PHP does NOT!! (BIGGEST POINT) *** ASP.NET now has AJAX LIBRARY, makes Ajax programming much faster than you could ever imagine with PHP. *** ASP.NET now has built in Security classes PHP does NOT. *** ASP.NET provides more syntax options VB.NET, C#, J# and maybe soon PHP *** ASP.NET has Code Behind files, keeping server side code separate from html *** PHP is much faster to deploy. And when comparing, do not include what workarounds you can find or 3rd party template engines, etc, I know they exist, and even more for PHP, but you should compare what each platform offers by default without any 3rd party code or your custom modules. And those of you saying ASP.NET is not a programming language, true, but your language doesn't make the program run, it's the library and the engine that makes it run, so the syntax has nothing to do with how it's run. After all engines/platforms are nothing more than library that helps the programmer to code less and provide a syntax to speed up programming from what it used to be, binary, 00011111111, to user friendly syntax which still at the end converts everything to 000111's. And if ASP.NET provides more syntax options doesn’t make it a bad platform. those of you have the time, do actual technical research and see if you can find facts about each platform.

Posted by sunpost, 03-19-2007, 04:46 PM
one of the more interesting things is that PHP typically performs better when it is compiled to run in asp.net... http://www.php-compiler.net/doku.php...e%3abenchmarks

Was this answer helpful?

 Print this Article

Also Read

Compromised???

Posted by Chinese Democracy, 04-20-2009, 12:01 PMIt appears that one new sign-up on a shared...

CPanel - Change email password without logging into Cpanel

Posted by keith70, 03-14-2007, 12:48 PMIs there a script out there that will allow a user to...

Very slow MySQL Queries on better hardware

Posted by YYamagishi, 03-27-2008, 08:12 PMHi, I'm having a problem with a MySQL servers. I had:...

How do I stop /tmp directory hacks?

Posted by tnedator, 06-19-2008, 04:03 PMI'm on a Cpanel/WHM (latest release version) VPS with...

SQL 2005 Express Update

Posted by boonchuan, 05-04-2007, 07:50 AMI am using SQL 2005 Express Management Console in the...