Please give reasoning in relation to our rules so that it's easier to agree or disagree.
A couple of the questions in the post are off-topic. But that doesn't make the post off-topic. I would recommend you don't answer these, unless you're ok with the potential problems these questions may pose.
The code whilst it may look like 'example code', it doesn't have any of the problems highlighted in our meta posts or close reasons. And so I find no reason to close the question on the code alone.
Is any of the text off-topic?
- How do I display answers in the UI to include 'Unanswered' and 'Incorrect Answer'? (I realise the UI is not the concern of the Domain, but having the ability to choose these as answers is)
- Q. How do I display answers in the UI to include 'Unanswered' and 'Incorrect Answer'?
- A. I can now do this by adding an 'Unanswered' and 'Incorrect Answer' DataProtectionAnswer to the DataProtectionQuestion, but this 'feels' wrong. Isn't this the responsibility of the Presenter?
These bullet points are all related, making it harder to comment on them.
If you take the first and second quoted point by themselves then it's an off-topic question. This is as the code has not been written yet.
However this shouldn't make the post off-topic. This is as it is a small aspect of the overall question. Since the OP has posted lots of different questions that can be answered it's harsh and unfair to close a question because it's not 100% perfect.
This goes hand in hand with existing meta posts saying it's ok to ignore some of the requests the OP makes.
The third quoted point is talking about code that isn't there, but not in the same way as the first two points. To me this is more inline with our 'not real code' reason, and more specifically the problems arising from example and hypothetical code.
The code they've presented has gaps in functionality and so we may answer the question in a way that ignores this additional functionality, leading to the asker getting vexed and argumentative. Ultimately leaving both the asker and answerer dissatisfied due to this problem.
Again the solution to just ignore these points and comment on the code and questions that are concreate. And since there are concreate things we can comment on this question shouldn't be off-topic for this reason.
Taking the entire question into consideration, these questions are off-topic. But not for the hypothetical problems, this is as the question has accurately described the situation and has provided the entire context. Even if the code doesn't contain it all. But it doesn't make the entire post off-topic.
And so if I were to answer it I wouldn't touch on these issues to protect myself from the potential wrath of the user. And would suggest others to do the same. Some people would recommend not answering these questions as they allow others to point to the question an answer as an example to post their own off-topic questions.
Is the code off-topic?
- Authorship of code
It is not off-topic because of this, as the code is in the post, they are the owner and they know why it was written the way it was.
Lacks concrete context
Going from the close text they have provided concrete code, two different versions in fact. And there is sufficient context in the question to know how the code is working and how to improve it.
Firstly given their first code block alone it made me go "WTF why'd you do x" and so I have enough context to improve it in one way.
Given that they've fully described the problem statement I can also solve the problem without their code and compare the two. This context sometimes comes from the text and the code. For example this questions maths was poorly defined, but their code worked fine. Meaning they had all the context they need in their question as a whole.
This leaves the argument for whether it's pseudocode, stub or example code. Given that the code is fully working C# it's not pseudocode. Given that we have enough context it's not stub code either. Leaving example code.
It could be example code given the missing functionality. But then again, it could also be actual code in the process of TDD. Since they are "rewrite the software", it's looks to me like a flimsy excuse based in assumptions.
We also allow example code if it looks like actual code, and this looks like actual code. It also doesn't have any of the problems highlighted in the meta posts I provided earlier.
Code not implemented or not working as intended
You could argue that due to missing some functionality that it falls under this reason. But this mostly revolves around the issues in the text.
And so no I don't think their code alone is off-topic. Yes we 'don't allow example code', but this seems to be archaic wording we use like 'broken code'. It's the meaning around these words that are important.