12
\$\begingroup\$

I've been stumbling on this question and decided to post my very first answer on code review.

I started out with some obvious improvements that could be made straight away for the code posted in the OP.
Later I added some additional advice, how the code could be made more generic.

At this time I'm asking, there are two more answers that have gone straight away, to either provide

I have upvoted both of these, because I think they certainly provide value on the topic asked, but I'm just not so sure what's considered valuable at this site.

As I'm new here (kinda), how far should we get with such abstractions and deviate from the original code?

\$\endgroup\$
5
  • \$\begingroup\$ Especially that seems in question, since OP posted a (non-)answer, providing some improved code just now, referring to my straightforward improvements. \$\endgroup\$ Dec 2, 2015 at 21:11
  • 1
    \$\begingroup\$ I can't tag you in a comment because of your username that I... can't type. lol. But I just wanted to point out, to add to existing answers, that an answer that doesn't propose a full rewrite of the code isn't necessarily less good. All reviews are born equal. :p \$\endgroup\$
    – IEatBagels
    Dec 3, 2015 at 19:11
  • \$\begingroup\$ @TopinFrassi You can't tag me, since I was writing the question, and will be notified automatically ;-). Thanks for your input though. \$\endgroup\$ Dec 3, 2015 at 21:39
  • \$\begingroup\$ That is also true :p But even if I could have tagged you, I wouldn't be able to ahah \$\endgroup\$
    – IEatBagels
    Dec 3, 2015 at 23:20
  • \$\begingroup\$ @TopinFrassi Read on my profile bio, it's intentional :-). These are Greek letters, and many people around in SE sites use much weirder unicode letters in their nicks. Usually it's easy if you just type @ in a comment, a list with the selectable nicks appears, but I suppose you already know that. \$\endgroup\$ Dec 3, 2015 at 23:24

2 Answers 2

20
\$\begingroup\$

As far as you're willing to go.

Really. I've seen reviews turn into complete rewrites - and I'm not talking about code dump answers here, but reviews that walk the OP from what they have to a fully OOP/SOLID implementation, and/or using a completely different algorithm all while explaining the benefits of a different approach.

Shortly put, anything that steers OP's code toward being better is valuable input on this site.

\$\endgroup\$
1
  • 2
    \$\begingroup\$ Thanks that exactly answers my concern, and receiving such answer from a mod I'll just trust it. As mentioned I just was unsure, because being new at code reviews. \$\endgroup\$ Dec 2, 2015 at 21:27
10
\$\begingroup\$

There is wide latitude in Code Review answers — anything from "Your code looks fine as it is, because …", to "You are thinking about the problem the wrong way", to "You forgot to consider this", to "I suggest these changes", to "You should start over from scratch, because …".

What is not acceptable, though, is a code dump: a completely independent solution, not based on the original code, with no explanation of how it is a better solution than the original code.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ "What is not acceptable, though, is a code dump" Yeah, that's referring to the meanwhile deleted answer I can't see anymore due to my low rep (low rep is a really annoying thing, if you're used to have more :-P). \$\endgroup\$ Dec 2, 2015 at 21:32
  • 5
    \$\begingroup\$ @πάνταῥεῖ stick around and you won't be "low rep" for long ;-) \$\endgroup\$ Dec 2, 2015 at 21:41

You must log in to answer this question.

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