10
\$\begingroup\$

This question was closed as non-working code, in spite of the following, from the OP:

THe [sic] problem is that this implementation makes the CPU of the machine where the service app is running go to 100% and freeze the complete system untill [sic] the service is killed.

Closing the question seemed to be the right call, and it was closed by community members with closing privilege, without moderator intervention.

A user made the following comment:

@Mat'sMug, the code is working, but it's just slow with a CPU overhead. So it's time to make a review... I would say it depends on your point of view. For me this is a valid question.

Was closing that question the right thing to do?

\$\endgroup\$
7
\$\begingroup\$

Code that completely freezes the system until the service is killed is not what I consider "working code".

Perhaps the issue is that the system only is locked for a period of time (i.e. there's actual work being done that takes time and eventually finishes), perhaps it is caused by a real flaw in the coding and the code never finish.

Either way, the question seems to be about modifying the behavior of the code. i.e: The code should not freeze the system.

If the question was about How can this code be written to make it run faster? It'd be a different story (most likely that would be on-topic). But the question How can this code be written so that it doesn't freeze my system? is not what I consider to be on-topic for Code Review.

\$\endgroup\$
4
\$\begingroup\$

Closing the question was proper.

[The] problem is that this implementation […] freeze the complete system untill the service is killed.

I am posting to ask an expert to find a major problem in this implementation

A major problem has already been found. Therefore, this is non-working code and thus off topic. But, one could argue, this program freezing the system doesn't mean it wouldn't work? I disagree. Code is not only subject to functional requirements (e.g. a calculator app must be able to perform addition and multiplication), but also various explicit and implied non-functional requirements (e.g. the result of the calculation must be displayed in under 100ms). Code that doesn't meet all of its requirements is broken.

Furthermore, the question is a request for debugging and searching for other problems. This is not what we do – we review code for style, design, and performance. A question may ask to focus on a specific area, but in general any and all aspects of the code are valid topics for answers.

The question could still be made on topic:

  • I have recently refactored this code I maintain. How could it be improved further?

  • I tried to optimize this code which I maintain. Is there anything else I can do to speed it up?

\$\endgroup\$

You must log in to answer this question.

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