Should I store generated code in source control

Posted by Ron Harlev on Stack Overflow See other posts from Stack Overflow or by Ron Harlev
Published on 2009-05-21T16:53:17Z Indexed on 2010/04/23 18:03 UTC
Read the original article Hit count: 404

This is a debate I'm taking a part in. I would like to get more opinions and points of view.

We have some classes that are generated in build time to handle DB operations (in This specific case, with SubSonic, but I don't think it is very important for the question). The generation is set as a pre-build step in Visual Studio. So every time a developer (or the official build process) runs a build, these classes are generated, and then compiled into the project.

Now some people are claiming, that having these classes saved in source control could cause confusion, in case the code you get, doesn't match what would have been generated in your own environment.

I would like to have a way to trace back the history of the code, even if it is usually treated as a black box.

Any arguments or counter arguments?


UPDATE: I asked this question since I really believed there is one definitive answer. Looking at all the responses, I could say with high level of certainty, that there is no such answer. The decision should be made based on more than one parameter. Reading the answers below could provide a very good guideline to the types of questions you should be asking yourself when having to decide on this issue.

I won't select an accepted answer at this point for the reasons mentioned above.

© Stack Overflow or respective owner

Related posts about version-control

Related posts about code-generation