OK. I'll restate mine. I believe it's a good idea to edit out elements of code to focus on the areas of interest for Code Review. That's obviously the most productive use of people's time. I also don't see that code needing to be 'real' needs it to be full and unedited. Not the same. So it's (a) the most useful thing to do and (b) not explicitly forbidden.
Zak, there's no material difference between "Full and Complete within the context of the desired scope of your review" and MCVE that anyone should care about.
@DanAllen Perhaps you could enlighten us as to why an MCVE would be helpful on Code Review, remembering that the purpose of Code Review is to analyze and improve existing, working code.
@DanAllen Minimal Complete Verifiable Examples have a specific close reason over here, it's called "Example Code". Probably stub code too. We don't want (or accept) examples. We want actual code.
# It's considered fine.
else:
# It's considered a problem.
else:
# Other code which checks for other possible errors...
else:
# Other code which checks for other possible errors...
That bit alone makes me go "you've cropped the code for us".
That...
Did you not read the FAQ at all?
About page
What topics can I ask about here?
As I said on Twitter, this site is about asking
Does this code make my ass look fat?
In other words, general broad-spectrum subjective feedback about blocks of code you've written.
Stated another way, on Stac...
> On Code Review, everything about the posted code is reviewable. Therefore, the code in the question must be preserved verbatim, including aspects that have no effect on functionality, such as whitespace, naming, and comments.
I'm replicating a scenario on a sample set for better understanding.
Database Table: Products
Report required from that table,
I've written following query to achieve this,
SELECT `Product`, `Price`, `Total Customers`, `Customer1 Name` AS 'Customer Name'
FROM `Products`
WHERE `Products`.`...
@pimgd. It's important to understand the question was about memory barriers / atomics in C++. The really valuable and important code to post reduces the classes to (say) 3 lines that can checked very carefully.
> On Code Review, everything about the posted code is reviewable. Therefore, the code in the question must be preserved verbatim, including aspects that have no effect on functionality, such as whitespace, naming, and comments.
I think that should sufficiently answer why MCVEs are off-topic for Code Review.
> I'm confused! What questions are on-topic for this site?
Simply ask yourself the following questions. To be on-topic the answer must be "yes" to all questions:
Is code included directly in my question? (See Make sure you include your code in your question below.) Am I an owner or maintainer of the code? Is it actual code from a project rather than pseudo-code or example code? Do I want the code to be good code? (i.e. not code-golfing, obfuscation, or similar) To the best of my knowledge, does the code work as intended?
@pimgd The poster already cut out some irrelevant code that built some big object by setting loads of members that exxtraneous to the important and valuable question "Is this thread safe".
However I was explicitly told that Code needs to be full. We the site doesn't say that and can guarantee that the best interests of the question wouldn't be served that way.
> On Code Review, everything about the posted code is reviewable. Therefore, the code in the question must be preserved verbatim, including aspects that have no effect on functionality, such as whitespace, naming, and comments.
Vogel612 the fact that nothing is off topic is exactly why it's a good idea to amend code. If you can't ask people to not comment on everything then the only sensible way forward is to not show them everything.
@EBrown "Betriebsblindheit" is when you're cowboying in your spaghetti so deep that you don't even see you could just pull that one string to untangle it all
@DanAllen correct. But you're atacking this from the Stack Overflow angle...
@DanAllen Yes, we are. And that statement just goes to prove that you aren't thinking critically about this site or what it's for. What value does an MCVE have when an MCVE leaves out very important details that are necessary for a proper review?
@DanAllen enough of this. Your answers are here, this discussion isn't going anywhere. read the link and if you have any further questions or concerns, feel free to bring them up on meta. We're done here.
@DanAllen not off-topic. I'm just saying, everything that had to be said, has been told already. you have been provided with links to our meta and our help center, and cordially invited to disagree on meta. this is the main site chatroom, and we don't like to drag disagreements that spin in circle, at least not in this room.
@Mat's Mug. Thanks. Doesn't answer all the questions. i've no idea why anyone put me through this. Thanks. You really should consider making the on-tpoic/off-topic advice more prominent and less ambgiuous. It is surprisingly hard to find. I had to google to get it. There's no easy path in the sites.
The On-Topic section is really the core of what defines a site. In the former FAQ sections, it was prominently placed and easy to identify. Now in the Help Center, it is buried half way down and 3 columns over. I knew what I was looking for and it still took me several minutes to find.
Such a...
@DanAllen Unfortunately, that's beyond our control. Has to be changed by SE. We didn't put you through anything. You made a comment recommending a move to CR. I responded to you tell that your recommendation was likely to get the question closed on code Review and you were invited here to discuss anything you wanted clarified.
Allow me to provide some context. I have a UITableViewCell that contains an EditText and a Button. This cell is then inserted into the self.tableView.tableHeaderView property of the table to achieve the following result:
Below is my implementation for the view controller:
class ViewController...
Had to scroll wayyyyy back for the original topic. But it seems the original question "but I wanted to ask if there's a proper way to do this without lacking a good performance" is on-topic, as long as the code works, which it does in this case
What I said is in the same register as other comments directed to me. I didn't find any of that even mildly offensive. There must be some soft egos if that puts backs up.
@Phrancis. Not my welcome. That was a year or so ago and much more productive. Though now I know I don't need to use CR because you CAN post working code to Overflow.
@Prancis I won't be back on that basis because it's obviously flawed to perform a 'Code Review' without a common 'Coding Standard' as people will criticise things compliant with one not compliant with another. So the only practice to stay sane is post to Overflow with a targeted question.
This is the code I am using for a distributed system. The code will be used to allow the server to send parts of a (really big) document which will be processed by the connected clients. Please tell me what things would make it more efficient and if there are any security issues that I can correc...
I am trying to build a portfolio website right now, and want to have a column of skills with badges showing what language skills I have. However, the Bootstrap col isn't working. I place wrapped my entire body in the .container-fluid div and the col in a .row div but it doesnt seem to be working.
I have a data validation class, which I would like to return errors in many languages. I'm not writing the whole class, just the needed parts as my question only refers to that.
<?php
class Validator {
public $error = null;
private $options = null;
private $errors = [
...
@Mast CR is useless because people are free to comment on any & all aspects of the code and teach you things and point out issues you might haven't remotely thought about
@Mast So the answer I discover is - No. I don't want to post to CR. I only ever did because I was told to but reason it appears was invalid. Maybe the rules changed? It was a while ago and CR was in beta.
@DanAllen People criticize what they criticize. One person may make a comment on one aspect of the code while another comments on a different aspect; that's what separates CR from SO. Stack Overflow is designed and expected to target specific concerns, problems or issues. Code Review is for the broader "how am I doing as a programmer" question.
@DanAllen You seem to think a lack of an MCVE is a "significant flaw", does that mean that Programmers should be considered flawed because you don't even have to have an actual problem to post there?
@DanAllen SO asks for specific concerns, issues or problems. Code Review simply asks for code that works, so that we may suggest ways it can be improved.
@EBrown I don't recognise that as what I said. I said it's not useful if people are going to review everything aspect against any standard they choose and pick out things you may already know but not have had time to fix.
@Hosch250. You are a forum. A Q&A site is a kind of forum. I think you're locked into an idea that the word 'forum' means a very narrow form of website when it's actually a broad term in the English language that you don't own and neither do I.
Hello @rolfl I hope you're having a great day. Just wanted to take the opportunity to say thank you for all the awesome quality answers you've given me and so many others on the site, I've learned so much and continue to do so and I have fantastic contributors like you to thank.
@IntensifierDescriptorMan I've learnt far more about "good" in the past 2 weeks of being on CR than a whole year of googling "how to program VBA well" and reading SO answers.
OK, an internet "forum" is where people just post long threads of stuff, like Reddit. A Q/A site is there the threads have to have very high quality and pertain to the discussion, or they are removed.
@EBrown It absolutely definitely says in the CR tour that you must wanty anything and everything to be reviewed and it's been said over and over and over on here to me that is absolutely 100% part of the deal.
Stack Overflow is not a forum. Forums are largely discussion-based and tend to follow less strict rules about what posts can be like.
On Stack Overflow (and Stack Exchange in general), we require every new thread to be started with a question and every response to that question to be an attempt ...
I need to go get food so I'll leave you with it. CR - either not clear what it's for and if it is clear not very useful. Stick to SO for any focused question.
Interestingly I've had some downvotes on ancient answers while this was going on. I have to say that my gut tells me it's spite voting. Thanks for the welcome guys. It's been worthless.
@DanAllen FWIW I saw that answer and considered downvoting and/or adding a mod notice, but I thought it'd be over-the-top. the answer isn't reviewing the code, it's presenting an alternative solution without explaining anything - it's a SO answer.
5
(assuming you're talking about the answer I was looking at)
code-dump "try this!" answers aren't good CR answers
I'm am currently studying c programming, but I'm at a very basic level. So for practice I made a program that reads a string and inverts it. I want to know if the code is readable and how can I improve it.
/*
* Goal: Given a string, invert it, then print the result.
* Author: Lúcio Cardoso
*/
...
C++ programmer here. Thought I'd revisit the roots and scribbled something real quick. Would appreciate input on how my C code is looking! Thanks!
slist.h
#ifndef SLIST_H
#define SLIST_H
#include <stddef.h>
#include <stdbool.h>
struct slist_s
{
int key;
struct slist_s* next;
};
...
Here is command line for playing two videos side by side in sync in FFmpeg (ffplay). It can be useful for comaring videos, for example.
ffplay -v warning -f rawvideo -s 800x400 -i /dev/zero -vf 'movie=video1.mkv,scale=400x400 [mv2] ; movie=video2.mkv,scale=400x400 [mv1]; [in][mv1] overlay=0:0 [t...
Hi @DanielA.White..I am actually looking for 'Synchronous call at the time of file operations' and on the top of that, I am in fact looking how to write a Json file. If you still find I should post it under code review, I will do that. — Dhiraj Aggarwal35 secs ago
CONCAT(APF.`element_3_1`,' ',APF.`element_3_2`,' ',APF.`element_3_3`,' ',APF.`element_3_4`,' ',APF.`element_3_5`,' ',APF.`element_3_6`) AS 'Primary Site Address',
For the record: going forward, please let random SO users call us a forum all they want. Let's be pedantic about the code we review, and stay clear of meaningless arguments over the meaning of a word.
I am new to nodejs and express 4. I would like to create a module that will handle my application socket.io events in order to put the code outside of app.js
I am not sure how I could do it. My app.js looks like this for now:
var express = require('express');
var socket_io = require('socket.io'...
Hi. The reason the answer just says '"It's this" is because it's an answer to my own question. Another user (glampert) provided the answer as a comment - which I referenced. However I don't like questions that get answered in comments and never answered so I elaborated the answer in an Answer! No worries though. As mentioned I've no plans to use CR again in the near future. Way too petty for me.
Hi, Dan. CR moderator here. I just came in at the end of this, and have finished reading the transcript for the last three hours. I must say, I'm so sorry for the reception you got here.
I urge our regular room participants to take a break, then go back and read the transcript from a neutral observer's point of view, and reflect on how we should have avoided escalating tensions.
it just so happens that CR regulars love this site, and will fight to death to defend it, its usefulness and the place it's taking on the SE network and the Internet as a whole. calling CR "useless" and "unhelpful" and "too petty" isn't exactly ... constructive, for lack of a better word.
Below code is Reading text from web using WebDriver element and writing data in Json file.
I just want you to optimize the below snippet as I am new to NodeJs. I had to used if-else(to write only last line in the Json file) just because of Asynchronous behaviour of nodeJs otherwise I was trying ...
@200_success Well thanks for the apology. But too little too late I'm afraid. I've just deleted my Code Review account. Now it's been made clear you CAN post working code on Stack Overflow and there seems to be at least a majority who think you can't limit the areas Code Review might criticise I can't imagine what use or value I might get out of Code Review.
I absolutely understand people might like Code Review. People like all sorts of things I don't and I wouldn't want to stop people enjoying themselves but they're going to do it without my support.
An unhelpful Help Center…
Questions asking for open-ended suggestions to improve working pieces of code appear to be unwelcome on Stack Overflow, and many such questions do get closed. However, it's not obvious why such questions would be against by the rules. Some excerpts from the Help Cente...
You're on Stack Overflow and you've found a question that seems to be about improving code. You are trying to be helpful, and you put a comment in the question:
You should try asking on CodeReview.SE instead. —YourName 2 minutes ago
… and suddenly, out of nowhere CodeReview.SE users swoop i...
200_success. Not what I was told way-back-when. I think my point is I think only sites where you can ask a specific question about about code is ever going to be useful.
They did direct me (eventually) at the guide. It is clear. Working code is OK on Overflow.
I've been through enough dev teams to know that without a nailed down standard code review is at best low productivity at worst toxic.
What Code Review has produced is a massive internet code review without a nailed down coding standard. It's always going to go bad. It's not a great idea. I understand people here disagree but as we can see they're not people I really want to mix with.
Will do. My main regret is that under the terms and conditions my content remains posted. I realised I signed up for that but it still doesn't seem entirely fair.
Right! Off to the pub. Have a nice one. Maybe see you on SO. I'm not abandoning the whole shootin' match just CR.
Yes the imports are already ordered in a particular way in the code. By hitting optimize it changes the order and the code review tool of course marks it as code changes. — Salil Surendran14 secs ago
I have the following two methods that write to file various data line by line. Both methods differ from each other only by few lines what would be the best way to refactor them that when in future I want to add another method (for example, CreateXYZLegacyInFile) it would be least time consuming.
...
@RaoulSteffen After a rather unpleasant discussion that has resulted in me deleting my account for Code Review and wanting nothing more to do with it, it turns out you don't need to post your code on CR. You can post working code on Stackoverflow. So now I invite you to post a MCVE of this in a new Question and invite feedback on thread-safety and efficiency. I think what comes back will be interesting and potentially surprising. — Dan Allen55 secs ago
I have no clue, I don't use MySQL anymore after @Simon showed me the light ^^
4
Cache lines keep popping up in several topics I'm sideways involved in, I think it's time to understand what it means
I think I have some basic understanding of cache lines... whenever you access one place in RAM, a full line is copied (say 32 bytes) and put in your CPU cache so you can instantly access them, without having to look it up into RAM
Doesn't that make it hard to reason about O(log n) behavior of linked lists vs O(n) behavior of arrays? As with linked lists you'll have cache misses a lot of the time