1、不写注释

2、不使用可以提高生产效率的IDE工具

3、不使用版本控制

4、不按照编程规范写代码

5、不使用统一的方法

6、编码前不去思考和计划

7、在执行sql前不执行编码和安全检测

8、不使用测试驱动开发

9、编码时不打开自动报错(error_reporting)

10、不使用一种好的调试工具

11、不重构你的代码(refactor)

12、不采用MVC这样的分层结构

13、不知道以下等等概念:KISS,DRY,MVC,OOP,REST

14、在函数或者类里直接用print或者echo输出东西而不是返回(return)

15、不使用也不去了解单元测试

16、返回HTMl而不是data,strings,objects等类型

17、糟糕的代码和配置参数(hard code messages and configuration parameters)

18、不优化sql查询

19、不使用__autoload

20、不支持自动错误操作(应该是智能纠错)

21、使用$_GET替代$_POST去进行危险的参数传递(记得这40条都是错误的东西)

22、不知道怎样使用正则表达式

23、从未听说过sql注入和跨站脚本(安全方面,应该了解下这两个东西的英文:sql injection,cross-site scripting)

24、不支持简单配置,传递参数给类的构造函数,set/get方法,定义常量

25、不能理解OOP的优缺点

26、无论要做的东西有多小,都使用OOP

27、认为做可复用的软件就是OOP

