What's the "right" way to share code with others on this site? Should I attach a file to my post, or post to one of the code sharing sites (ideone, codepad, etc.)? Which code sharing site is the "right" one?
I ask because I posted some code to ideone, and someone tried to look at it but it had disappeared (404 error). But links to code from posts before mine still had valid code. I reposted the code, but couldn't see anything I might have done wrong. I'd like to know the reliable way to do it.
It's totally your preference. Personally I like codepad.org because it will run your code & report errors, and the codes don't disappear too quickly. I use dpaste.com too, which does not interpret your code. But if you don't click "hold" your paste will disappear in 7 days. I think I've had issues similar to yours on ideone, but I don't have the slightest idea what could cause it.
I like codepad. It has been the easiest to work with. Did not know that it only lasted 7 days though (without hitting hold)...
I think attaching a file would really only be suitable for very large amounts of code. For the standard small amounts you see for most questions here, having to download an attached file would be tedious and annoying, especially when you could much more simply copy and paste it from a code sharing site.
Join our real-time social learning platform and learn together with your friends!