Good programmers are good writers.

Source: Internet
Author: User
: This article mainly introduces a good programmer who is a good writer. if you are interested in the PHP Tutorial, you can refer to it. Today I read the "ljianhui column" (http://blog.csdn.net/ljianhui/article/details/17341219) blog, there are a few words let me very much agree with "write code and write articles, is to clearly express their ideas", therefore, you also need to be clear-headed about writing code!

Recently, I also spent five months after my graduation and did not take the exam, this makes your technology a little outdated. There is still little practical work experience, especially in excellent teams. due to the fact that my technology is not solid, some time ago, I suffered a lot of technical losses. So I made up my mind to make up for my own technology. To be honest, I am not very obsessed with technology. However, since we are doing this, let's make a look! I believe that interest is cultivated, and no one will be interested at birth. it is still necessary to guide and explore interest points.

There are a lot of things to learn now, such as PHP, js, linux, mysql, distributed, cache.... everything depends on accumulation. please work hard.

Well, don't always say something virtual. let's write something real.

Today I learned about the PHP error handling mechanism and basic linux commands.

For error handling, I understand that the integrity and security of the code should be considered when writing code. The error handling mechanism is to avoid errors and make up for errors. For a brief introduction to the PHP error handling mechanism, refer to http://php.net/manual/zh/book.errorfunc.php:

1. Trigger, display, and handle errors.

1. you can configure the error report Level of error_reporting in the configuration file of php. ini. the error level can also be set in the server configuration file and PHP code.

2. you can use trigger_error () to generate a user-level error, notice, or warning information.

3. you can use the set_error_handler () function to set custom error handling functions.

II. about exception throw and capture.

1. The following is an excerpt from my book: "exception is caused by a type of scalability, maintenance, andObject-orientedProvides a unified mechanism for handling errors.

2.Exception handlingThe try... throw... catch statement sets a special policy for possible exceptions and sets different code paths. For example, if you think that a piece of code or a function may cause an error, you can put the code or function in the try {} code block, in the case of an error, manually throw an object in try {}, and catch the exception later in the try statement, you can set multiple catch statements to capture and handle different types of exceptions.

3. throw can throw any type of exception object,ExceptionClass instances or abnormal class instances inherited from her are recommended. You can go to Baidu or bing to describe what is not understood above.

2. you can use set _Exception_ HandlerException handlingFunction, which is used to avoid the exception of try/catch.

HereException handlingAnd the understanding of error handling is not very deep. sorry, please give me more advice. Because it has been more than 12 o'clock, we have to get up early tomorrow, so we don't have much time to elaborate on these things. we will definitely continue to elaborate on these things later. now we feel that a php error handling process is profound and profound, oh, I don't know.

The above describes how a good programmer is a good writer, including Exception, Exception handling, and object-oriented content. I hope my friends who are interested in PHP tutorials will be helpful.

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.