0

Most of the time, to explain the problem in better way, it is much better to provide a minimal workable code.

However, for certain project like Android, to make a code run-able, it requires other files like gradle file, layout files, asset files, ...

What I usually do is,

  1. Zip my minimal workable project code.
  2. Upload to drop box.
  3. Provide shared link of my drop box.

An example is NullPointerException during android.widget.TextView.checkForRelayout

However, I feel this is not the best way to do so, as it posts certain problem. For instance, I can accidentally delete drop box file, and makes the posted download link become invalid.

Is there a better way to upload minimal workable project code?

Is it good, that we can post "code as attachment" in the question?

3
  • Obviously an MCVE is always preferred. For sharing a lot of fluff just to set up a code example, the staff is currently considering collapsible code markup. I doubt SO will ever add attachments though. Commented Oct 3, 2015 at 17:44
  • 2
    I'm not a fan of resorting to off-site resources in file-sharing sites like Dropbox either, because of your aforementioned link rot. Posts on any Stack Exchange site need to be useful to future readers. If a Dropbox link fails to work in the future, well then your post has less usefulness to posterity.
    – user456814
    Commented Oct 3, 2015 at 17:53
  • 3
    @approxiblue Why not? It would make it easier to get people to download your new virus.
    – user4639281
    Commented Oct 3, 2015 at 17:53

1 Answer 1

6

There are certain project types (Android didn't spring to mind) that are a little bit harder to provide an MCVE. I know that users of Unity3D that are struggling with certain renderings/scenes might run into these problems.

However, the request to add file-storage to Stack Exchange has been requested before and is declined.

The main problem I see is that it opens the door for even more low-quality, fix-my-code-for-you type of questions. Those questions only benefit the asker, seldom any other visitor and we exist because the other visitors find the posts here helpful.

A second problem is for the answerer. They first need to download arbitrary files, un-zip that, run it and then provide a fix. Do you expect the answers to re-zip their solution?

A third problem is search ability. Linked content is not indexed in the correct context so certain keywords in the zipped file are not associated with the post.

The last issue is the link-rot as you indicated your self. If the link goes stale what is the use of the post?

You can always provide a link to an external resource to support your post if screenshots aren't enough to clarify the issue. But the question it self should be self contained. I don't have enough examples of great and lengthy posts where quality would go up if a full-source download was available. I can find enough posts where users are eager to share their sources so even less effort is needed to get their answers...

There is this great question and answer on MSE How to support questions about development environments that rely on more than code alone?

You must log in to answer this question.

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