Hot answers tagged

27

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 ...


20

Is it on-topic to review a challenge's requirements? To the extent that the requirements force bad code, Yes. The core of every question at Code Review is "How can I make this code better?" It is not "How can I solve this challenge?" If the asker has not gotten at least that far already, their question is off-topic here. Therefore every question at Code ...


14

I personally have a bit of a history with writing reviews for languages I don't know squat about. Some of these reviews got comments like yours, where people pointed out syntax errors to me (and referred me to styling guidelines). Sometimes I even get a comment that makes parts of my review outright wrong or obsolete (e.g. here). That is not the end of the ...


13

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 ...


12

Our How do I write a good answer? guidelines state that Every answer must make at least one insightful observation about the code in the question. but also that We don't expect every answer to be perfect, but answers with correct spelling, punctuation, and grammar are easier to read and tend to get upvoted more frequently. Remember, you can always go ...


12

The "on-topicness" for answers is not nearly as clear-cut as for questions (and even that has plenty of grey areas). The very first sentence, on its own, is enough to make it a valid code review: "First the good: your code provides a testable function." Abusive answers, or answers which do nothing more than provide links, or an alternative solution without ...


11

If we take a look at https://codereview.stackexchange.com/help/on-topic we see To the best of my knowledge, does the code work as intended? if the OP answered this for him/her-self with yes, then the question should be on-topic (if the other questions on the on-topic section could be answered with yes as well). That being said, it looks like the downvote ...


9

This is kind-of working as intended. What you observe, is the code being taken as a point in the bulleted list. If you want this, add another 4 spaces of indentation and the code will be formatted correctly. Point Point 2 import code code.do() If you don't want this, break the bulleted list by inserting something else in between. Even an invisible HTML ...


9

Unfortunately, your question is based on a faulty premise. The code to be reviewed consists of a makeBst() function with one test case. That test case produces incorrect output: class BinaryTreeNode { constructor(value) { this.value = value; this.left = null; this.right = null; } } function makeBst(arr){ if(!arr || arr.length <= ...


7

The post didn't in itself strike me as a commentary on first read, and seemed to somewhat relate to the OP - it even had a positive score! "the answer" confused me I guess; the flag would likely have been handled differently if it had said "this is a comment that belongs under https://codereview.stackexchange.com/a/187501"... the positive score still would ...


6

which gives no code review feedback only how to write unit tests Oh? Please take another look at the result posted in that answer. It's pointing out failing edge-cases in a very constructive (although some might find it too succinct) manner. It's using the OP's approach to point out problems OP missed. That, is teaching done right. Identify the knowledge of ...


6

I've seen a lot of mods answer non-meta questions. Actually, to be elected a moderator, it helps to have answered a lot of questions, both meta and normal. There are no restrictions, except for time. There's only 24h in a day and mods simply can't do everything. Heck, there's a lot of users that moderate more than they're answering. Which is fine, since ...


4

I don't see a problem with challenging the questionable requirements of a programming challenge, however, I think the answer should have given priority to the OP's code rather than the silly requirements. I would have organized the answer somewhat differently with the silly requirements after the observations about the OP's code.


2

I can see myself misunderstanding your flag. The segment "on the answer" is fairly ambiguous. Normally I would suggest commenting and then flagging. The comment should explain the steps for the user to take. This comes in handy when flagging as then the moderator can also see what your desired path is, reducing ambiguity. I personally would flag a couple ...


2

I really want to opine that it's fine. It can be educationally useful, especially for students who might assume these code practice sites are modelling good practice. Nevertheless, it probably is not a strictly valid target because of the authorship requirement. The challenge defines an interface. Interfaces are code. If you're hobbled by a shoddy ...


2

Mods can answer non-meta question just like other users. You may not see it very often here because an question on Code Review can be quite time consuming to give a full answer for, and they don't have as much time to spend on non-moderator things. You'll often see questions have been edited by a moderator. You'll see them answer Meta questions fairly ...


Only top voted, non community-wiki answers of a minimum length are eligible