I number each slip when I create it, and when I need to reference it I just write [$NUMBER].
I started with a slip numbered 1. I add a new numeral whenever the topic is sufficiently different from any other topic. When a slip fits in with an existing topic, I insert it between cards, giving it a letter. So if 1 were programming languages, maybe 1a is Lisp. Then if I need to move a level down I just go back to numerals: maybe 1d3 is some notes on a Lua interpreter.
But I don't get too hung up on the numbers: as long as similar slips are just somewhat near one another, that's good enough. The goal is to accidentally run into similar thoughts (otherwise one could just number them sequentially, and not worry that card 1,467 is a Lua compiler and 1,468 is a recipe for mutton).