asp.net vs PHP for...?

2008-06-15 3:05 pm
creating a online community p.s. i know myspace is powered by asp.net but please if you are experienced please answer. Secondly, does php do eveyrthing asp.net can do?

回答 (7)

2008-06-15 3:24 pm
✔ 最佳答案
With enough hacks, work-arounds, and third party libraries, then PHP and ASP.Net can both do the same things. Personally I believe ASP.Net is a better technology. I work for a website development company and it's the general consensus that whatever the client asks for, ASP.Net is the technology that will get it done fast, secure, and done right the first time. 1000's of clients, only about 100 or so of them are in PHP (because we had an old developer who didn't know much ASP.Net). As for an online community? Definitely ASP.Net. If you need help developing it, or learning ASP.Net, email me and I'll provide more details about that.
參考: 6 years of programming and developing in a multitude of languages.
2008-06-19 7:44 pm
I'd say ASP.NET personally, but that's not to say PHP isn't a solid platform. PHP is capable of creating some amazing sites, but it's feature set is much less than ASP.NET, and a lot more work has to be done by hand.

Personally I'm an ASP.NET developer, although I've built several enterprise apps with PHP. I'd say PHP just feels dated. Reasons are

1: The Syntax to me is hideous

$numOfVisitors = 2;

echo $numOfVisitors . ' have visitied this site';

in PHP versus

int numOfVisitors = 2;

Response.Write(numOfVisitors + " have visited this site");

in C#. I'm all about code elegance, and PHP's syntax feels like symbol hell. Not to mention, ASP.NET is under the .NET banner, and .NET supports many server side languages like C#, VB.NET, J#(Java), and now even dynamic languages such as Python and Javascript on the Server side.

2. The separation of markup and code doesn't exist with PHP. I know there are 3rd party libraries that can do this, but this is 2008, it should offer code separation out of the box. Classic ASP had the same problem, which is why hardly anyone uses classic ASP anymore.

Markup page(Default.aspx):
<asp:TextBox id="TextBox1" runat="server" />

Code page(Default.aspx.cs):

TextBox1.Text = "I am a label";

to me is much better than:

<input type="text" id="TextBox1" value="<?php echo 'I am a label' ?>" />

Now granted there are a few situations where ASP.NET does use inline code, namely binding to GridViews, but not nearly as bad as PHP.

3. Microsoft just keeps coming out with cooler stuff. For example, the ASP.NET Ajax Library, where you can create Web Services that emit javascript proxies that you can call from your javascript code, and will return data in a JSON object for your javascript to instantly consume(instead of it's usual SOAP XML). No more building XmlHttpRequest objects by hand, or having to resort to a js library like Prototype or Mootools.


The downside of ASP.NET is the .NET part. If you're not familiar with .NET and all of its complexities, you'll have a difficult time with ASP.NET. With PHP, while it does have classes, fortunately you don't have to know object oriented programming to start writing something, and in ASP.NET everything is based on classes. Then again, if you're building a social networking site, and one of any decent size, much less planning on maintaining and improving it, you should both know and use object oriented programming (even with PHP).

Anyway, I know there are people who love PHP, and I respect that. Those same people often usually say PHP is better because ASP.NET has a higher learning curve. But in my opinion, it gives you more to work with, and I personally don't mind putting in more effort to learn something if the returns are greater.

Plus if you're learning to one day get a professional job, almost always if you go to a job search site (Dice, indeed.com, CareerBuilder, etc), there are usually at least twice as many ASP.NET position then there are PHP ones.

Anyway, hope that helps. I'd like to see an answer from a full time PHP developer to even the argument out
2016-10-17 11:59 pm
relies upon on your decision and the information superhighway website you go with to develop. own homestead page :- Its a ultimate option to choose for considering the fact that its an open source, you could at as quickly as develop a dynamic website and the language is user-friendly to study. additionally database connectivity is very easy while in comparison with different 2. JSP :- Java is the ultimate language to develop fairly much each and every thing. It provides great flexibility and dynamicity and maximum serious, protection. that's a great language yet recommendations you it demands a good studying technique, additionally java is finished open source. ASP :- Even it rather is sweet to develop yet i does no longer like it considering the fact that its no longer open source and there are a number of different concerns pertaining to to progression and the ambience(homestead windows in basic terms server) and licensing stuff. Cheers!!!
2008-06-20 8:40 pm
I like PHP because in general PHP-hosting is more affordable than ASP.NET-hosting (due to Windows licensing).
2008-06-19 2:39 pm
PHP can do anything ASP.NET can do, however, ASP.NET derives its powerful programming model from the power of the .NET framework and is more object oriented.
2008-06-15 3:29 pm
myspace is on asp... but as far as I know, facebook is written in php, so I think it's rather a matter of resources.
2008-06-15 3:14 pm
Asp.Net is more for corporative development. And doesn't matter it's better than PHP.

PHP can do everything Asp.Net does (including frameworks, could do even more).


收錄日期: 2021-05-03 13:59:55
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20080615070541AAQcede

檢視 Wayback Machine 備份