Sometimes I have a question as to whether I am doing something correctly. So I have a question, and I think I have an answer, so I'm more or less just looking for confirmation.

An example might be:

I have these tables, and I want to perform Boyce-Codd normalization, did I do it correctly? I think so, but I'm not sure.

What is the best way to address this situation?

  • 3
    Just avoid making your question "Too Broad" or "Primarily Option Based". – gunr2171 Mar 17 '14 at 19:55
  • I do not see any problem about asking "Is this the right way to do this" type of questions. Just be sure that you are clear enough and your question do not lead to opinion based answers. – FallenAngel Mar 18 '14 at 14:50
  • possible duplicate of Is it generally frowned upon to answer your own question immediately? – gnat Mar 18 '14 at 14:56
  • @gnat That question is more about when you have a more definitive answer, here I'm not sure that I do. I think that's an important distinction. – Sled Mar 18 '14 at 14:58
  • @ArtB agree, this is not a duplicate – gnat Mar 18 '14 at 15:00
  • Possible duplication question 1 question 2 quesiton 3 – Bolu Mar 18 '14 at 15:02
  • 1
    @Bolu I would say it's a duplicate of 1, but not 2 or 3. – Sled Mar 18 '14 at 15:04
  • @ArtB, yeah, but 1 was marked as duplicate to 2 and 3... so I suppose if this is a duplicate of 1 it must be a duplicate of 2 and 3 :) – Bolu Mar 18 '14 at 15:10
  • That's presuming duplication is transitive! :P But, 1 being a duplicate of 2 seems wrong to me. I really have on SE in general where as question is marked as a duplicate of another question just because they have the same answer. Especially when, not knowing the answers, you'd never think of one as being the duplicate. #3 isn't even about ettiquette, it;s about a site feature for pete's sake! – Sled Mar 18 '14 at 15:17
  • @Bolu in current model, duplication is not transitive – gnat Mar 18 '14 at 16:59
  • @gnat, in this particular case, I would rather say the judgement of duplication for my example question was wrong... – Bolu Mar 18 '14 at 17:05

If you've implemented some algorithm and have working code and are seeking commentary, review or feedback, then the best site to do this is https://codereview.stackexchange.com/.

Stack Overflow is more about specific coding problems.

  • Yes, but I was thinking more along the lines of more conceptual questions. Like how a man-in-the-middle or replay attack works. Or when you are trying to distinguish the meaning of similar terms like "prime vs relatively prime" (not programming, but best I could do immediately). These don't have code, but would still be about programming and not broad or subjective. – Sled Mar 17 '14 at 20:02
  • @ArtB: I know your question is not really about picking off candidate sites for each case you cite but, your prime vs. relatively prime could be asked on the math stack exchange site. – Bathsheba Mar 17 '14 at 20:04
  • 1) it was an example of a non-code conceptual question 2) it comes up as part of RSA which I believe would make it fairgame for SO 3) a better example for SO would be a question about the difference between making a copy of an object and a deep copy, there you are not asking about code but about the idea and you are likely to have a partial intuition at least. – Sled Mar 17 '14 at 20:07

My strategy in these cases so far has been to post the question, and then post my best guess as an answer. That way if it was correct it'll get voted up, if not another answer will get voted up, and my question does not get cluttered up with my wrong attempt.

  • 1
    It's a shame you're doing that as it doesn't help SO build up a comprehensive knowledge base: the answer you give is, by your own admission, too narrow. – Bathsheba Mar 17 '14 at 20:11
  • 1
    I disagree. It jump starts the knowledge base by at least giving a potentially correct answer right away. If it's correct it makes it easier for others since they only need to upvote not type, so easier. Otherwise, this is the "show your work" stuff that often gets included in the question. – Sled Mar 17 '14 at 20:14

I once posted such a question a few months back. In my case, the question was quite specific in terms of describing what I was attempting to do, and in the end I ultimately asked whether my solution (which I posted in the question itself) was "correct", meaning whether it is potentially inefficient, or against a particular best practice (aka "just plain dumb" as I put it).

As Gunr2171 said in the comments, ultimately so long as you avoid questions that are extraordinarily general or broad, you should be ok.

In the case like the one you described in your question, I believe that might qualify as "too broad", since you're not asking a specific question, but rather for users to review your code and comment whether the implementation is correct. You could, hypothetically, rectify that by pointing out a concern you have with your current implementation, and base your question around that (or something along those lines).

I also agree with Bathsheba that the code review SE might also be a good place to post your question. I admit I don't have much experience (other than lurking) on that particular SE site, however from what I can tell, I believe you'd still be required to phrase your question in a specific-enough manner, such as (for example) pointing out a performance concern in your implementation, or something to that effect.

I would disagree with the strategy you mentioned in your answer, however. There is a difference between a "potentially correct answer", and an "actually correct answer", and I would submit that the latter is what belongs in an answer. The former, as the OP, would be perfect as the "here's what I've tried" portion of your question. Admittedly, it is absolutely possible for a user to post a partial answer, but it would really only be acceptable to do so as long as the portion of the question that the partial answer addresses is correct. A solution (even a partial one), that ultimately was wrong would be voted down. In practical terms, you might open yourself up to downvotes on your potential solution (even though its in answer to your own question) if other's see that it is incorrect (assuming it is).


The term that you're using:

did I do it correctly

Would make the question opinion-based. That's why you cannot ask for reviews about a code on Stack Overflow, even if you do, you'll get the question closed as off-topic and sometimes downvotes too.

The best way is to ask the question where it fits. The site that was shared to you: https://codereview.stackexchange.com/ is a good and perfect fit for such situations.

You can ask for the review, that would answer your question, and at the same time they'd update the code to make it shorter and faster (sometimes) too.

  • "did I do it correctly" is not necessarily opinion-based because there are things that are unambiguously wrong. – Sled Mar 18 '14 at 15:36
  • No, for me your code would be accurate, for some other guy it might need a fix, for someone it might be better to shorten it etc! – Afzaal Ahmad Zeeshan Mar 18 '14 at 15:38
  • There are examples like that, but there are still unambiguously wrong cases too. Like extending the wrong class etc. But this question was meant for more conceptual answers. Like did I break down this object properly into this design pattern. Whether or not you followed a design pattern (ignoring code style issues) is not option based. – Sled Mar 18 '14 at 15:50

You must log in to answer this question.

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