I am kite, the public account “ancient time kite”, a not only technology public account, I have been in the app community for many years, mainly Java, Python, React also play 6 slash developer. The Spring Cloud series is complete, and you can check out the full series on my Github. You can also reply “PDF” in the public account to get the full PDF version of my elaborate tutorial.

“Is there a big man?”

Do you often run into these questioners in groups, or are you? As I have established several technology groups, I often meet such students. In the first few times, I will directly @ each other, and then tell them that if they have questions, just ask them directly, and they will answer. Otherwise, who will jump out and admit that they are the big guy?

Later,, I simply wrote such an article for the group of students to see, did not expect, by everyone’s strong approval, issued today, so that more students, especially new students learn to better ask questions, so that your questions will have more chance to get others to answer.

The Art of Asking questions

As a programmer, it is important to write good code, but it is not enough to write good code. Almost every once in a while, I see these two problems with people. The first is that I do not know how to ask questions. The second is that when there is work connection, useful information is not collected in real time, so I ask the same questions for many times.

Today we are going to talk about how to ask questions. Speaking of here, some students must be thinking, pull what pull, ask who can’t, why listen to 100 thousand since childhood, answer questions may not be, ask who can’t.

The question of how to ask questions has been around for a long time, and there’s even a book called The Art of Asking Questions. Of course, this question is not the usual “have you eaten yet? “And” What did you eat? It’s such a simple question. It refers to a professional problem, which, as a programmer, involves development, deployment, etc.

Let me start with a few examples of bad questions:

Some students ask questions in the group.

  1. The interface returned a 404 error. What is the cause?
  2. Dubbo service cannot start, what may be the cause?
  3. Yesterday everything was fine, and today the database is down. Does anyone know what happened?

Don’t laugh, this is not a joke, I’m sure you have encountered similar questions, in addition to the irony of the encounter, can only be ignored, as nothing. Poor quality questions are spam, noise, and who cares about noise, except for your boss or friends, who may be leching you about it.

This happens to students who are just beginning, but not always. Some students who have worked for several years are no better. The questions are bad, and I don’t think the code is any better.

Remember, once, wechat suddenly popped up several messages, just blocking the content I was about to operate, was upset, click in to find that a student is asking questions in the group, 5, 6 messages sent, still see people confused, unknowing.

Solve problems without asking for help

This is nonsense, of course, the question is a problem. Especially do development, from the beginning of the day, almost every day will encounter a variety of problems. However, not every question should be asked by your colleagues or group of friends.

Step 1: Look at the IDE prompt

In terms of development, the problems we encounter are compilation problems, runtime problems and logic bugs. When we encounter problems, the IDE will give hints, and most of the problems will be solved naturally according to the prompts, such as the retarded ones adding a semicolon less, adding @override less, etc

Step 2: Read the log

Look at the error logs. Some error logs are obvious, such as the NPE

Step 3: Find Google

It’s a huge treasure trove, especially these days, when almost any problem you encounter has been encountered by someone else, unless you’re working in a field that no one else has ever touched. The proposal chooses Google, Baidu searches not quite appropriate development.

Step 4: Ask questions

Only take this step and ask a colleague or group of friends if you have tried all the previous steps and still have no idea. This brings us to the question method we talked about today.

  1. Explain the background of the problem, including the environment configuration, version description, such as operating system version, Java version, etc., and some questions may involve the IDE.

  2. Error information about the problem, including log information and result output information.

  3. What attempts have you made, and the different results of each attempt;

  4. If it is a complex situation, see if you can abstract a simple model to simplify the complex problem, so that others can easily understand it and get the answer from others more quickly.

  5. There is another important point. A question may be answered by many people, and one or more of the methods may be effective. Then, after you solve the problem, be sure to give feedback to the respondents. For example, if you are in a group, you can @ the responder, the problem has been solved, using whatever method. This gives the respondent a sense of superiority for helping him solve the problem, and the other person understands the process so they can figure out how to solve the same problem in the future. And the questioner, making a summary, will also give a good impression. If they finish answering, there will be no movement, at least the next time I see him ask a question, I won’t answer, yes, it is so petty.

For example, suppose you encounter a JVM OOM problem that, after a series of log analyses and search engine searches, still does not resolve. So start asking questions in the group. The first step in asking a question might look something like this:

Hello everyone, I have encountered a JVM OOM problem. The current system environment looks like this:

The JDK version is 1.8, the server is CentOS 7.0 64-bit, the machine memory is 8 G, 8 cores, the garbage collector is CMS, and the JVM parameters set are:

-Xmx2688M -Xms2688M -Xmn960M -XX:MaxPermSize=512M -XX:PermSize=512M -XX:+UseConcMarkSweepGC -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=70 -XX:+ExplicitGCInvokesConcurrentAndUnloadsClasses -XX:+CMSClassUnloadingEnabled -XX:+ParallelRefProcEnabled -XX:+CMSScavengeBeforeRemark -XX:ErrorFile=/app/jvmlog/hs_err_pid%p.log  -XX:HeapDumpPath=/app/jvmlog -XX:+HeapDumpOnOutOfMemoryError -XX:+PrintClassHistogramBeforeFullGC -XX:+PrintClassHistogramAfterFullGC -XX:+PrintGCApplicationConcurrentTime -XX:+PrintGCApplicationStoppedTime -XX:+PrintHeapAtGC -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=9009
Copy the code

If necessary, provide the dump file.

Then talk about what you tried and what happened when you tried. That’s important.

Then mention possible reasons for your guess, such as cpu-intensive tasks on the project, or the possible impact of the recent addition of such and such features.

After asking questions in this way, other students can understand a general situation based on the information you give. At this time, enthusiastic students or students with similar experience can further analyze the information you give, so as to come up with a solution step by step.

taboo

  1. If you have a question, just follow the instructions above and post your question. Don’t say something innocuous like:

Q: Can someone help me with a problem?

A: Sorry, no

Q: Are there any big shots?

A: Sorry, no

This applies not only when asking questions, but also in other situations, such as going out with friends to admire flowers, the moon, and big kidneys. There is no benefit to doing so except wasting both parties’ time.

  1. Don’t assume that some feature or configuration you have is infallible. Trust me, most mistakes are stupid.

Strong man wait, first give a praise bar, always white piao, the body can not bear!

I am kite, the official number “ancient kite”. A programmer with both depth and breadth of encouragement teacher, a intended to write poetry but write up the code of rural code farmers! You can follow me now, or you can follow history articles later.