Give me a thumbs up, or I’ll make it. Wechat search public account “ancient kite”, a technical public account is not only technology.
As programmers who encounter problems every day, asking and answering questions is all too common, like this one.
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 not knowing how to ask questions. The second is that when there is work docking, the useful information is not recorded, many times to the same question.
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 returns a 404 error.
2, Dubbo service can not start, what is the possible reason?
3, yesterday was fine, today suddenly the database is not connected, does anyone know what is going on?
Copy the code
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.
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. Make clear the background of the problem, including environment configuration, version description, such as operating system version, Java version, etc., and some problems may involve IDE.
2. Error information related to the problem, including log information and result output information;
3. What attempts have you made, and what are the different results of each attempt?
4, if it is a complex situation, see if you can abstract out a simple model, simplify the complex problem, so that others can easily understand, and may get the answer of others faster;
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
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 problem, just follow the instructions above and post your question. Don’t say something innocuous like:
Can someone help me with a problem? ==> Sorry, no
Is there a big shot here? ==> Sorry, not in
This question applies not only to questions, but also to other situations where there is something to be said. There is no benefit to doing so except wasting both parties’ time.
2. Don’t assume that certain features or configurations are right. Trust me, most of them are stupid.
Creation is not easy, praise is a virtue, but also can give me the motivation to create. Thanks!
Wechat search public account “ancient kite”, a technical public account is not only technology. Follow me and join the group to communicate.
Sweep me!!!!!!! Sweep me!!!!!!!