People ask questions everyday. Questions are asked in many forms. However, there is a “smart” way to ask questions and not so “smart” way to ask questions. How to Ask Questions the Smart Way describes the way one should ask a question if they want to receive positive feedback when seeking for help.
The following two examples demonstrate what is a “smart” question and what is not a “smart” question.
Example 1:
This question can be found here, where the poster asked:
Give your buttons some behavior. change the foreground color of the Button that was clicked. Choose at random among Color.RED, Color.BLUE, Color.YELLOW, etc. To change the color of the Button, call setTextColor on the Button that is passed to the event handler. However, note that although Button has a setTextColor method, View (the parent class of Button) does not. So, you have to cast the View to Button before calling setTextColor.
This question is not a “smart” question in many ways. As some of the commenters speculate, it seems the poster has just copied and pasted a portion of assignment onto Stack Overflow. The poster was expecting someone to do their own assignment for them rather than seeking for guidance or showing any sort of effort that was put into this particular problem. Additionally, the poster did not even state what the problem was, as demonstrated by the following comments:
What you want to ask ??
College assignment?
It is clear that no effort was put into the question, resulting in negative feedback from the online community.
Example 2:
This question can be found here, where the poster asked:
Given a software system written in Java consisting of three layers, A -> B -> C, i.e. layer A uses layer B and B uses layer C.
I want to make sure that a class of one layer only has access only to classes of the same layer or its direct dependency, i.e. B should be able to access C but not A. Also A should be able to access B but not C.
Is there an easy way to enforce such a restriction? Ideally I want eclipse to complain at once if one tries to access a class of the wrong layer.
The software currently uses maven. Therefore I tried to put A, B, and C into different maven modules and to declare dependencies properly. This works fine to prevent B to access A, but does not prevent A to access C.
Next I tried to exclude C from the dependency to B. This now also prevents access from A to C. However now I am no longer able to use copy-dependencies to collect all transitive dependencies needed for run time.
Is there a good way that allows me a clean separation of layers, but also allows me to collect all needed runtime dependencies?
This is a good example of how to ask questions in “smart” ways. The poster described their problems, steps taken to mitigate the issue, and how they went about it. As seen in the post, this particular question was well-received and garnered several responses. The poster demonstrated their prior attempts to resolve the issue, thus showing the willingness to learn.
If you could demonstrate your willingness to learn, online community will respond positively and try to guide you to answer. It shows that professionals are willing to help people who are willing to help themselves. Ask specific questions. Show your willingness to learn. Show that you put in effort into the question. You may not always get the answer you were looking for but the online community will be more willing to help you out.