在 Web 开发中 - ASP.net 可以做什么而 PHP 不能做什么?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4186229/
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
In Web Development - What ASP.net can do that PHP cannot do?
提问by Garv
Just thinking if it's necessary to learn ASP.net.
只是想是否有必要学习ASP.net。
Also, which is faster to develop? If I learn ASP.net now..
另外,哪个开发速度更快?如果我现在学习 ASP.net..
I will be using one of those languages for my first Web Application.
我将在我的第一个 Web 应用程序中使用其中一种语言。
thanks!
谢谢!
采纳答案by Jakub
I think the best answer that CAN be given for this type of question is simply:
我认为可以为此类问题给出的最佳答案很简单:
TRY BOTH AND DECIDE FOR YOURSELF
尝试两者并自己决定
I have know devs that swear by PHP and others that swear by ASP.NET. There are also many that hate PHP but love ASP.NET.
我知道一些开发人员对 PHP 发誓,而其他人则对 ASP.NET 发誓。也有很多人讨厌 PHP 但喜欢 ASP.NET。
Your question is VERY subjective, it cannot be answered properly unless you dive into more specific details, like "Does PHP do threading?" etc.
您的问题非常主观,除非您深入研究更具体的细节,否则无法正确回答,例如“PHP 是否进行线程处理?” 等等。
We cannot tell you what youwill develop faster in, we don't know your skill level at grasping / using a new language, which is the assumption I have that you are new to both.
我们无法告诉您您将在哪些方面更快地发展,我们不知道您在掌握/使用新语言方面的技能水平,这是我假设您对这两种语言都不熟悉。
Howeversince I am biased to PHP, I would recommend PHP to try with, but that is my opinion.
然而,由于我偏向于 PHP,我会推荐 PHP 尝试,但这是我的意见。
回答by AspNetDev
PHP is a scripting language. ASP.NET is a framework.
PHP 是一种脚本语言。ASP.NET 是一个框架。
IMO the larger the project, the better ASP.NET will be.
IMO 项目越大,ASP.NET 越好。
回答by jocull
ASP.NET can do threads, while PHP cannot. Honestly that's about it. Someone will come and nit-pick about some other complicated task that PHP can't do, but PHP is a pretty robust and dynamic language overall.
ASP.NET 可以做线程,而 PHP 不能。老实说就是这样。有人会来挑剔一些 PHP 无法完成的其他复杂任务,但总的来说 PHP 是一种非常健壮和动态的语言。
If you are starting now and have never done C# or VB development, I would do PHP instead. It's much easier to pick up and has far fewer rules compared to C#. Yes, it can lead to bad coding practices because it is so loose and open. However, the documentation is phenomenal and you'll be moving much more quickly than you would in ASP.NET with no C# or VB experience.
如果您现在开始并且从未做过 C# 或 VB 开发,我会改用 PHP。与 C# 相比,它更容易上手并且规则更少。是的,它会导致糟糕的编码实践,因为它是如此松散和开放。但是,该文档非常出色,而且您将比在没有 C# 或 VB 经验的 ASP.NET 中移动得更快。
回答by Steve Hobbs
Talking just in terms of web development, there's probably not a lot you can't do with either language pretty equally.
仅就 Web 开发而言,使用这两种语言可能无法做很多事情。
Having used both languages for extensive web development, I've found that Asp.Net probably out-does it. The tooling support is better, has great documentation, all the stuff you need is now free and you can get up and running with it extremely quickly.
使用这两种语言进行广泛的 Web 开发后,我发现 Asp.Net 可能胜过它。工具支持更好,有很好的文档,你需要的所有东西现在都是免费的,你可以非常快速地启动和运行它。
Like has been already said, it depends on whether you prefer a dynamic scripting language or a strongly-typed modular language. I'd suggest you start with PHP though as then you don't have to deal with more advanced Asp.net concepts like events, controls, viewstate, class libraries, etc. You can pick those things up easy enough once you've got to grips with the syntax and programming for the web.
就像已经说过的那样,这取决于您更喜欢动态脚本语言还是强类型模块化语言。我建议你从 PHP 开始,因为这样你就不必处理更高级的 Asp.net 概念,如事件、控件、视图状态、类库等。一旦你掌握了这些东西,你就可以很容易地掌握这些东西掌握 Web 的语法和编程。
回答by Sudantha
I think that web development dont depend on its language because which is the language is the concepts are the same like sessions / cookies
我认为 web 开发不依赖于它的语言,因为哪种语言是概念是一样的 sessions / cookies
ASP.NET and PHP both are powerful languages it can do the same functionalities.
ASP.NET 和 PHP 都是功能强大的语言,它们可以完成相同的功能。
But I believe that if you are a newbie better to kick start with phpbecause it will be easy to understand the web conceptsand u can easily move to a language like ASP.NET.
但我相信,如果你是一个新手,最好从php开始,因为它很容易理解web 概念,而且你可以轻松地转向像 ASP.NET 这样的语言。
回答by Bryan M.
In terms of actual capabilities, there is very little difference. However, the two platforms vary greatly in their design approach, and culture. There is no way to determine which would be faster to develop with. In a specific situation, one may lend itself to a more rapid development cycle than the other or vice versa.
就实际能力而言,差别很小。然而,这两个平台的设计方法和文化差异很大。没有办法确定哪个开发速度更快。在特定情况下,一个可能比另一个更快速的开发周期,反之亦然。
I would spend some time exploring both platforms, and choose the one which seems to suit you best. I would also note that ASP.NET tends toward a more enterprisey audience, so if you're looking to develop a career in one area, it's something to be aware of.
我会花一些时间探索这两个平台,然后选择最适合您的那个。我还要指出的是,ASP.NET 更倾向于有企业精神的受众,因此如果您想在某个领域发展职业,则需要注意这一点。