PHP 与 ASP.NET 相比有哪些优势?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3989352/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What advantages does PHP have over ASP.NET?
提问by Luke101
I have opened a large web project on elance for a social network. I got over 30 bids on my project and many of the providers recommended php even though they had .net knowledge. many have said that php with drupal has many advanteges over the .NET framework but did not say what they were. Its hard to believe that a scripting language has advantages over a compiled language. Am I missing something here.
我在 elance 上为社交网络打开了一个大型网络项目。我的项目收到了 30 多个投标,许多供应商推荐了 php,即使他们有 .net 知识。很多人都说带有 Drupal 的 php 比 .NET 框架有很多优势,但没有说它们是什么。很难相信脚本语言比编译语言有优势。我在这里错过了什么。
回答by ceejayoz
PHP will run on essentially any server, for free. That's a fairly compelling feature for many folks.
PHP 基本上可以在任何服务器上免费运行。对于许多人来说,这是一个相当引人注目的功能。
There are lots of pros and cons of both, and it certainly doesn't boil down to scripting vs. compiled (incidentally, opcode caches like APC and things like Facebook's HipHop even the score on that point).
两者都有很多优点和缺点,当然不会归结为脚本与编译(顺便说一句,像 APC 这样的操作码缓存和 Facebook 的 HipHop 之类的东西,甚至在这一点上的得分)。
I'd say if someone's recommending PHP over ASP.NET, they code primarily in PHP. If they're recommending ASP.NET over PHP, they code primarily in ASP.NET. There's probably not much more to it than that in the responses you're getting.
我会说如果有人推荐 PHP 而不是 ASP.NET,他们主要使用 PHP 进行编码。如果他们推荐 ASP.NET 而不是 PHP,他们主要使用 ASP.NET 进行编码。可能没有比您得到的回复更多的内容了。
回答by bpeterson76
Ugg, the weekly PHP vs ASP/.net argument. Let me frame it this way:
Ugg,每周 PHP 与 ASP/.net 争论。让我这样构图:
- Both work. Well, actually.
- Neither is really more "enterprise grade" than the other.
- .Net developers (at least in my area) tend to make more. That being said, the Government "drank the microsoft Koolaid" and most jobs in my area are for government contractors. It may be different where you are.
- PHP really doesn't have a great GUI yet. Not an issue to those of us who are command-line types, but it could be for you.
- .net solutions tend to be relatively unified since Microsoft is driving the bus. There's about a million different ways to skin a cat in the PHP world because it is relatively fractured.
- In my experience, PHP tends to be better documented with many more how-to's online. If you disagree, you might be a writer for Microsoft's tech net, which is written partially in some alien/geek mashup dialect of English.
- MANY php how-tos and forums are frequented by non-native English speakers, and entire projects can be frustratingly impossible to understand because of the language barrier. It seems that Europe has picked up PHP at a higher rate than those of us in the States.
- 两者都有效。实际上。
- 两者都不是真正比另一个更“企业级”。
- .Net 开发人员(至少在我所在的地区)往往会赚更多。话虽如此,政府“喝了 microsoft Koolaid”,我所在地区的大多数工作都是为政府承包商提供的。你所在的地方可能会有所不同。
- PHP 确实还没有很好的 GUI。对于我们这些命令行类型的人来说不是问题,但它可能适合您。
- .net 解决方案往往是相对统一的,因为 Microsoft 正在推动总线。在 PHP 世界中,有大约一百万种不同的方法来给猫剥皮,因为它相对来说是破碎的。
- 以我的经验,PHP 往往有更好的文档记录,有更多的在线操作方法。如果您不同意,您可能是 Microsoft 技术网的作者,该技术网部分是用某种外星人/极客混搭英语方言编写的。
- 许多 php 操作指南和论坛经常被非英语母语人士访问,并且由于语言障碍,整个项目可能令人沮丧地无法理解。似乎欧洲采用 PHP 的速度比我们在美国的要高。
I was indirectly involved in a Microsoft Case Study that I think illustrates the difference. I worked at one Olympic non-profit on a php-based site. They opted to standardize on Microsoft and move to an entirely .net/sqlserver based. I moved over to another nearly identical non-profit (just a different sport) who was embarking on an in-house build of a PHP-based website with nearly identical functionality to the one I left.. The .net website, when completed, cost $1.5 million, involved 16 servers, and required 3 additional full-time staff hires to extend and maintain. The same level of service, programmed in-house by 3 guys on PHP in a shorter amount of time ran on 3 servers (two application, one MySQL DB) and cost about $25k when all was said and done. Microsoft published the .net solution as an official Microsoft Case Study success. You be the judge....when you compare the solutions, I'm not sure they're even. Both serve nearly identical traffic and process very similar amounts of money. I know where my time and money would go.
我间接参与了微软案例研究,我认为这说明了差异。我在一个基于 php 的网站上的一个奥林匹克非营利组织工作。他们选择在 Microsoft 上进行标准化并转向完全基于 .net/sqlserver 的。我转到了另一个几乎相同的非营利组织(只是一项不同的运动),该组织正在内部构建一个基于 PHP 的网站,其功能与我离开的网站几乎相同。.net 网站完成后,耗资 150 万美元,涉及 16 台服务器,并需要额外雇用 3 名全职员工来扩展和维护。相同级别的服务,由 3 个 PHP 人员在更短的时间内在 3 台服务器(两个应用程序,一个 MySQL 数据库)上运行,成本约为 25,000 美元。Microsoft 发布了 .net 解决方案,作为 Microsoft 官方案例研究的成功案例。您是判断者....当您比较解决方案时,我不确定它们是否相等。两者都提供几乎相同的流量并处理非常相似的金额。我知道我的时间和金钱会去哪里。
回答by Faizan S.
The most significant advantage of PHP might be that it is freeand you can start developing it without having to install too many things. (Apache, PHP and an editor)
PHP 最显着的优点可能是它是免费的,您可以开始开发它而无需安装太多东西。(Apache、PHP 和编辑器)
After working with the Prado frameworkfor a while, I don't see any big differences with it anymore.
在使用Prado 框架一段时间后,我看不出它有什么大的不同。
OF Course : Visual Studiomakes developing and debugging ASP.NET apps a dream.
当然:Visual Studio使开发和调试 ASP.NET 应用程序成为梦想。
回答by Cyril Gupta
It doesn't really matter if you choose PHP or ASP.Net, both can deliver, both have a solid base, both are proven technologies. PHP is a mite cheaper, but ASP.Net is getting there.
选择 PHP 还是 ASP.Net 并不重要,两者都可以交付,都有坚实的基础,都是经过验证的技术。PHP 便宜一点,但 ASP.Net 正在实现这一目标。
Unless you're going to maintain the app for a long time ASP.Net's superior OOP capabilities aren't going to offer you much advantage. But if you've got a non-trival app then the multi-layered ASP.Net approach might be helpful.
除非您打算长期维护该应用程序,否则 ASP.Net 的卓越 OOP 功能不会为您提供太多优势。但是,如果您有一个重要的应用程序,那么多层 ASP.Net 方法可能会有所帮助。
Just get the coder you're most comfortable with.
只需使用您最熟悉的编码器即可。
回答by Matthew Vines
I tend to prefer c# development to php development, but both are perfectly valid choices.
与 php 开发相比,我更喜欢 c# 开发,但两者都是完全有效的选择。
One of the main advantages php has over asp.net is just the volume of ready made components, controls, libraries, and frameworks out there that are available for use.
php 与 asp.net 相比的主要优势之一就是可供使用的现成组件、控件、库和框架的数量。
It is entirely possible that your project could be assembled in php much faster than in asp.net if the right tools are available.
如果有合适的工具,您的项目完全有可能在 php 中比在 asp.net 中更快地组装。
回答by tpae
I would choose ASP.NET mainly because of Visual Studios, makes programming a lot easier.
我会选择 ASP.NET 主要是因为 Visual Studios 使编程变得容易很多。
I would choose PHP mainly because of variety of frameworks, such as CodeIgniter.
我会选择 PHP 主要是因为各种框架,例如 CodeIgniter。