I believe it is a valid code review .... sometimes perhaps even the best code review is: Why are you doing all this hard work, just use that ...
In specific cases where the user is intentionally doing the work, they should tag their question with reinventing-the-wheel.
On code review, I would typically ask in a comment something like: "Did you know there's ...
Ideal situation - asker
Code Review is where you go to get feedback on your code that teaches you at least one new way to do things (better).
Premise: you bring your code - and you have it in a state where it represents the best you can do.
Expectation: someone helps you see things differently, that you would not otherwise have seen.
Ideal situation - ...
What is a code review?
Well, let's take a look at that Wikipedia article you linked to.
Code review is systematic examination (often known as peer review) of computer source code. It is intended to find and fix mistakes overlooked in the initial development phase, improving both the overall quality of software and the developers' skills. Reviews are done ...
The problem starts with the question, which is barely on topic and would be a better fit on Stack Overflow.
That said, a comparison between your original answer and Reinderien's seems to illustrate the difference between an alternative solution and an alternative solution with an insightful observation: you said
The best solution is ...
whereas he said
That all depends.... what does a real-life code review look like?
I have been through many of them, and they are all different.
Trying to relate this site to a dynamic, fluid, poorly standardized process, is not a realistic endeavour, and the results of such an analysis would do little to impact the 'gap' of a newcomer's expectations. To be fair, no ...
A few things that come to my mind and which could differ from a "real-life" code review:
Your review remains: here, code review isn't an oral process, it's a written one, and it is made to remain. We try to write interesting answers, but also to structure them, to include some nice mathematical syntax when needed, some images from time to time... The review ...
Basically it's an assessment of code. Good assessments that make statements support their statements with arguments and explanations. Bad assessments just make statements and don't support them in any form.
One might say that their assessment is not a Code Review if it doesn't cover all of the code, and only a small section... or if it only makes a single ...
The difference between Code Review and real life reviews is that the latter are a regular activity involving the same participants, and so over time a shared expertise can be developed and written down.
After some problem has come up a few times in review, it gets added to the local coding standard or pre-review checklist, and people learn to spot the ...
Approaching this from another perspective, this also depends on the code review format of choice in real-life (cough):
Side-by-side in front of the computer, i.e. an extra pair of eyes
Erasable (assumption: erasable board)
Synchronous group review (likely, hence the bigger canvas)
Free-form drawing (either to de-...
How I understand a code review on Code Review
It is a code review, if it
shows racing conditions, edge cases and will spot not noticed bugs
explains why something should be done in another way
explains why something shouldn't be done at all
shows logical errors
provides an alternative solution with an explanation why the alternative solution is ...
What a code review is not:
Your code seems fine.
That on itself should be an invalid review. Although there are exceptions (a follow-up on a follow-up will reach near-perfection), on most questions this is an unwanted answer which isn't bringing anything new to the Q&A.
It's fine if it's formulated as this:
Your code seems fine, but you might ...