16
\$\begingroup\$

So, this question has been bothering me for a long time now. It is asking for a review of one line of "code" which is really a spreadsheet formula.

Actually, it's not even asking for a review in my opinion. It seems to be directly asking for an alternative, which makes me think that it's SO territory.

I've even considered answering it, but any answer I write for it would not be a review. It would be me writing an alternative solution and "giving OP the codez".

I have a few questions about all of this.

  1. Is this real code? I don't think it is, but it doesn't seem to fit the definition of unreal code.
  2. Is it possible to review a spreadsheet formula at all?
  3. If not, what should the close reason for this question be. None of the existing ones seem to fit correctly.
\$\endgroup\$
1

3 Answers 3

16
\$\begingroup\$

Actually, it's not even asking for a review in my opinion. It seems to be directly asking for an alternative, which makes me think that it's SO territory.

It is actually asking for "Is there any better way to do this?" which to my eyes is nowhere near "gimme-the-codez".

Let's take a look at our ultimate questions:

  • Does my question contain embedded code? Yes.
  • Did I write that code myself? Yes.
  • Is it actual code from a project rather than pseudo-code or example code? Yes.
  • Do I want the code to be good code? Yes.
  • To the best of my knowledge, does the code work? Yes.
  • Do I want feedback about any or all facets of the code? Yes.

I've even considered answering it, but any answer I write for it would not be a review. It would be me writing an alternative solution and "giving OP the codez".

A quite common answer around here is a recommendation to "throw away that code and start over and do it the xyz way". If the OP already has this in mind (which seems to be the case here), what does that matter?

I believe Stack Overflow users are already confused enough when it comes to recommending Code Review or not, I don't think migrating questions like this to Stack Overflow would benefit Code Review. Is it on-topic on Stack Overflow? Yes. Is it off-topic on Code Review? No.

There's nothing wrong with giving the OP the code when code is already shown that does the same thing.

Is this real code? I don't think it is, but it doesn't seem to fit the definition of unreal code.

As we can't find any reason for why it's not real code, I think it is real code.

Is it possible to review a spreadsheet formula at all?

Possible, yes. Easy? No.

If not, what should the close reason for this question be. None of the existing ones seem to fit correctly.

The only ones I can come up with is:

  • "This question appears to be off-topic because we don't know how to review it"
  • "This question appears to be off-topic because we can't find an answer"
  • "This question appears to be off-topic because it is too hard to answer"

I hope we all agree that none of these make a good off-topic reason.

Just because we're not sure on how to answer it doesn't mean it's off-topic.

Also remember that "Your code is fine" answers are perfectly fine, as long as they also explain why the code is fine.


Edit. Also, one important thing to consider is: Do we have enough context to review it?. Having the spreadsheet itself on hand instead of only the formula could make it a lot easier to review it. Whether or not the formula itself gives enough context or not is up to you.

\$\endgroup\$
4
  • 1
    \$\begingroup\$ If someone does find a fault with the code, should the answer explaining why it's fine be downvoted into the ground? \$\endgroup\$
    – Pimgd
    Jul 23, 2014 at 19:46
  • \$\begingroup\$ "This question appears to be off-topic because we're not nice anymore" seems to work here. \$\endgroup\$
    – Morwenn
    Jul 23, 2014 at 19:47
  • 1
    \$\begingroup\$ I agree with the answer, but I think that it should be emphasized that just because a close reason doesn't currently exist doesn't mean we shouldn't consider creating a new close reason. SO close reasons change--ours could too. \$\endgroup\$
    – nhgrif
    Jul 26, 2014 at 0:27
  • \$\begingroup\$ "Having the spreadsheet itself on hand instead" Does StackExchange have a preferred solution for sharing non-image files (we have Imgur for that after all)? Links can rot after all. \$\endgroup\$
    – Mast Mod
    Jun 16, 2019 at 11:58
6
\$\begingroup\$

So, this is where it ended up for me. I am going to accept Simon's answer because I think he is right in the general case. Yes, spreadsheet formulas are on topic here.

The particular case in question though is off topic because it does not provide sufficient background information to provide a meaningful review. It is "Unclear the OP is asking". More information has been requested and I am voting to close until OP updates the question.

\$\endgroup\$
3
\$\begingroup\$

No, we can't review spreadsheet formulas.

Earlier I would have said yes. Because when you look at your points, I'd answer them like this:

  1. It's code, that's for sure.
  2. Yes, but you just don't have a lot of material. It's akin to reviewing a single line of code (and often a review of a single line of code worth reviewing ends up splitting that line of code).
  3. Irrelevant as per 2.

However, with point 2, I say that if a single line of code merits reviewing, it's likely that that single line of code is either going to get grossly simplified, or it's gonna get split up. And that's the problem. You can't split a spreadsheet formula up into multiple lines to make it more readable. You can't define a temporary variable to make it more readable. You can't define a constant somewhere to make it more readable.

So when reviewing a spreadsheet formula, your answer is either going to be "rewrite it as a macro, like so, and then you can do X or Y"... or it's going to be "you used the wrong function, use X instead". Neither are what I'd see as a good review. There's nothing to learn except a mapping (use X instead of Y), or in the case of a rewrite as macro, you can learn how to convert a spreadsheet formula to a macro, and then review it.

For me, this all points into one direction:

Instead of asking for a review on a spreadsheet formula, ask for a review on your spreadsheet macro.


In the event that you'd see my deduction as arbitrary, let me present another example.

From https://stackoverflow.com/questions/18015866/grep-f-on-files-in-a-zipped-folder:

grep -r -i -z -I -f /path/to/pattern/file /home/folder/TestZipFolder.zip

"Is there anything I could alter about this to make it more readable?" (It's not asked in the original question, but readability is one of the major improvements that can be made to a piece of code).

Well?

For me, I'd have to say no. I don't know how to make it more readable. I guess you could reorder the flags if a different order made more sense (grouping output flags and search flags together, for instance). I guess you could replace a flag with its verbose version, if such a thing exists (I recall certain scripts taking -d and --delete as the same flag). But I can't give you a much more sensible review than that. And in the case that all my suggestions had already been applied, I'd just have to answer with no.

Let's take the macro version of such a console command:

A script file.

It contains multiple statements, and it's intended to do something. You can most certainly review a script file. Maybe there's something dangerous in the flags of one of the statements. Maybe it's not compatible with unicode for some reason. Maybe you're doing something by hand that already has a built-in function.

You can't review a command, but you can review a script.

You can't review a spreadsheet formula, but you can review a spreadsheet macro.

Thus, we'd need some custom close reason:

There is nothing in this question that can be reviewed. The presented code can't be altered without changing the result of the code. Any reviewing thus lands in bugfixing territory, which is off-topic.

\$\endgroup\$
3
  • \$\begingroup\$ In that case, 3 is not irrelevant and we still need a close reason. Do we then close it as "Not real code"? \$\endgroup\$
    – RubberDuck
    Jul 23, 2014 at 19:24
  • 2
    \$\begingroup\$ I disagree on a lot of things here, I will write another answer. \$\endgroup\$ Jul 23, 2014 at 19:24
  • \$\begingroup\$ Oh, really? \$\endgroup\$ Aug 31, 2014 at 13:48

You must log in to answer this question.

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