15
\$\begingroup\$

"Questions containing broken code or asking for advice about code not yet written are off-topic, as the code is not ready for review. After the question has been edited to contain working code, we will consider reopening it."

We don't review broken code

Broken code is off-topic here

I'm confused, It's not broken. Just not perfect.

Welcome to Code Review! I think your code does work, I just want to clarify: does your code work, or is it broken?

It's not broken. It just doesn't produce the right answer.

The above is some comments that I have seen on Code Review involving the word "broken". Note that the first one is also our currently most used close reason.

There seems to be some confusion about what we mean by broken. For some of us, it's natural that it means code that does not work as intended, but it seems like other users of the site are having problems understanding this particular word.

This makes me wonder: Is our usage of the word 'broken' broken?

Is our wording broken? Should we take a break from this brokenness?

Should we avoid using the word "broken"? If so, what should we replace it with?

SEDE query showing the occurrences in comments of the word "broken"

\$\endgroup\$
4
  • 2
    \$\begingroup\$ I have not liked the word "broken" personally, if only for that it sounds a bit rude/condescending. Something like "nonfunctional" or "malfunctional" might sound better \$\endgroup\$
    – Phrancis
    Commented Apr 28, 2016 at 19:31
  • 1
    \$\begingroup\$ NB it's important to draw a distinction between buggy code and known-buggy code. Part of code review is to point out things which look like bugs (e.g. missed corner cases). \$\endgroup\$ Commented Apr 29, 2016 at 10:51
  • \$\begingroup\$ Your brokennes is broken: it should be brokenness :P \$\endgroup\$
    – cat
    Commented Apr 29, 2016 at 16:26
  • \$\begingroup\$ “It's not broken. It just doesn't produce the right answer.” \$\endgroup\$
    – 5gon12eder
    Commented Apr 29, 2016 at 21:58

3 Answers 3

7
\$\begingroup\$

Yes.

There seems to be some confusion about what we mean by broken. For some of us, it's natural that it means code that does not work as intended, but it seems like other users of the site are having problems understanding this particular word.

Broken means more than just "does not work as intended".
Take:

I have a spade, which I can use. Then one day it breaks, so now it's broken. I can still kinda use it as a spade, but it has more use as a trowel.

Compared to:

I tried to make a spade. But it's too small, so it has more use as a trowel.

Both the above come on here and ask how can they can improve their 'trowel'. Both get shot down for being a broken spade.

You should be able to understand that the person trying, but failing, to make a spade would be confused. It never was a spade, and so it's definitely not a broken spade.

Both however don't work as spades, and so if we said they don't work as intended it'd make sense. The broken one is clearly broken, and the small spade is too small.

I think we should use 'code not working as intended' / 'code does not work as intended' instead of 'broken code'.

\$\endgroup\$
2
  • \$\begingroup\$ I tend to agree with this, but could you give some examples of how we might change wording on the site? E.g. the current "broken" code reason. I agree that if we could get people to key on the word faulty, it would be better. But how will we do that? \$\endgroup\$
    – mdfst13
    Commented Apr 30, 2016 at 4:20
  • \$\begingroup\$ @mdfst13 (I added some examples, since we are using a synonym, it should be changeable.) I think if we changed the places we currently use broken, help pages and the close reason, it'd just come naturally, it would be strange using broken when the close reason uses faulty. \$\endgroup\$
    – Peilonrayz Mod
    Commented Apr 30, 2016 at 15:14
6
\$\begingroup\$

It's not broken. It just doesn't produce the right answer.

That is broken. Code which compiles or code which is accepted by an interpreter is not necessarily doing what it should be doing. If "broken" isn't the correct term, what is?

However, for clarification, we could add the question:

Is your code working as intended?

Which is unambiguous. Keep in mind it's already phrased like that in the help center.

\$\endgroup\$
5
  • \$\begingroup\$ To you that might be broken, but to others it apparently isn't. \$\endgroup\$
    – Simon Forsberg Mod
    Commented Apr 28, 2016 at 19:29
  • \$\begingroup\$ @SimonForsberg 2nd definition on Webster agrees with me. \$\endgroup\$
    – Mast Mod
    Commented Apr 28, 2016 at 19:31
  • 1
    \$\begingroup\$ Should we reduce everything that we mean by saying "broken" into a single word? How many times have you had to explain what we mean by "broken" to one of the users on the site? \$\endgroup\$
    – Simon Forsberg Mod
    Commented Apr 28, 2016 at 19:33
  • 2
    \$\begingroup\$ @SimonForsberg Can we reduce everything we mean by saying "broken" into a single word? Can we afford not to? \$\endgroup\$
    – Vogel612
    Commented Apr 28, 2016 at 19:57
  • 5
    \$\begingroup\$ @SimonForsberg They could follow the links, which explain what we mean by "broken". But that seems too much trouble for some who continue to ask questions in the comments which are answered at those links. In the end, people are going to want to read what they want to read. The fact that they posted broken code already shows that they didn't bother to read the most important help pages. \$\endgroup\$
    – BCdotWEB
    Commented Apr 29, 2016 at 7:06
1
\$\begingroup\$

If you're specifically asking about the wording of the close reason, then no, I don't think it is broken. The reason reads like this.

Questions containing broken code or asking for advice about code not yet written are off-topic, as the code is not ready for review. After the question has been edited to contain working code, we will consider reopening it.

Clicking on the link for “broken code” directly takes you to this meta post that states prominently:

Does your question contain something like:

  • … runs … but it gives the wrong answer …
  • … I tried … but sometimes …
  • … works great when I do …, but when I do …
  • … it works fine, but I also need it to do …

If it does, then your code does not work in the way that you expect, or need.

Broken code is code that:

  • cannot possibly compile even if other dependencies are included
  • fails to run (crashes, throws exceptions, core-dumps, segfaults, etc.)
  • produces results that are obviously incorrect

I don't see how this could not be clear enough about the fact that code that “is not broken but just doesn't produce the correct answer” is off-topic here. It seems that some people might take “broken” as “does not compile” but they should click the link and find out about their mistake. It is not common to call code that produces incorrect results anything but broken and I don't think we should bend the terminology used here for those few wo are confused about this.

That said, we should be careful when posting comments without the link or only paraphrasing in a way that might be less clear. It also seems that the wording on the What topics can I ask about here? page could be improved. All it currently has to say is

If you are looking for feedback on a specific working piece of code from your project in the following areas…

That might indeed be too vague but might also be beyond the scope of this meta question.

Another problem is that in order to realize that your code is broken, you actually have to do some work. Some people just post what they think is working code when it has severe bugs. Spotting logic errors is also part of code review so that's not a problem per se but it would be undesirable if we would steer people into remaining silent about the known issues of their code just to prevent their question from being closed.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ I agree with this answer, the close reason itself isn't broken (pun intended), but when leaving comments, we should phrase it as "doesn't work as intended". For example: "This appears to produce incorrect results. Are you sure it works as you intended? Code that doesn't is considered to be broken and is off topic here." \$\endgroup\$
    – RubberDuck
    Commented Apr 30, 2016 at 11:53

You must log in to answer this question.

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