Friday, June 5, 2015

Snob overflow . . .

Okay, another one of my many pet peeves. When people ask questions to Stack Overflow, the community often incorrectly assumes that you are too stupid to ask a real question and instead talks down to you and won't give a straight answer, even if there is one.

Here is a case-in-point: how-to-release-all-permits-for-a-java-semaphore

The question was immediately met with contempt: "What do you need this piece of code for?". This question was not asked for clarification, but so that the discussion could go in a completely different direction. The Stack Overflow moderators are such Nazis about intervening: "This is not a question!", "This is a survey!", "These are opinions!", "This is a duplicate!" - that I am surprised they don't get upset in this situation, because you have a clear question posed, and the selected answer goes in a completely different direction. Rather than answering the question "How to release all permits for a Java Semaphore", they answered the question "How do I better design my code to keep my thread pool in sync?"

The simple answer is:

semaphore.drainPermits();
semaphore.release(totalNumPermits);

Again, whether that discussion is valuable or not, it does not answer the very straightforward question that was asked.

No comments:

Post a Comment