You are not logged in.

#1 2009-05-15 19:17:51

Basu
Member
From: Cornell University
Registered: 2006-12-15
Posts: 296
Website

How do you organize your code

I currently have all my code in a single Git repo, with folders by language. So I have a Cpp folder, a Java folder, a Python folder, etc. With projects inside them. However, I have my doubts as to whether this is the best way to go. I only have about 3 to 4 large scale projects, with a lot of experimental stuff (textbook exercises, small test projects). I'm looking for a better way to organize this and I'm not sure what's the best way to go. I'm thinking of the following:

Each large project has it's own separate Git repo
A 'schoolwork' or 'exercises' repo to keep stuff from labs and text exercises
A 'scratch' repo (organized by language maybe?) for other random stuff

But before i start tearing my repos apart, I'd be interested to know how you guys organize your code and if you have any suggestions.
Thanks,
Basu


The Bytebaker -- Computer science is not a science and it's not about computers
Check out my open source software at Github

Offline

#2 2009-05-15 19:55:51

Wra!th
Member
Registered: 2009-03-31
Posts: 342

Re: How do you organize your code

I wouldn't trust git too much...cd/dvd backups are always "safer". I have one github account but I really wouldn't keep anything JUST there. Just keep working with your local folder setup and backup occasionally (I backup stuff once a week since I had a harddrive fail a few months ago...). I also save my code daily to an usb thumbdrive just in case my hdd doesn't make it through the week smile.


MacGregor DESPITE THEM!
7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00

Offline

#3 2009-05-15 19:57:19

bwalk
Member
Registered: 2007-03-21
Posts: 177

Re: How do you organize your code

Anything what has its own meaning goes into a own git repository. If projects are somewhat connected, use submodules.

Offline

#4 2009-05-15 20:21:05

nogoma
Member
From: Cranston, RI
Registered: 2006-03-01
Posts: 217

Re: How do you organize your code

~/src/3rdparty -- where I pull src for 3rd party stuff
~/src/classes -- now defunct set of individual git repos from when I was in school
~/src/projects/ -- individual git repos for each significant project I'm working on (using submodules when there are inter-dependencies)
~/src/scratch -- un-versioned directory for toy/sample code I'm working on
~/src/scripts -- single git repo w/ a collection of useful scripts I can clone to different machines for maintenance, etc.
~/src/work -- Single git repo any code I'm working on locally for my job

-nogoma
---
Code Happy, Code Ruby!
http://www.last.fm/user/nogoma/

Offline

#5 2009-05-15 20:42:57

jwcxz
Member
Registered: 2008-09-23
Posts: 239
Website

Re: How do you organize your code

~/scratch - stupid scripts I've written to accomplish quick tasks--I save the ones that might be useful in the future

~/projects - all of my projects, e.g. lasers and other electronics, coding, etc.
~/projects/websites - entire webapps that I'm building
~/projects/code - all of my other projects, in folders by programming language, with another folder for 3rd party apps that I've modified (KVIrc, Bespin, etc.)

~/system - stuff related to my system (./arch for aur/abs packages, ./config for config file backups, etc.)
~/system/scripts - scripts for managing my system (toggling suspend on laptop lid close, switching between single monitor and dual monitors, etc).


-- jwc
http://jwcxz.com/ | blog
dotman - manage your dotfiles across multiple environments
icsy - an alarm for powernappers

Offline

#6 2009-05-15 21:09:55

HashBox
Member
Registered: 2009-01-22
Posts: 271

Re: How do you organize your code

Mine isn't the best setup since I didn't really put any thought into it, but basically it is:
~/build/ - 3rd party sources and occasional PKGBUILD
~/coding/ - All my code, somewhat organised by language, but not always. Some folders under here are under git.

Offline

Board footer

Powered by FluxBB