views:

68

answers:

3

Is there a tool or process for keeping your functions, selectors and 'for loops' handy and search-able for future use? I use nothing and am re-learning occasionally for a similar problem I've already solved.

background: I'm progressing into jQuery and Javascript and am starting to see some repeating patterns like building complex selectors, iterations to build JSON menus etc.

But I don't have a computer science background so I feel like I'm missing some fundamental 'code library' part of my daily work.

A: 

It depends on the tool you use. For example, if you use Eclipse, you can search for Eclipse snippets plugs. I use KomodoEdit, which comes with a great snippets tool already.

Robusto
A: 

If you are using emacs as your development environment, use yasnippet

Rohith
+1  A: 

For the ultimate in portability, nothing beats a plain text file with the snippets stored in it.

Sean Vieira
That's what I use for storing commonly-used-and-commonly-forgotten tricks, methods, functions, and snippets. I have one file for each language I use commonly; I don't just store snippets in them either -- I have whole articles in a couple of them that contain useful general techniques (i.e. I just added BobInc's "How to properly create a Javascript Object" from Stackoverflow into my Javascript snippets file).
Sean Vieira