What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 133 Stack Exchange communities.

Runnable source code is often used as an additional part of the answer. Since it is not possible to paste runnable code to SO (as far as I know), the code is pasted to external sites like ideone or jsfiddle.

Some of these sites are not so appropriate: they show advertisement, the code could disappear or the sides could be closed. Wouldn't it be useful to provide the functionality of code pasting on StackOverflow to have everything self-contained?

share|improve this question
6  
I'm not sure what you're talking about here. Code can be pasted to SO just fine. –  hammar Sep 28 '11 at 17:56
2  
what's wrong with a short complete example that exhibits the problem? I use ideone all the time for small samples. Works well in 99.9% of the cases. –  staticx Sep 28 '11 at 17:56
2  
Are you saying that you want Stack Overflow to compile your code for you? –  Chris Frederick Sep 28 '11 at 17:58
2  
I think what the OP is asking is for users to avoid using services like pastebin.com instead of embedding the code directly into the question... I think. –  uɐɯsO uɐɥʇɐN Sep 28 '11 at 18:05
    
... and jsfiddle I guess –  Won't Sep 28 '11 at 18:09
2  
@0A0D The OP wants something in house, to protect users from adverts and link rot. –  NullUserException อ_อ Sep 28 '11 at 18:17
    
Meanwhile, you can use: gist.github.com which I think is a far superior alternative to pastebin –  NullUserException อ_อ Sep 28 '11 at 18:20
    
@NullUserExceptionஇ_இ: It was discussed here before I believe it was declined. –  staticx Sep 28 '11 at 18:22
    
By runnable code I ment executable code. My question was edited correctly by @NullUserException. Of course I know that I can paste code snippets into SO. I thaught about executing this code to support and illustrate the answer. Before asking I also searched Meta and found e.g. this, that was upvoted to 4. Well, it seems that I asked a wrong question. I will continue, as others, to paste to external sites and ask less questions on Meta. –  Jiri Sep 28 '11 at 19:55

1 Answer 1

First of all, since SO is for everything about programming, it is near impossible to provide compilers and sandboxes to all languages, libraries and environments. The quoted sites work with predefined set of languages/compilers, but a lot of the code pasted in SO can be for any platform (it can be a code for microcontroller as well!). I will find it kind of frustraiting if some code snippets can't be run at SO, while others can.

Moreover, what about code that does not compile (it has syntax errors), or etc. At SO people talk about code, and do not need to execute it actually. And it would require a lot of server power - those sites do not have the millions of users as SO.

Code executing (hence link to jsfriddle and ideone) is optional, just to help whoever is interested to test the code quickly (often used in the question to demonstrate the problem, or in performance tests). And there's nothing wrong with using external tool for this. I think it's not so common however, and I don't think it's so usefull from a point of view of a Q&A site.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .