Get rid of these bad habits, you are not a rookie, get rid of bad habits not in _php tutorial

Source: Internet
Author: User
Tags constant definition version control system

Get rid of these bad habits, you are not a rookie, get rid of bad habits not


1. Do not use tools such as Phpdoc to properly annotate your code

2. Turn a blind eye to an excellent integrated development environment such as Zend Studio or eclipse PDT

3. No form of version control system has ever been used, such as Subclipse

4. Do not adopt a coding and naming standard, and general conventions, can not be implemented in the development cycle of the project

5. Do not use unified development method

6. Do not convert (or) also do not validate some input or SQL query string (Note: 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 error-enabled mode (see PHP function Error_reporting)

10. Ignoring the benefits of the debugger

11. Do not refactor your code

12. Do not use a similar MVC pattern to separate the different levels of the program

13. Don't know these concepts: KISS, DRY, MVC, OOP, REST

14. Output (Echo/print) content directly in your function or class without return

15. Ignoring the benefits of unit testing or universal testing

16. Always return hard-coded HTML, but do 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 the PHP manual for a description)

20. Intelligent error Handling is not allowed (refer to Pear's errorstack)

21. Use $_get instead of $_post to do destructive transfer operations

22. Do not know how to use regular expressions

23. Never heard of SQL injection or cross-site scripting

24. Do not allow easy configuration, and do not allow the class's constructor to accept parameter passing and then execute the Set/get method, or run-time constant definition

25. Do not understand the advantages and disadvantages of object-oriented programming (OOP)

26. Misuse of OOP without regard to the size of the case

27. Consider yourself to be a reusable software must be equal to/need to let your code follow OOP

28. Do not use smart default values

29. No single configuration file

30. Do not want to expose the file source code, but replaced with the. inc suffix name. PHP

31. Do not use the database abstraction layer

32. Can not maintain dry style, that is, do not repeat themselves, if you are always copying and pasting something, it means that you are poorly designed

33. No implementation allows a function/class/method to do only one thing, nor can it be combined to use them

34. The ability to try OOP, such as abstract classes, interfaces, polymorphism, inheritance, access control modifiers (such as public, private, protected)

35. Optimize your program system design without the existing design pattern

36. Do not allow your users to define the base directory if you have many files or directories

37. Pollute namespaces, such as naming your library functions with common strings

38. Table prefixes are not used when using database tables

39. Do not use the unified template engine

40. Do not focus on the existing PHP development framework, lazy to explore, in fact, the development of advanced ideas and beautiful code is contained therein.

http://www.bkjia.com/PHPjc/1064533.html www.bkjia.com true http://www.bkjia.com/PHPjc/1064533.html techarticle get rid of these bad habits, you are not a rookie, break the bad habit is not in 1. Do not use tools such as Phpdoc to properly annotate your code 2. Excellent integrated development environment such as Zend St ...

  • Related Article

    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.