# Should this question be closed for “not asking for good code”?

Telling the user the number of days it's been since January 1st

So far, this question has:

• 3 have decided to Close (from the queue)
• 3 have decided to Leave Open (from the queue)

One user has indicated that this question is off-topic because it looks like it violates rule #4 of allowed topics. The OP has stated that he can only use if-statements. No specific reasons for that are given, but I assume it's school related. Either way, there's some dispute here, and we need to resolve otherwise that post will become locked until a decision is made on Meta.

So, should this question be closed, or not? We can all decide on that, or the last person (possibly me) could put in the last vote. Again, we need to decide because such disputes can end in a lock.

• As the question stands now, I don't see anything about if statements at all. But (without actually looking at the code) it also looks like “asking code to be written” question to me. – svick Nov 16 '13 at 21:15
• @svick: Well, you do need to look at the code to see all the ifs (and there are a lot). The OP has also used the word "redo," which could imply refactoring. Anyhow, I've already flagged a moderator, just in case the community cannot decide on something. – Jamal Nov 16 '13 at 21:19
• The way I see it, it's like asking for a review of, say, a calculator's code that can only use the + operator. Hence, I find it's against the spirit of rule #4. – Mathieu Guindon Nov 16 '13 at 21:55
• @retailcoder: Yes, but does that really make it bad code? Yes, the calculator will be bad, but the code can still look like a million bucks (or rep points). Remember, this is closely related to the code's format. If it's not meant to be the shortest or most confusing code, then it doesn't quite fit that rule. – Jamal Nov 16 '13 at 21:58
• As I said I'm not taking the rule literally - I know this isn't code-golf, but there are much cleaner ways to solve what the OP is trying to solve if you lift the "only ifs" game. I see the spirit of that rule as the question is on-topic if the code has constraints that can prevent a review from suggesting better approaches - in this case the "only ifs" rule is one such constraint. – Mathieu Guindon Nov 16 '13 at 22:10
• Wow what a lapsus.. I meant the question is off-topic if... now given the last couple answers on that specific question, I'm willing to retract my close vote on that one, so we can reach consensus. But this is still a good discussion about the said rule #4 :) – Mathieu Guindon Nov 16 '13 at 22:18

can we put a restriction on our code saying that we want to use a while loop and not a do while, isn't this kind of the same thing?