views:

58

answers:

2

Are there any source code sharing system that lets you check in/out code on function-level?

Would be nice to be able to check out just one function or one subroutine or one property to work with and still let other developers work with the rest.

I know that working with sorce-control-systems that working primary with mergeing is kind of letting me do that, but I like the check in/check out system but want it not to work only with whole files, I want it to work with functions, objects and a lower code-level.

Someone has to have thouhgt about this before and maybe there is something out there that does this allready?

Maybe also being able to check out a #Region would be nice.

I dont know, its just that in my mind Im not working with files, I working with parts of the system I make, parts of classes, regions, objects, functions and want both Visual Studio and My source control also do that.

+1  A: 

Make the maximum amount of code you'd want to check out the maximum amount of code you put in each file and you're set...!

I don't think any source control deals on the function level. Think about how much it would have to know about every obscure programming language required for that feature to work correctly?

Jason Punyon
Does'nt most languages has well defined start and end of functions and subroutines?
Stefan
They may have very well documented but complicated rules delineating the start and end of functions. They would all have to be implemented...for every language...
Jason Punyon
Also what about the parts of classes that aren't functions? Where would the declaration of instance variables go?
Jason Punyon
@JPunyon, Well, lets make my perfect sourcecontrol system handle check in/out declaration variables too. And If I dont, then I cant change it. If I try to change a variable in my checked out function and that variable is declared outside of the function Ill be warned and told I have to check it out.
Stefan
A: 

There is no version control system that does this. Your best bet is to make sure your code is split up into many small files. For example make sure you have only one class per file if you’re using Java. This does have limitations though, it doesn't make sense to only put one function per header file in C. Make sure in check out comments you explain why you’re checking code out. If your going to use an exclusive check out model make sure you don't keep any code out for a long time. If you have to check out code for a long time make sure the team knows why you’re doing this so they can work on something else. If you’re using a checkout system where multiple people can check out the same file make sure to mention what functions you’re editing in the checkout comments so others won't change that function and cause merge conflicts.

Jared