A few days ago, I saw the art of asking questions in the development document when learning EasySwoole. Here are some suggestions based on the problems encountered in my own development process:
- Encounter problems do not panic, and read the newspaper error tips, error information for a series of screening, determine the scope of error
- Think carefully about the reasons for the problem, using your limited knowledge
- If the last two steps do not solve the problem, you can search baidu
Objective: from the development manual or document to find the solution to the problem rough: copy error information, direct baidu, find similar or even the same problem, the answer directly CTRL + V, successfully solve the ideal: determine the error range, list the problem list, fixed point, steps to solve the problem
- Ask the big guy. How? It will be said below
- Be prepared for something you can’t solve
- Take a different approach and repeat the first step
Here is the flow chart:
Think hard about solutions to problems
No one likes answering basic questions like:
- When you know echo “Hello world” but don’t know how to print “EasySwoole”
- When you know how to move files to/TMP, but don’t know how to move files to the directory of the specified date
- When you know mysql has an interpreter that can check if an index is being used, but you don’t know how to check if a combined index is valid when you get an error message, but you don’t know how to search for it
Search for solutions to problems
Similarly, when a question comes up in a direct search, no one is going to feed the person who keeps asking it. It’s an insult to the person who answers it. Try searching a search engine when you ask a question, and the answer may be on the first page
Development manual
When you don’t find obscure/unknown/unpublished questions in a search engine, you might want to consider whether there is a document you haven’t finished reading
- What’s the use of asking someone who doesn’t know anything about the project when search engines can’t find it?
- Why don’t you try to find a solution to this problem in the development documentation?
The basis of the problem
Don’t ask questions that you don’t know anything about. If you haven’t learned PHP, don’t ask questions about why if(){} is wrong without a condition. When you ask a question, you should know the basis of the question. Such as:
- When you’re not done with the tutorial, ask Swoole why do you need to reboot to change code after running it
- When you’re not done with the object, you get an error if you ask why don’t you use the namespace and when you connect to websocket, why do you make an HTTP request
Troubleshoot problems
Before you ask a question, you should first learn to survey the question and determine its general scope. Otherwise it’s impossible to answer. For example, when you ask “why can’t I upload a file? “, no one can answer you. You have to search until you get to a small area. Such as:
- An error occurred after the file was uploaded and selected.
- File selection succeeded, error making HTTP request.
- The HTTP request is successfully initiated, but the file information cannot be received from the backend. Procedure
- Failed to save the uploaded file. Procedure
Break a big problem down into steps and test each step yourself. Until one step is wrong (if every step is wrong, take it one step at a time)
Ask questions
When asking questions, we should avoid the following:
- In?
- Great god save me
- hello
- With big o
- Has anyone ever used XXX (say a framework, or an unknown project)
- How to do this (directly to the code)
- May I ask you a question? (Don’t ask a question, wait for someone to answer)
- What’s wrong with this code? (Send out a string of code, no questions asked)
- How do I change this code? (Send out a string of code, do not say how to change, do not say the problem)
- Why is this a problem for me? (Screenshot a section of “XXXXX” error message output by its own judgment does not screenshot the code)
- Can you consult (some language, some framework, some project a broad concept)
The right questions include the following:
- Describe exactly what you’re trying to do, what happened before and after the problem
- Take accurate screenshots. Don’t take pictures that are irrelevant to the problem or don’t help solve the problem
- Have the right attitude and ask for advice. No one has the obligation to help you.
The problems can be divided into the following types:
- Conceptual problems, the inability to understand an abstract concept
- Code problems, unexpected code conditions, errors, etc
- Framework problems, such as frame error, running error, running logic does not understand the problem
- Logic problems, lack of understanding of the logic of the implementation of a function
- Performance optimization problem
### Each question can be asked as follows:
Conceptual issues
Conceptual problems, we must describe accurately, and have the basis of self-understanding of the concept, such as:
- I’m not sure why you want to use object facing, direct function encapsulation?
- Why do coroutines use mysql connection pools etc
Code problem
Code problem, we need a screenshot of the code, and error message, and explain what they want to achieve the function, for example:
- I want to upload the file, I have tried to modify the permission, but I don’t know why the code reported an error (with the error message, and the code) and so on
Framework problem
Framework problem, we need to specify which part of the framework and what the problem is, for example:
- When using EasySwoole, it was found that the configuration file was incorrectly invoked in production mode
- When using TP3.2, upload files always report that the folder does not exist, but the folder exists
- When tp3.2 is used, the session lifetime cannot be configured
The logical question
Logic problem, we need to describe in detail which part of the logic of a function, for example:
- How is session expiration implemented?
- Mysql connection pool
Performance optimization problem
Performance optimization problem, need to confirm the slow place first, and then screenshot, for example:
- I find this code very slow. Is there anything wrong? (Attached code screenshot)
- This section of SQL I want to achieve XXXXX query, but very slow, can optimize? (Attached with SQL statement, table structure, interpreter screenshot)
Original text author: —— Artemisia —— pay attention to me “programmer’s broken thoughts” author, not the front end of UI is not good back-end do not forget the original intention, keep in mind the mission, for the content of the article has questions or in-depth exchange of learning friends can add me QQ: 2283743369