28、不使用缺省值(don't choose intelligent defaults)

29、不使用单一配置文件

30、不想让别人看到代码,却使用.inc替换掉.php

31、不使用数据库抽象层(持久层)

32、开发时不DRY(Dont repeat yourself). (就是总开发重复的东西)

33、不开发可以重复使用的类或者方法

34、不使用抽象类或者接口类,继承,多态,封装.

35、不使用已有的设计模式优化你的程序.

36、不允许使用者定义基础目录(这点好象PHP不太适合,毕竟不是基于操作系统的开发)

37、错误的使用命名空间,使用大家都普遍使用的单词作为前缀.(这样以后别人使用会造成冲突.,例如自己定义一个function 叫 array_push())

38、使用数据库时不使用表前缀(这个很重要...)

39、不使用或者使用一个陌生的模板引擎(方便团队开发,大家要使用常见的模板)

40、不去看PHP的框架(大多数框架中都包含优秀的代码和先进的概念.值得我们学习)

以下是原文:

1. don't comment your code properly with something like phpDoc

2. don't see the need and/or benefits of a good programming IDE like Zend Studio or Eclipse PDT

3. have never used some form of version control like Subclipse

4. don't adopt some coding & naming standards and general conventions and stick to to them at least throughout the project

5. don't use a consistent methodology

6. don't escape and/or validate properly input or sql queries

7. don't plan your application thoroughly before starting to code

8. don't use test-driven development

9. don't program & test with error reporting on

10. don't see the benefits of a debugger

11. don't refactor your code

12. don't keep the different layers seperated using something like MVC

13. don't know what these stand for: KISS, DRY, MVC, OOP, REST

14. don't return content but echo or print it from your functions or classes

15. have never seen the advantage of unit tests or testing in general

16. return HTML, not data, strings, or objects.

17. hard code messages and configuration parameters

18. don't optimize your sql queries

19. don't use __autoload

20. don't allow intelligent error handling

21. use $_GET instead of $_POST for any destructive actions

22. don't know how to use regular expressions

23. you've never heard of sql injection or cross-site scripting

24. don't allow simple configuration, can be parameters passed to a class’s constructor, set/get methods called later, or constants defined at a runtime.

25. don't understand the benefits and limitations of Object Oriented Programming

26. misuse OOP / everything you write , no matter how small is OOP

27. you think reusable software equals/requires your code to be OOP

28. don't choose intelligent defaults

29. don't have one single configuration file

30. don't want the file contents to be seen, but give it a .inc extension instead of .php

31. don't use a database abstraction layer

32. don't keep it DRY, Don't repeat yourself. If you have to copy and paste or duplicate something your design may be off.

33. don't make a function/class/method do just one thing and don't make them interact.

34. don't try to take advantage of OOP specific features like abstract/interface classes, inheritage polymorphism & access modifiers.

35. don't optimize your application design with established design patterns

36. don't allow your user to define a base directory if you have multiple files and/or directories

37. pollute the global namespace, one option is to prefix the functions in your library with a common string

38. don't allow a table prefix when using database tables

39. use a separate template engine

40. don't take a look at established php frameworks for inspiration, most of them have advanced web dev concepts and good code

Reinhold Weber has put together a list of signs (40 in all on his "programming list of shame") that you're a lousy PHP programmer. Here's a sampling:
don't see the need and/or benefits of a good programming IDE like Zend Studio or Eclipse PDT 
have never used some form of version control like Subclipse 
don't use a consistent methodology 
don't use test-driven development 
don't return content but echo or print it from your functions or classes 
return HTML, not data, strings, or objects. 
don't allow intelligent error handling 
you think reusable software equals/requires your code to be OOP 
Now granted, some of them are a bit more high level than others, but if you're not headed towards a lot of these, you might change paths, hop out of that comfort zone and branch out into the community and the language a little bit more.

PHP程序员40点陋习的更多相关文章

  1. 大龄程序员的出路在哪里?八年老Android的一点心得

    这篇文章,给大家聊聊Android工程师的职业发展规划的一些思考,同时也给不少20多岁.30多岁,但是对自己的职业未来很迷茫的同学一些建议. 笔者希望通过此文,帮大家梳理一下程序员的职业发展方向,让大 ...

  2. 引领开发工具近40年的程序员Anders Hejlsberg

    有位神级程序员在近40年中一直创造引领潮流的开发工具(Turbo Pascal/Delphi/C#/TypeScript),他就是Anders Hejlsberg. 一. Anders并没有大学文凭, ...

  3. Java基础学习总结(40)——Java程序员最常用的8个Java日志框架

    作为一名Java程序员,我们开发了很多Java应用程序,包括桌面应用.WEB应用以及移动应用.然而日志系统是一个成熟Java应用所必不可少的,在开发和调试阶段,日志可以帮助我们更好更快地定位bug:在 ...

  4. Java 进阶 hello world! - 中级程序员之路

    Java 进阶 hello world! - 中级程序员之路 Java是一种跨平台的语言,号称:"一次编写,到处运行",在世界编程语言排行榜中稳居第二名(TIOBE index). ...

  5. 【腾讯Bugly经验分享】程序员的成长离不开哪些软技能?

    本文来自于腾讯bugly开发者社区,非经作者同意,请勿转载,原文地址:http://dev.qq.com/topic/57ce8068d4d44a246f72baf2 Dev Club 是一个交流移动 ...

  6. 从scheduler is shutted down看程序员的英文水平

    我有个windows服务程序,今天重点在测试系统逻辑.部署后,在看系统日志时,不经意看到一行:scheduler is shutted down. 2016-12-29 09:40:24.175 {& ...

  7. Java程序员应该掌握的10项技能

    这篇文章主要介绍了作为Java程序员应该掌握的10项技能,包括java的知识点与相关的技能,对于java的学习有不错的参考借鉴价值,需要的朋友可以参考下   1.语法:必须比较熟悉,在写代码的时候ID ...

  8. [No000096]程序员面试题集【上】

    对几家的面试题凭记忆做个总结,基本全部拿到offer,由于时间比较长,题目只写大体意思,然后给出自己当时的答案(不保证一定正确): abstract类不可以被实例化 蛋糕算法: 平面分割空间:(n-1 ...

  9. .NET程序员细数Oracle与众不同的那些奇葩点

    扯淡 距上次接触 Oracle 数据库已经是 N 年前的事了,Oracle 的工作方式以及某些点很特别,那会就感觉,这货就是一个奇葩!最近重拾记忆,一直在折腾 Oracle,因为 Oracle 与众不 ...

随机推荐

  1. < 软件工程 第一次作业 >

    自我介绍: 老师好! 我叫李智强,专业是计算机科学与技术,我自己也喜欢这个专业,然后这是我第一次用博客写自我介绍,可能会写的有点不好,还请包涵. 课程期望和目标: 第一次上课,听着老师说我们可能会做很 ...

  2. 自上而下,逐步揭开PHP解析大整数的面纱

    遇到的问题 最近遇到一个PHP大整数的问题,问题代码是这样的 $shopId = 17978812896666957068; var_dump($shopId); 上面的代码输出,会把$shopId转 ...

  3. 封装bootstrap-treegrid组件

    封装bootstrap-treegrid组件   阅读目录 一.开源的treegrid 1.组件效果预览 2.组件开源地址 二.封装treegrid 1.组件封装的必要性 2.组件封装代码示例 3.封 ...

  4. 转:【Java并发编程】之十五:并发编程中实现内存可见的两种方法比较:加锁和volatile变量

    转载请注明出处:http://blog.csdn.net/ns_code/article/details/17290021 在http://blog.csdn.net/ns_code/article/ ...

  5. 201521123065《Java程序设计》第六周学习总结

    1. 本周学习总结 1.1 面向对象学习暂告一段落,请使用思维导图,以封装.继承.多态为核心概念画一张思维导图,对面向对象思想进行一个总结. 1.2 可选:使用常规方法总结其他上课内容. 1.publ ...

  6. 201521123038 《Java程序设计》 第五周学习总结

    201521123038 <Java程序设计> 第五周学习总结 1. 本周学习总结 2. 书面作业 1.代码阅读:Child压缩包内源代码 1.1 com.parent包中Child.ja ...

  7. 201521123031 《Java程序设计》第4周学习总结

    ---恢复内容开始--- 1. 本周学习总结 1.1 尝试使用思维导图总结有关继承的知识点. 1.2 使用常规方法总结其他上课内容. (1)父类只能有一个,即单继承,子类继承父类的全部成员(属性和方法 ...

  8. 201521123017 《Java程序设计》第3周学习总结

    1. 本周学习总结 2. 书面作业 Q1.代码阅读 public class Test1 { private int i = 1;//这行不能修改 private static int j = 2; ...

  9. 201521123110 《Java程序设计》第1周学习总结

    第一周学习总结 本周开始了对java的初次学习接触,Java是一门新的编程语言不同于C,由于有了c的基础,对于Java的理解和学习也相对从前学C更容易些. 也学习了Java的诞生发展以及运用包括JVN ...

  10. Selenium_WebDriver_元素方法

    版权声明:本文为博主原创文章,转载请注明出处. 前面已经学习了定位元素,定位只是第一步,定位之后需要对这个元素进行操作,如在百度搜索首页的输入框进行输入文本,对"百度一下"按钮进行 ...