1

I recently posted this question to get the opinions of other programmers. To me there really isn't a definite answer so wouldn't that make it an appropriate question for this site?

3
  • Expecting casual S[OFUE] users to actually read questions where more than 50% of the text is code is... a bit naive.
    – Shog9
    Sep 28, 2010 at 16:51
  • @Mr. C - It was closed by non-casual users. Sep 28, 2010 at 17:04
  • by "casual" I meant "people who don't care about answering it". I say this because there's no reason your question couldn't have been edited into a P.SE-appropriate form, provided someone actually cared enough to do so... This isn't meant as a knock against P.SE's ultra-zealous closers mind you - your question badly needs some clarity, and without it you're dependent on the goodwill/boredom of strangers.
    – Shog9
    Sep 28, 2010 at 17:08

1 Answer 1

7

You're kinda straddling the line between SO-appropriate and P.SE appropriate...

How to ask for a code review

There's nothing wrong with asking SO for feedback on some code, provided you've put some effort into it.

Bad

Is there anything wrong with this code?

???

<massive code dump>

Good

Are there problems with passing a callback to a constructor to allow for lazy initialization?

Description of technique used in code

Brief code snippet(s) illustrating only relevant techniques

You've managed to get about half-way on this: you're asking for feedback on the practicality of a specific technique, but rather than describing the technique and your motivations for using it, you've just dumped the code with a few hints as to what it does. Your question starts out sounding like it might be P.SE-appropriate ("what would you think upon seeing this signature?") but then delves into meatier implementation details (more of a SO thing).

Also, your title is unacceptably vague.

Decide what you want the answers to look like.

If you're questioning the readability/maintainability of the code (whether the implementation, or the client code) then ask about that - P.SE is a reasonable location.

If you're concerned that the implementation itself fails in some way (error handling, efficiency, unforeseen pitfalls involving the callback referencing disposed data) then be clear about why and how you're using it, and ask on SO. Note that you'll probably get comments on readability/maintainability as well, 'cause SO users are helpful like that.

3
  • 1
    I really don't want a definite answer in this case. I want to hear the opinions of others so I can relate them to what I already understand. So based off your answer if I were to change the title around "What are your experiences using lazy initialization via callback?" and add a bit more meat to the body of the question then theoretically it would be reopened? Sep 28, 2010 at 17:16
  • @Chaos: maybe. I'd vote to re-open just for the hell of it, but frankly I think you're throwing away an opportunity for some targeted feedback in exchange for idle chatter.
    – Shog9
    Sep 28, 2010 at 17:23
  • C - OK, I am going to have to think about this. I appreciate you taking the time to answer this. Sep 28, 2010 at 17:29

You must log in to answer this question.

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