views:

44

answers:

2

Hi,

When learning a langugage, I routinely find myself prototyping new concepts outside of the current project, and often find myself with dozens of small, single use projects which I refer back to, as well as lots of useful code snippets which don't necessarily belong in a function library, but need storing non-the-less.

Whats the best way to name, sort and generally look after these projects and code snippets in such a way that referring back to them when needed is quick and simple? How do you handle this?

Regards

Moo

A: 

Why don't you use Github's Gists for that? You can setup an account for saving them. You can even fork them in case you learn something new.

That account could also store a "snippets" repository where you could store more complex demos or pet projects.

Should bring you a nice, centralized space, and all the advantages of working with a SCM.

Yaraher
A: 

What I've done (under .NET):

I use Snippet Compiler or (lately) LINQPad to do most spikes, then throw the results away. On the odd occasion that I've done a Visual Studio project, I store it in a Junk folder that's not under source control.

"True" snippets or macros (in Visual Studio or ReSharper) go under source control.

What I am thinking about doing in the future:

I heard Bobby Norton speak on Test-Driven Learning, and he recommended writing tests in your favorite xUnit flavor when learning a language/technique. You can then save them, refer to them, try to recreate them from memory, etc. He used the term "knowledge repository". If you're using Ruby or Java, he's got a tool (on GitHub, as Yaraher mentioned) called shubox to help with this.

EDIT: Presumably you would place the learning tests under source control.

TrueWill