Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I have a bug in my application that I'm building. I asked a question on S.O. and one of the users asked me to post or send all the code to him so he could look at it.

I totally understand the request. It is valid and understandable. However, I'm having doubts on if I should. Obviously, I give him/her the keys to the kingdom and I will not have any recourse if he/she would do something malicious.

I also want to add that I mean no-disrespect to the user on SO that offered their help. I'm just airing a concern.

I do want to have my bug fixed but there is no guarantee that this person would be able to fix it.

Should I release the entire source code and hope for the best? Or keep it and try to figure it out on my own?

What would you do?

share|improve this question
2  
Tough question. Well asked. –  yfeldblum Apr 11 '11 at 15:08
add comment

5 Answers

up vote 39 down vote accepted

Build an SSCCE (short, self contained, correct example). If the bug disappears when you remove some of the extra details for the SSCCE, then you found it.

Otherwise you will have an SSCCE that you give or post that ideally eliminates the code that you are concerned about sharing.

share|improve this answer
1  
For those unfamiliar with "SSCCE": acronymfinder.com/SSCCE.html (ignore the first definition of "Superficial Squamous Cell Carcinoma of the Esophagus"). Aha, found the better link: sscce.org –  FrustratedWithFormsDesigner Apr 11 '11 at 14:58
    
What's an SSCCE? EDIT: Just stick it in your answer. :) –  jprete Apr 11 '11 at 14:58
6  
Building the smallest possible repro is great for many reasons, not only are you not giving away your code but you may well find the bug in the process of developing an example. –  Steve Haigh Apr 11 '11 at 15:05
3  
And the SSCCE doubles as a regression test, making sure you never get that bug again. Also, often you can build a rule for a static analysis tool from SSCCEs, thus also making sure that you not only get that bug never again, but also never get a similar bug ever again. –  Jörg W Mittag Apr 11 '11 at 16:56
add comment

Be discrete

It's innocent. You want to post some code and have the SO community help. The problem is people are always watching.

I got written up for posting a script. It happens.

Post at home or in a cafe. Post discretely. You should be able to take some notes and bring it in without getting in trouble.

Note: I'm a little pissed at how naive I was. Be smart!

share|improve this answer
    
I think the word you're looking for is "discreet", perhaps you've spent too much time programming! :) –  Sedate Alien Apr 12 '11 at 1:03
add comment

If it is the code of your personal project and it is not a commercial one, you don't have issues in giving your source as long as you are maintaining a copy of it(better in some source code version control system).

share|improve this answer
add comment

I wouldn't do it, especially if you're working for someone else, who likely wouldn't appreciate you handing potential competitors source code.

But even if it's your own code, it misses the point of Stack Overflow, which is to have an index of questions and answers for everyone to read and use. So you post enough to ask your question, people answer the question as posted, and future readers have a well-encapsulated question and answer in front of them.

If you can't reasonably post enough to understand the bug, then you should try and reproduce the bug in as small a piece of code as you can, and post that. (EDIT: The Short Self-Contained Compilable Example concept mentioned by jzd.) Don't post large amounts of source code, and don't simply hand large chunks of your application to total strangers on the internet.

share|improve this answer
add comment

If it's code that you are planning to release as part of an open source project, then I wouldn't worry too much. Otherwise, if this is code you work on at your place of employment and it contains proprietary ideas that belong to someone else, then don't release it to anyone. It could get you into lots of trouble.

Use your best judgment!

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.