Home >Backend Development >PHP Tutorial >40 Signs You're Still a PHP Newbie_PHP Tutorial

40 Signs You're Still a PHP Newbie_PHP Tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-07-21 15:49:26906browse

I would like to include this article in my "Programming Mistakes" series. Although I have been exposed to software engineering, enterprise software architecture and database design in regular university courses, I still feel the "guilt" of the following facts from time to time. Of course, they are all my subjective feelings and are oriented to Eclipse:

You are a PHP newbie, if you:


1. Can’t use tools like phpDoc to properly comment your code
2. For excellent Integrated development environments such as Zend Studio or Eclipse PDT turn a blind eye
3. Have never used any form of version control system, such as Subclipse
4. Do not adopt certain coding and naming standards, as well as common conventions, and cannot develop projects Implement during the cycle
5. Not using a unified development method
6. Not converting (or) not validating certain input or SQL query strings (Annotation: refer to PHP related functions)
7. Not before coding Plan your program thoroughly
8. Do not use test-driven development
9. Do not code and test with errors enabled (Annotation: refer to PHP function error_reporting)
10. Turn a blind eye to the benefits of debuggers
11. Don’t refactor your code
12. Don’t use MVC-like patterns to separate different levels of the program
13. Don’t know these concepts: KISS, DRY, MVC, OOP, REST
14. Instead of returning, output (echo/print) content directly in your function or 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, string, or object
17. Always hardcode “message” and “configuration parameters”
18. Do not optimize SQL query statements
19. Do not use __autoload (Annotation: Refer to the relevant description in the PHP manual)
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 use regular expressions
23. Never heard of SQL injection or cross-site scripting
24. Simple configuration is not allowed, and the constructor of the class is not allowed to accept parameter passing and then execute the set/get method, or run Definition of constants when Make your code follow OOP
28. Don’t use smart defaults
29. No single configuration file
30. Don’t want to expose the source code of the file, but use the .inc suffix instead of .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 you have a poor design
33. Not implementing a function/class /Methods only do one thing, and they cannot be combined
34. Failed to try OOP’s strengths, such as abstract classes, interfaces, polymorphism, inheritance, and access control modifiers (Annotation: such as public, private, protected)
35. Do not use existing design patterns to optimize your program architecture design
36. Do not allow your users to define base directories when you have many files or directories
37. Pollute the namespace, For example, use common strings to name your library functions
38. Do not use table prefixes when using database tables
39. Do not use a unified template engine
40. Do not pay attention to existing PHP development frameworks and are too lazy to Explore; in fact, advanced development concepts and wonderful code are contained in it.



Translation Note: There is also a translated version of "40 Bad Habits of PHP Programmers" by Ma Yongzhan, which is concise and equipped with translator's notes.




http://www.bkjia.com/PHPjc/319518.html

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/319518.htmlTechArticleI would like to include this article in my "Programming Embarrassing Things" series. Although I was exposed to software engineering, enterprise software architecture and database design in regular university courses, I still experience...
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