You should be redirected shortly, alternatively please click the following linkCode snippet happiness!
When I was a kid eager to jump to our XT computer with a massive 20MB harddrive to play text based RPGs (where
@ was the lead character and
# was a wall) my mother devised a cunning way to curb the habit. I could play when I wanted, but before I could play I had to do 10 minutes of Typing Tutor.
Fair, but I hated it.
But in hindsight, not a bad thing - I can type faster than I need to and I still had a childhood rich with many hours of hacking around in DOS, playing text games and levelling up my RPG characters.
I'm of the opinion now that being able to type fast, just like being able to talk fast, can at times be detrimental. For stuff to come out right the first time without tumbling over itself it needs thought through and structured. Rushing to express something and simultaneously create structure for optimal delivery often muddies and flusters thoughts. Like when you're pairing and the keyboard operator subconsciously pauses mid sentence or releases a long "Ummmmm..." while they're fixing brackets and white space.
I was watching a Scott Allen video the other day and was once again impressed by his clear, concise communication and almost effortless live coding skills. He worked the keyboard like a magician, shortcutting ReSharper, using
ctor snippets frequently. Code spilled onto his screen with just a few keystrokes and was elegantly refactored with even less.
It suddenly dawned on me that that is what I was missing, I had an epiphany :
Snippets aren't just for slow folks!
My fast typing had held me back: I had dismissed snippets as useless and more effort than they're worth, but here was evidence that they clearly were worth it.
I rushed to
But creating them is so easy and they can be so easily personalised to fit into how you as an individual dev think, that I'm kicking myself I haven't used them more extensively before :)
In Studio 2012 Your custom code snippets are stored in
To represent a $ in a code snippet you have to escape it using a double $$ (because $ is used to delimit variables)