views:

469

answers:

3

Many of us have a personal repository where we keep our code. Sometimes it's just our hobby code, some people include code from their jobs (shame!), but many of us have a repository in one form or another.

This is complicated by the fact that alot of us work in many spaces (Web Development, Windows and Web Services, Console apps) and many types of software (Screen scrapers, websites, file utilities, small tools, etc).

My question: How do you organize your code repository?

Personally, I organize mine by namespace as such:

Myname (root namespace)

  • Utils
    • HTTP
    • XML
    • IO
  • Projects
    • MV5 (blog)
    • MV6 (newer version of blog)

... and so forth. Whereas best practice is accepted as one file per class (usually), I organize one file per namespace, since IMHO when you have one Developer on a personal project, source control is less neccessary.

... Edit: I should clarify - I'm more interested in namespace organization and selection than physical locations as shown in this thread.

A: 
  • Branch
  • Tags
  • Trunk

And inside each;

  • Contrib (third-party stuff, SDKs etc)
  • Common (My shared code)
  • Projects
    • ProjA
    • ProjB

Btw - how do you get the second level of indents for bullet lists? :)

Andrew Grant
Topic (no bullet) - Subtopic - Subsubtopic
tsilb
oh nice formatting... Two spaces before the dash in subsubtopic.
tsilb
@tslib - ahh, thanks! :)
Andrew Grant
np. Wish I could get upvotes for comments :)
tsilb
+4  A: 

I disagree with some of your remarks. I quite like having source control on personal projects, as it is useful to revert to an older version on occasions, or compare changes.

I think the same standards should apply to personal development as other work, so I would also use one file / class.

To answer your main question, I have a flat directory of applications, containing subprojects where necessary.

I store the source in SVN on a secure internet site.

Bravax
touché; have reworded to be more nearly appropriate.
tsilb
If you don't like the overhead of SVN, it might be worth looking into a DVCS like Mercurial (hginit.com) or Git. I use Mercurial/TortoiseHG on almost all of my projects, which makes it very easy to view history, clone a repo to another system if needed, etc.
Ed Brannin
+2  A: 

I use Git, where I can have the new version with the old version of the code, by branching.

apart from that, I just need a place to store it, and I don't care much for where its at:

C: (I know many people hate C..but hey, sometimes you have no choice) D: USB:

ricsoft\Projectname

once in a while it may have to be

ricsoft\web

or

ricsoft\tools

but very rarely, since I usually don't have that many projects falling in the same category.

check this question here, very similar.

@Andrew:

  • hello
    • hello 2
Ric Tokyo
Saw that thread; was more curious about namespace organization.
tsilb
+1, good remark (plus I have to find one good post from you to upvote ;) 12 down, 3 to go: http://stackoverflow.com/questions/359727#486543 ).
VonC