- Home /
[Meta] Should links to external code or code screenshots be published?
Occasionally when moderating, the poster's sample code is put on an external site such as pastebin or some obscure site. The post contains a link to the external site rather than placing the code directly in the question. Unless I'm missing it, the moderator guidelines don't have anything to say about whether that should be allowed. So should it?
Same question with sample code in screenshots. These are unsearchable and unwieldy. And finally sometimes code is formatted using blockquote instead of code format.
My vote is to require all code to be placed inline in the question, and formatted using the code format button. Any other way of referencing code would be rejected.
Thoughts?
I fully agree, if it's not embedded in the question with the code format button it should be rejected. Screenshots are especially obnoxious since there is no way to copy-paste when trying to reproduce a problem someone has. I$$anonymous$$O, external hosting is not as big a deal, but it reduces searchability and has a tiny chance of being malicious, so it should go too.
Block quotes may be forgivable, though. I think anyone who takes the time to use the block quote button is probably the kind of person who would fix their post and use the code button in the future if gently corrected with a comment.
One of the moderator objectives is to "$$anonymous$$ake it easier for users to find the information they need". As noted, external code is unsearchable, it has a chance of being broken/changed after the question is asked, and is potentially malicious. And screenshots are unsearchable. So I agree - I reject both from the mod queue immediately.
I usually allow all 3 to go through.
External code is usually used when there is a large amount of code which unity answers can't do. Honestly I don't bother answering these questions but it still seems like external code is useful.
Code in screenshots are usually used to show an error message. Formatting commonly makes the error appear on a different line in unity answers than in the error message. That means screenshots are actually easier to fix in these cases.
Block quotes are usually just people who accidentally hit the wrong button so I just fix it myself and leave a comment.
I can understand why you might want to automatically reject these questions but it seems like it would be better if moderators were allowed to decide if the code was properly formatted for a question. For instance a screenshot of code that compiles without warning, but does something unexpected upon running, so you need copy/paste it to test the code should be rejected because it is poorly formatted.
@$$anonymous$$accabbe I guess I would be fine with allowing exceptions for large amounts of code. But it could also be argued that if that amount of code is required then the problem hasn't been narrowed down enough yet to ask a question about it here.
Answer by meat5000 · Aug 01, 2015 at 08:13 PM
If its 2 or 3 lines of code a screenshot is ok in my opinion. That said its still FAR EASIER to paste and code-tag it. Paste-bin should only be used if really really really necessary to post >3000 chars of code but understand that it may be volitile, but not quite as temporary as dropbox links.
Of course down the line, questions with outdated content will be deleted and thats no friggin use to anyone so paste n tag, on site, all the way.
The leaning seems to be towards rejecting these in general, with room left for judgement calls. That's probably what I'll being from here on out unless and until we get an official ruling.
Your answer
![](https://koobas.hobune.stream/wayback/20220611233945im_/https://answers.unity.com/themes/thub/images/avi.jpg)