Can I ask you a question?

27 Jan 2022

Maximum effort!

  If you’ve gone to a typical school you’ve probably had to ask a question at some point. What’s the first thing you do when asking a question? If you guessed raising your hand, then I think you are on your way to learning how to ask a “smart” question. Raising your hand isn’t the only thing that matters, but it’s a good start. In How To Ask Questions The Smart Way?. The author mentions that saying things such as “Thanks for your attention” or adding a simple “please” can make readers think you’re actually trying to learn rather than just be spoon-fed an answer. When reading other parts of the article there seemed to be a theme of how a curious new hacker can show the effort that can be put into a question.

As the kids say: “Come correct”.

  When I saw this first question I immediately thought to myself “Come correct and you best not miss.”. I’ve heard the colloquial phrase “come correct” before, but I wouldn’t be able to tell you where. The phrase alludes to the fact that during any interaction there is proper protocol and etiquette to be followed. If you disrespect someone then you might get a rude awakening or put to sleep, in the un-pacifistic sense. But this does raise the point that a “not so smart” question can be seen as a sign of disrespect. Actions such as dumping all of your code onto the screen, and asking a vague question can sound a lot like “solve this for me”. One such example is this question and the interactions within it

The question starts off with these two sentences:

How can I count the occurrences of the String type field/attribute that equals weapon in the stated ArrayList<Item>. I added three faulty formatted System.out.println();


  The asker then puts out a chunk of code which includes the Java objects and some print statements. Then under the code block there are some comments revealing an exchange from a responder and asker. In this exchange I’ll name the original asker, Newbie(N) and the responder, Patient Responder(PR).

Patient responder: You want to count the number of elements in gear whose type attribute is weapon. Is that correct?


Newbie: that is correct


PR: This question has been asked and answered more than once already on SO. See how to get frequency of Object's field in ArrayList and also [link shortened for this essay]. Did you try Googling for java attribute frequency list?


N: @PR with what keywords did you find a duplicate just asking for the future thank you and yes I did but I only found examples regarding int and string list


N: you are right, I often lack the correct keywords sadly I did not learn about streams yet but it is upcoming topic for my OCP exam I just started 3 months ago with Java and was only working with script languages before and if im not able to find the correct answer I often create a new one but now that this is locked I cant delete it and I already did an additional edit so if you can label it as duplicate, that would be most welcome


  The exchange ends here and PR never responds again. What made me lose more respect for the asker was a reply to an answer that was well thought out. The answer that was given used the same objects, variables, and syntax in the asker’s example. Instead of a “thank you” the asker replied with

"I was hoping for a oneliner, maybe lambda but I appreciate your input very much”.


So now that you have a picture of what the question was, let’s try to understand how this question could have been asked in a “smarter” manner.

  1. They could have put the output of what their result was when running the code.
  2. They could have been more specific on what they want THEIR code to do, rather than a vague question regarding the frequency of an item in an array.
  3. They could have mentioned what they did to try and solve the problem before posting the question
  4. The reply with a sob story about being new didn't do them any favors. No one cares. Not even other new people. It doesn't add anything to the question nor the answer.
  5. They could have asked for a “oneliner” answer in the original question. But considering how new they were to Java, it's probably better to understand where those lambdas come from.

Feel free to look at the full post here

Correct questions lead to correct answers.

  Now that we’ve seen a question that was incomplete, let’s look at a question that most would consider “correct”. In most situations, the best questions that are asked are in the simplest manner. Here’s a question that’s straight forward involving the use of Docker. This question is fairly detailed, so I won’t paste the entire thing. Docker has a feature that allows containers (instances of applications) to use Docker Compose. When using Docker Compose, you are required to have a YAML file that is used to build various containers, the network the containers will be on, and other attributes of your containers. This file is what I’ll be referring to as the Docker Compose file.

The first thing I notice about this question is the effort that was put into it. Here’s a list of all the proper steps taken to make this question very “answerable”.

  1. They mention where this specific set of files came from.
  2. They mentioned what kind of solutions that they have looked for.
    1. "I've cloned a docker setup which uses docker-compose. One remote developer confirms it works so my problem seems to be with my setup."

  3. They show the output that was produced, via the docker-compose up command and include the error code.
  4. They show the Docker Compose file that they are using.
  5. They show a tree output to show where files are in relation to the Docker Compose file.
  6. They list which operating system, which operating system version , Docker version, and Docker compose version.
  7. Although they point out that they're new to Docker, they ask for help in a manner that doesn't sound like they need their hand held.
    1. "Does anybody know what could possibly be wrong or how I can debug this?Any tips are appreciated!"

  8. They also put an edit to mention that there is no .dockerignore file, present an ls -la output in order to show permissions for all files, and the .gitignore in case there's anything left.
    1. It becomes clear that this edit was due to feedback from other responders, and that the asker was taking each of their comments and providing the results with each comment.

  Another impressive aspect of this interaction was the follow through until the answer. In the chosen answer for this question, the user remarks that their personal issue was that there was an additional space at the end of the Dockerfile string which led to a syntax error that Docker wasn’t able to correct. But they still thanked the author of the response, and made this particular answer the best answer as it provides details on how to format the Docker Compose file correctly(aka no random spaces).

Feel free to look at the full post here

Asking “smart” questions could save your job.

   With both of these questions, I tried to think of a time when I needed to ask “smart” questions. This reminded me of an experience I had over the summer. It involved me getting program components installed on an Amazon Workspace(using cloud based virtual desktop). I would like to thank them as this was the first summer session they used these desktop instances, and they had just shifted to 80% of their workforce to remote. This meant that they were under a massive workload, and they still managed to be a huge help. I also had to work with my supervisor who would be experiencing these virtual desktops for the first time as well. Essentially, I had a machine with very few permissions. This made simple tasks such as python library installations incredibly tedious. This lack of autonomy meant that setup time for new desktop instances ranged from a few days to just past a week. But with the help of stack overflow questions, bouncing around ideas with my supervisor, and the patience and quick response times of the IT department, I was finally able to get my virtual desktop set up for work. During this setup process I had incorporate “smart” concepts into my questions. I would include information such as what versions of software I needed, which permissions were required, and what methods have I found and/or tried along with the results of each tried method. This kind of back and forth required me to give as much relevant information as possible. This allowed all parties involved to make the appropriate decisions and eventually led to a working virtual desktop.