40 signs that you're still a beginner in PHP _php Digest

Source: Internet
Author: User
Tags constant definition error handling sql injection version control system
I would like to put this article into my "programming embarrassing" series. Despite the exposure to software engineering, enterprise-class software architecture, and database design in the formal university curriculum, I have come to realize from time to time the "guilt" that has been brought to me by the fact that, of course, it is my subjective feeling and facing eclipse:

You are a PHP rookie, if you:


1. Do not use tools such as Phpdoc to properly annotate your code
2. Ignore the excellent integrated development environment such as Zend Studio or eclipse PDT
3. Never used any form of version control system, such as Subclipse
4. Do not use some coding and naming standards, as well as general agreement, can not be implemented in the project development cycle
5. Do not use a unified development approach
6. Do not convert (or) or verify some input or SQL query string (reference PHP related functions)
7. Do not plan your program thoroughly before coding
8. Do not use test-driven development
9. Do not encode and test in the wrong open state (reference PHP function error_reporting)
10. Ignore the benefits of the debugger
11. Do not refactor your code
12. Do not use the similar MVC pattern to divide the different levels of the program
13. Do not know these concepts: KISS, DRY, MVC, OOP, REST
14. Output (Echo/print) content directly in your function or class without return
15. Ignore the advantages of unit testing or generic testing
16. Always return hard-coded HTML, but not return pure data, strings, or objects
17. Always Hard-code "message" and "Configuration parameters"
18. Do not optimize SQL query statements
19. Do not use __autoload (refer to PHP manual related description)
20. Do not allow intelligent error handling (Errorstack of Pear)
21. Use $_get instead of $_post to do destructive delivery operations
22. Don't know how to make use of regular expressions
23. Never heard of SQL injection or cross-station scripting
24. A simple configuration is not allowed, and the constructor of the class is not allowed to accept parameter passes and then execute the Set/get method, or the constant definition of the runtime
25. Do not understand the advantages and disadvantages of object-oriented programming (OOP)
26. Misuse of OOP without regard to the size of the situation
27. The realization of reusable software must be equal to/need your code to follow OOP
28. Do not use the smart default value
29. No single configuration file
30. Do not want to expose file source code, but with the. inc suffix replaced. php
31. Do not use the database abstraction layer
32. Can not maintain dry style, that is not repeat themselves, if you are always copying and pasting something, it means that you are poorly designed
33. There is no implementation that allows a function/class/method to do only one thing, nor can it be combined to use them
34. Failed to try OOP's expertise, such as abstract classes, interfaces, polymorphism, inheritance, access control modifiers (such as public, private, protected)
35. Optimize your program system design without existing design patterns
36. Do not allow your users to have a lot of files or directories in the context of the definition of the underlying directory
37. Polluting namespaces, such as naming your library functions with common strings
38. Do not use table prefixes when using database tables
39. Do not use a unified template engine
40. Do not pay attention to the existing PHP development framework, lazy to explore; in fact, advanced development concepts and wonderful code contains.



Another Ma Yongjin translated version of the PHP Programmer's 40-point habits, concise and with the translator's comments.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.