22

I was reading the about page and there is a section that says "Get Answers to practical, detailed questions". It says

Ask about...

Specific programming problems

Software algorithms

Coding techniques

Software development tools

It later says:

Don't ask about...

Questions you haven't tried to find an answer for (show your work!)

Product or service recommendations or comparisons

Requests for lists of things, polls, opinions, discussions, etc.

Anything not directly related to writing computer programs

I was curious where asking about design patterns to tackle certain problems would fall. What design pattern to use in a particular situation is somewhat opinionated. Some people would see the value in using a particular design pattern, whereas others may find that it proves to be an anti-pattern or simply not worth implementing in the given scenario.

It can be a very practical question, but where exactly does it belong, and where do I draw the line between what belongs on Stack Overflow and what doesn't?

Should I post the question and let the moderators just use their discretion?

I checked and I found this question Questions about coding technique but there is no answer and I'm really curious about this as I think that for me perhaps most of the questions I want to ask go beyond solving the problem, they are aimed at solving a question well.

7
  • 3
    If you're not asking about a new-ish technology or framework then you probably shouldn't post anything related to "Coding techniques", even though it says so in the About page. They're subjective to most users here. A question about javascript or PHP techniques will get downvoted to hell, but a question about AngularJS will be praised and upvoted a thousand times over.
    – Matt K
    Commented May 29, 2014 at 20:46
  • 4
    The difference between a pattern and an anti-pattern is often what problem it's being applied to.
    – Ben Voigt
    Commented May 29, 2014 at 21:10
  • From what I've read recently here on meta, you will have to be very careful with your choice of words. If it looks possibly "broad" or "opinion" related, that's it, it will be closed very quickly. So just pin it down to specifics, and add example code. Commented May 30, 2014 at 6:30
  • If you ask such question (about best practice/pattern) it will be downvoted and closed. My experience. Commented May 30, 2014 at 6:36
  • 5
    Don't ask general questions about patterns and practices—they are far too broad. Ask specific questions about which would be the right choice in a particular set of circumstances. Be detailed and specific. Such questions might be "subjective" in the strictest sense, but they are also answerable by experienced programmers—exactly the type of question we're looking for.
    – Cody Gray Mod
    Commented May 30, 2014 at 7:36
  • I often find that people cannot separate objective points from opinion for pattern questions (although there often are objective statements to be made!). This impacts answer quality in a negative way. It also leads to heated discussion.
    – usr
    Commented May 31, 2014 at 22:42
  • @Ben your comment is an anti-pattern that doesn't apply here ;) Commented Jul 17, 2016 at 16:16

2 Answers 2

43

Questions about design patterns are within the purview of Programmers.SE, which handles programming questions that aren't directly about a coding problem. Sometimes we talk about "whiteboard" vs. "keyboard" questions when distinguishing between Programmers and Stack Overflow.

The "what's on topic?" FAQ for Programmers says:

  • software requirements
  • software architecture and design
  • algorithm and data structure concepts

More detail can be found in Choosing between Stack Overflow and Software Engineering on Meta.SE.

As for your question

Should I post the question and let the moderators just use their discretion?

The answer is "only if you are sure that the question is on-topic (and good)". It's your responsibility to find the correct place for your posts, not the moderators'.

6

By Stack Overflow's own rules, many questions that relate to design patterns are appropriate on Stack Overflow. A design pattern provides a recipe for solving a design problem in a specific way. It includes specific prescriptions on how to write parts of your code. There is no more sensible way to talk about many coding situations, ones where you're looking at actual code, than saying e.g. "you shouldn't do that with a Singleton" or "your solution is almost an Abstract Factory, but the caller has to know about each Factory subclass".

So questions that just talk about design patterns without reference to any particular coding problem (which one is better, or some such) are out, but questions like "Is this a correct implementation of Composite?" should be fine. Possibly you can tell whether a question is in or out by whether it contains code (good) or just words or UML (bad).

Regarding "opinionated", design patterns themselves are well-documented things which are not themselves subject to opinion, so merely mentioning a design pattern, or even phrasing your question in terms of design patterns, should not be grounds for closing a question as being opinionated. Neither would asking which of two design patterns was the correct one to satisfy a given set of design requirements be opinionated; if one pattern decouples class A from class B and the other does not, that's not opinion. (Although such a question would have to show a lot of code to belong on SO.) Just asking "is Composite better than State", that's opinion (and silly).

1
  • 3
    "Did I do this correctly?" might be better suited for CodeReview.
    – cimmanon
    Commented May 29, 2014 at 21:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .