On a question asking for an approach to solving a programming problem such as this one the user is not asking it as a "gimme teh codez" (as far as I interpret it). So I don't interpret it as being too broad. Maybe that's their hope, but I've been able to effectively help people without writing specific implementations. They are asking for suggested implementation approach, which can be solved with a conceptual/pseudo code description.
For example an answer might be:
All clickable controls have an IClickable interface, thus you can use a feature detection approach such as:
IClickable clickable = newControl as IClickable; if(clickable != null) clickable.OnClick += generateWaveOnClick; // wire up to global handle
Your implementation of
generateWaveOnClick
will have a reference to the control being clicked, and need to access the graphics object of the control and manually paint the wave. The specifics of custom rendering are too vast to get into all the possible details, but there's plenty of questions and tutorials that deal with this.
Now I know little about WPF so this is a bit of a fantasy answer, but from my experience with Winforms I imagine there's a viable "feature detection" approach. Point being is that you don't have to write an entire implementation to answer such a question. While one might argue there is "not just one answer that solves the problem", it is rare that a question on SO has just one valid answer. Often there are many valid approaches and some fit certain scenarios better than others. It's kind of like trying to say there's only one way you can solve a math problem.
This person may simply not be aware of various "feature detection" techniques that take the approach of reflecting upon objects to see if they have certain properties/events available. It's a bit of a reverse search problem to say they did too little research, as they simply are unaware of what concept they should research.
A commenter states there is a code requirement. I have seen this cited before, but am wondering if this is an official requirement. I've certainly asked questions that don't involve code at all, but
Is there really such a requirement for an asker to show some code? Obviously if they have a very specific code related issue, this makes sense, but I don't see it as a universal requirement.
Take this fairly well received question I asked, that was an attempt to gain a better understanding of the mechanics of a language feature. I had read many articles but most only covered the basics and I didn't make the connection of how behaviors of things like serializers interact with attributes. The question dealt specifically with a programming topic, I tried to make it fairly focused so that an answer wouldn't need to be a huge tutorial on attributes, yet the question did not deal with a programming problem. I don't see how SO's criteria requires there to always be a problem statement nor a specific set of code. Certainly that helps frame a question better, but I think there are plenty of questions without code that are focused enough and are on-topic for programming QA such that they meet SO's criteria.
Now maybe the close voters didn't vote due to lack of code, but simply felt it was too broad, as they interpreted it as a "write the code for me" question.
- I tend to feel there's room to interpret the question as a "give me an approach".
- Answer as such, with a succinct "general approach" answer.
- Let the community reward good succinct answers.
- Leave the asker two choices:
- take the conceptual information in that answer and go off to write their own code,
- be a baby and complain that they wanted complete code.
- Answerer gets community upvotes, and maybe one downvote from asker.
- The answerer still comes out on top with a net positive.
- The answer is still a useful resource to others.
Sometimes, especially programmers delving into an unfamiliar technology area, are faced with many non-standard tutorials. There's alot of stuff I see on CodeProject that is absolutely not the way you'd see it done in a production environment. There's not the same level of critique on blogs/interwebs as there is on SO. My first instinct is to wonder, "What approach to this problem would someone more experienced take?"
I'd almost rather help get someone started off on the right foot, rather than them cludge together a really bad approach. Rather than them blindly cludge together a solution and piece meal ask for little hackish fixes here and there, rather than address the larger design problem.
What does the community think?
Note: I've certainly cast my own "too broad" votes on questions asking for things like "an implementation of a binary tree sort". Obviously they are aware the algorithm exists(which essentially covers the general "approach"), and so that doesn't leave much but to write the code implementing that algorithm. In such an obvious case I vote "too broad" and explain that it would be too vast of an answer to write a full/complete implementation of the algorithm.