大型项目没有 PHP?为什么不? [英] No PHP for large projects? Why not?

查看:68
本文介绍了大型项目没有 PHP?为什么不?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我读过一些帖子,其中有人声明(未建议、未讨论、未提供)不应将 PHP 用于大型项目.

I've read a few posts where people have stated (not suggested, not discussed, not offered) that PHP should not be used for large projects.

作为主要的 PHP 开发人员,我问两个问题:

Being a primarily PHP developer, I ask two questions:

  1. 什么定义了大型项目"?
  2. 为什么不呢?使用 PHP 有哪些陷阱

我经营着一个小型开发团队,从经验中我知道质量构建、组织、文档、评论和封装是我们的首要任务.我们能够使用我们自己的框架和方法开发出色的项目,但如果我浪费时间,我仍然不想进一步投资.

I run a small development team and I know from experience the quality construction, organization, documentation, commenting and encapsulation are our highest priority. We are able to develop great projects using our own framework and approach but still, I don't want to invest further if I'm wasting my time.

想法?

推荐答案

当人们直截了当地说 PHP 是一种糟糕的语言时,我真的很讨厌它,因为您可以编写将演示与逻辑混合的代码,或者它允许您允许 SQL注射.这与语言无关,而是开发人员.

I really hate it when people say flat out that PHP is a terrible language because you can write code which mixes presentation with logic, or that it lets you allow SQL injection. That's nothing at all to do with the language, that's the developer.

PHP 已证明自己具有高度的可扩展性:维基百科是互联网上最大和最受欢迎的网站之一,它运行 PHP.说够了吗?

PHP has proved itself to be highly scalable: Wikipedia is one of the largest and most popular sites on the Internet and it runs PHP. Enough said?

有很多工具/库可以为您提供一个工作框架,从而减少有人编写糟糕、不易维护的代码的可能性:请参阅 CakePHP、Symfony、PDO、Smarty 等.

There are a lot of tools/libraries out there that give you a framework to work in, making it less likely that someone will write poor, less-maintainable code: see CakePHP, Symfony, PDO, Smarty, etc etc etc.

它受到了不好的评价,因为它是一种入门门槛很低的语言:它是免费的,你可以获得非常便宜的 PHP 托管,文档是最好的,还有大量的在线教程,加上它使很多事情变得非常简单(例如:打开一个 URL 并获取文件的内容:file('http://www.google.com');).这意味着很多新手都选择了它并用它制作了很多非常狡猾的网站,但是无论您选择哪种语言作为首选语言,都会发生这种情况.

It has received a bad rap because it's a language which has very low barriers to entry: it's free, you can get very cheap PHP hosting, the documentation is the best there is, there's plenty of tutorials online, plus it makes a lot of things very easy (eg: open a URL and get the contents of the file: file('http://www.google.com');). This means that a lot of newbies picked it up and made a lot of very dodgy sites with it, but that's going to happen with whatever language you choose as your first.

使用可靠的 ORM 框架(在 SO 上大约有 30 个关于哪个是最好的问题),它会对你很好.

Work with a solid ORM framework (there's about 30 questions on SO about which is best), and it will treat you good.

这篇关于大型项目没有 PHP?为什么不?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