PHP Programmer's 40 bad habits, I almost all shot, PHP programmer 40 Bad Habits _php tutorial

Source: Internet
Author: User

PHP Programmer's 40 bad habits, I almost all shot, PHP programmer 40 Bad Habits


1, do not write comments

2. Do not use IDE tools that can improve productivity

3. Do not use version control

4. Do not write code according to programming specifications

5, do not use a unified approach

6. Do not think and plan before coding

7. Do not perform encoding and security detection before executing SQL

8, do not use test-driven development

9. Do not turn on automatic error when encoding (error_reporting)

10, do not use a good debugging tool

11. Do not refactor your code (refactor)

12, do not use a hierarchical structure such as MVC

13, do not know the following concepts: Kiss,dry,mvc,oop,rest

14, in a function or class directly with print or echo output things instead of return (return)

15, do not use or to understand unit testing

16. Return HTML instead of data,strings,objects type

17. Bad code and configuration parameters (hard code messages and config parameters)

18. Do not optimize SQL query

19, do not use __autoload

20, does not support automatic error operation (should be intelligent error correction)

21. Use $_get instead of $_post to carry out dangerous parameter transfer (remember that these 40 items are all wrong)

22, do not know how to use regular expressions

23, never heard of SQL injection and cross-site scripting (security aspects, should understand the following two things in English: SQL Injection,cross-site scripting)

24, do not support simple configuration, pass parameters to the class constructor, Set/get method, define constants

25. Unable to understand the pros and cons of OOP

26. No matter how small it is to be done, use OOP

27. The software that is considered to be reusable is OOP

28. Do not use default values (Don ' t choose Intelligent defaults)

29, do not use a single configuration file

30. Don't want others to see the code, but use. Inc to replace it. php

31. Do not use the database abstraction layer (persistence layer)

32, development is not dry (Dont repeat yourself). (that is, always develop repetitive things)

33. Do not develop classes or methods that can be reused

34, do not use abstract classes or interface classes, inheritance, polymorphism, encapsulation.

35, do not use the existing design mode to optimize your program.

36, do not allow users to define the base directory (this is as if PHP is not suitable, after all, not based on operating system development)

37, the wrong use of namespaces, using the commonly used words as a prefix. (This can cause a conflict after someone else uses it.), for example, define a function called Array_push ())

38. Do not use the table prefix when using the database (this is very important ...)

39, do not use or use a strange template engine (easy to team development, everyone to use the common template)

40, not to see the framework of PHP (most of the framework contains excellent code and advanced concepts. Worth learning)

http://www.bkjia.com/PHPjc/914481.html www.bkjia.com true http://www.bkjia.com/PHPjc/914481.html techarticle PHP Programmer's 40 bad habits, I almost all shot, PHP programmer 40 Bad habits 1, do not write comment 2, do not use to improve productivity of the IDE tool 3, do not use version control 4, do not follow the series ...

  • 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.