3. Look at the comments first
Developers search Stack Overflow daily. In multiple tabs, of course.
When we encounter related answers, we get hyped. Click the relevant links to find out more. The link is dead. Time wasted.
We try answer’s code snippet. Only to find out it is deprecated, or non-working.
What can we do to prevent these situations?
1. Lookout for obsolete answers
I recently did an upgrade of Hybris and stumbled into an issue. Started looking at our closed source, answers.sap.com. Found myself looking into obsolete documentation and obsolete answer.
The problem of this kind reproduces on StackOverflow. Looking into ever-changing frameworks for answers is hard.
Look at comments, comments describe the answer better.
75% of comments, can reveal if the answer is obsolete².
Most obsolete answers are around NodeJS, AJAX, Android, and ObjectiveC². I would argue a lot of answers, for new frameworks are obsolete.
Look if the answer applies to your environment. “Works for Angular 6”, and you’re face problems in higher versions.
2. What can you ask on StackOverflow?
Most of the questions live in a few categories³.
- Non-working code
- Unknown implementation
- How to implement algorithm (not related to the domain)
- Suggestions for new technology
Don’t ask domain-specific questions. You will rarely get an answer. Nobody will go in-depth for nothing.
Use Q&A sites, to find answers for task-specific issues.
You have problems asserting exceptions in the JUnit test. You’ll get a valid answer since the question is task-specific.
Ask about the core issues, issue with JDK, what is supported in the new version of NodeJS. These environmental questionsoften get valuable answers.
3. Look at the comments first
75.6% of tagged comments are informative¹.
Most users write comments in addition. I’ve recently added my way of solving the issue, as an addition.
We like confirmation comments. You see a lot of them.“It works”, or_“working for me on x.x version”_. You could use those as a confirmation of a possible fix.
There’s the other way, with rejecting comments. This doesn’t work or doesn’t suit the question well. You can use those to avoid the answer.
You could see comments in the form of updates. The solution changes because of new software versions. You shouldn’t miss those. They make or break the actual answer.
Conclusion
What should you take away from this article?
Look at obsolete answers. Read more comments.
Learn what you can ask, and then ask. Don’t ask domain-specific questions. Ask in a more generic way if possible.
Resources
[1] Zhang, Haoxiang & Wang, Shaowei & Chen, Tse-Hsun Peter & Hassan, Ahmed E.. (2019). Reading Answers on Stack Overflow: Not Enough!. IEEE Transactions on Software Engineering. PP. 1–1. 10.1109/TSE.2019.2954319.
[2] Zhang, Haoxiang. (2020). On the Maintenance of Crowdsourced Knowledge on Stack Overflow.
[3] M. Allamanis and C. Sutton, “Why, when, and what: Analyzing Stack Overflow questions by topic, type, and code,” 2013 10th Working Conference on Mining Software Repositories (MSR), San Francisco, CA, USA, 2013, pp. 53–56, doi: 10.1109/MSR.2013.6624004.
Photo byHelena LopesfromPexels
Top comments (0)