1. Not able to use tools like phpDoc to properly comment your code
2. Turning a blind eye to excellent integrated development environments like Zend Studio or Eclipse PDT
3. Never used any form Version control system, such as Subclipse
4. Not adopting certain coding and naming standards, as well as common conventions, cannot be implemented in the project development cycle
5. Not using a unified development approach
6 . Not converting (or) not validating certain input or SQL query strings (Annotation: refer to PHP related functions)
7. Not planning your program thoroughly before coding
8. Not using test-driven development
9. Not coding and testing with errors enabled (Annotation: refer to PHP function error_reporting)
10. Turning a blind eye to the benefits of a debugger
11. Not refactoring your code
12. Do not use similar MVC patterns to divide different levels of the program
13. Don’t know these concepts: KISS, DRY, MVC, OOP, REST
14. Do not use return but directly in your function or Output (echo/print) content in the class
15. Turn a blind eye to the advantages of unit testing or general testing
16. Always return hard-coded HTML, but never return pure data, strings, or objects
17. Always hardcode "message" and "configuration parameters"
18. Do not optimize SQL query statements
19. Do not use __autoload (Translation: refer to the PHP manual for related descriptions )
20. Intelligent error handling is not allowed (Translation: refer to PEAR's ErrorStack)
21. Use $_GET instead of $_POST to do destructive transfer operations
22. Don't know how to exploit it Regular expressions
23. Never heard of SQL injection or cross-site scripting
24. Simple configuration is not allowed, nor is the constructor of a class allowed to accept parameters and then execute the set/get method. Or constant definition at runtime
25. Not understandingthe advantages and disadvantages of object-oriented programming (OOP)
26. Abusing OOP regardless of the size of the situation
27. Thinking that the implementation is reproducible The software you use must be equal to/need to make your code follow OOP
28. Do not use smart defaults
29. There is no single configuration file
30. Don’t want to expose the file source code, but use . The inc suffix name has replaced .php
31. Not using the database abstraction layer
32. Can’t maintain the DRY style, that is, don’t repeat yourself. If you are always copying and pasting something, it means that your design is not good. Very bad
33. There is no implementation to let a function/class/method do only one thing, and they cannot be combined and used
34. Failed to try the features of OOP, such as abstract classes, interfaces, polymorphism, Inheritance, access control modifiers (Annotation: such as public, private, protected)
35. Optimize your program architecture design without using existing design patterns
36. Don’t allow your users to use the existing design patterns Define a base directory when there are many files or directories
37. Pollute the namespace, such as naming your library functions with common strings
38. Do not use table prefixes when using database tables
39 . Not using a unified template engine
40. Not paying attention to the existing PHP development framework and being lazy to explore; in fact, advanced development concepts and wonderful code are contained in it.
The above has introduced how to get rid of these bad habits, you are no longer a rookie, including object-oriented, regular expressions, and design patterns. I hope it will be helpful to friends who are interested in PHP tutorials.
🎜
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn