views:

167

answers:

6

As programmers I'm sure many (if not all) of us have scripts which automate parts of our daily work/play. I was curious as to how others organize their scripts? Do you categorize your scripts? Do you put them in source control? Do you follow any uniform coding conventionss? Do you document them?

+1  A: 

My scripts are;

  • Organized first by what runs them, then by functionality
  • Always stored in source control
  • I do follow coding conventions in whatever I do
  • They are only lightly commented, not documented.
Rob Prouse
A: 

Definitely in version control. Systems like Bazaar let me do that without a server, if that's a problem.

Python's optparse makes it easy to make cool self-documenting command lines, so I usually invest a few minutes doing that as well.

orip
+1  A: 

I just put scripts into the folder of the related project. It usually looks like:

/work/projectSmall/ - just with other project files but named with starting "_" to sort nicely

/work/projectBig/_processData - if there are a few scripts related to some aspect of the project

Usually I do not put them in source control separately from related projects.

Their names are meaningful and the sources are commented lightly.

Sergey
A: 

I use TortoiseHg (mercurial). No need for a centralised one, with mercurial the repos is in the same dir. I do a push once in a while to my server at home.

brunoqc
A: 

General scripts go in a ~/scripts directory that is pathed.

Project related scripts go in a projname/tools/toolname directory or for small ones may live in the directory they're run in.

Documented lightly.

Always revision controlled. Why wouldn't you? (CVS -> SVN -> git)

MattG
A: 

At work I have a directory called myenv, which contains the usual suspects on Unix like bin, lib, etc. If I need to compile something or I have a script written by myself I put it into that structure and $HOME/myenv/bin is in my PATH. I recently started using git for all my little helpers.

André