views:

28

answers:

3

I have a developer that has asked me if there is a way to exclude certain code from deployment.

We run debug and release builds directly from most recent code in source control. She'll check in code and not want it to be included in the build for various reasons. (The root of this is probably a sort of, design on the fly mentality, but that's a long story)

I've thought about telling her to just comment the entry points, but that will limit her ability to test fully, and it's dificult in several of the monolithic applications we have.

I've thought about telling her to shelf the code, but we're stuck on VSS 6 that doesn't seem to support shelving. (Is there a hack to mimic shelving?)

I've thought about telling her to include precompilier directives to wrap the code that she wants to exclude.

All of these solutions have their obvious problems, so i'd thought i'd try asking the Internet communities.

What do you all do for this sort of problem? What would you do if you had these problems?

Thanks for all your help.

+1  A: 

Move to a proper source control system, and get into branching - we've just migrated from VSS to GIT - no looking back...

Paddy
I can certainly try that approach again. There's alot of changes that need to happen, We own TFS but not the server licenses to host it. Thanks
Beta033
In all honesty, there are so many arguments, from code security, to developer productivity that come from a move to a more modern SCM - I'd really push this. Even just having a SCM system that isn't liable to corrupt your committed code would be a step in the right direction.
Paddy
A: 

In this situation I'd suggest precompiler directives - you say there are obvious problems with that though? I might be missing the point, but what is the issue there?

A S
Well, I suppose when i thought that, i was thinking about using a precomp directive to exclude it from debug builds, in which case, we would just dump the excluded code straight to production builds. We have the added problem of her having written crappy code since the early 90's and hasn't managed to keep up with technology. She's one of the few laggards who still can't wrap her head around "Object-Oriented". So my ideal solution has minimal additional training for her, as old dogs are slow to learn new tricks.
Beta033
A: 

You can always exclude blocks of code with standard #if/#endif "preprocessor" directives. This is very cumbersome, however. It would be much better if you moved from VSS to SVN or GIT.

As for "features she doesn't want on a build", see the so-called "mainline model" here and here.

Anton Gogolev