7 ms·
I think it would be a great addition for StackOverflow to have a sort of report button for dangerous code. Take for example libcurl (thus, implementation in PH
by LeonM 7y ago
I think it would be a great addition for StackOverflow to have a sort of report button for dangerous code.
Take for example libcurl (thus, implementation in PHP, Ruby, Go, etc). There are sooo many posts with cURL example code where CURLOPT_SSL_VERIFYPEER is disabled. These are often answers with thousands of upvotes, that have been there for years.
Inexperienced developers copy/paste this code into production without understanding what it does.
- rawfan 7y agoWhy not just edit the answer yourself and add a big red warning?
- Karunamon 7y agoBecause you don't get to do that unless you either have a ton of rep (which is a pain to acquire on SO because nobody votes), or the question is marked as a wiki. Otherwise your suggested edit goes into a queue where it will likely be declined as "conflicting with the author's intent" even if it's an unambiguous improvement.
- jodrellblank 7y agoThe two parts of your post ("some code samples have bad practises with known problems") and ("there should be a report button to fix it") don't seem to be connected. To whom would it report, and what would they be supposed to do about it? Say the answer was there without that option. Next comment "It didn't work, I get 'certificate verification failed' error", next comment "I had to use this option to get around that", next comment "thanks it worked".
- Wowfunhappy 7y agoWhat if the code is dangerous, but that's because it's only intended to conceptually answer the question? For example, part of writing safe code is adding an appropriate level of error handling, but this also dilutes it. If you're trying to understand a new concept, the code with lots of error handling will be harder to parse.
- fctorial 7y agoYou can report the errors in comments, and develop a habit of looking in the comments for reports of dangerous code.
- crooked-v 7y ago...if you have 50 reputation.
- fctorial 7y agoYou mean literally everyone who's been coding for more than 3 months. You need 5 upvotes on your questions to get that much.
- nonbirithm 7y agoI've been using SO for 8 years and still don't have 50 reputation.
- crooked-v 7y agoUnless you've never made any particular use of StackOverflow, stumble on an incorrect answer, realize you have no way to fix it, and then just leave because you don't feel like jumping through hoops just to make somebody else's day better.
- jodrellblank 7y agoIf you've never made any particular use of StackOverflow, why would you expect them to care what you have to say about anything on the site? It would probably take you as much effort to get 50 rep as it's taken you to post multiple sour grapes comments about how dare they have a threshold which excludes you, don't they know who you are??
- crooked-v 7y ago> If you've never made any particular use of StackOverflow I would have made use of it... if I didn't have to post questions I have no interest in posting to farm enough reputation to actually do anything to fix the incorrect answers I occasionally stumble across in Google searches. > It would probably take you as much effort to get 50 rep Again, I have zero interest in posting questions just to farm reputation. Less than zero, actually, because of the mental overhead involved in doing so.
- danpalmer 7y ago> Inexperienced developers copy/paste this code into production without understanding what it does. Also those with less English ability may not understand the comments that call out code as being wrong, reading the comments may be too high effort to happen naturally.