Snippets: A Love Story
Coding is hard work, and as they say, being lazy as a coder is a virtue. Snippets are a great way to put this virtue into practice. Even beginner programmers in Ruby are familiar with the attr_accessor. But what makes it even greater than turning six lines of code into one, is turning it into three keystrokes. “r, w, tab” and you’re set.
While that’s one you’re going to use frequently, there are plenty others that you might want, or that you might use frequently for a specific program you’re working on. That’s where custom snippets come in. Here I’ll show you how to you create your own custom snippet in Atom. (Sorry Sublime users, but why are you still using that?)
It’s a shockingly easy process in Atom, and for anything I see repetition in my future for, I’ll be creating these shortcuts to help out. I think it’s easiest just to show you how the process works, and then explain a little bit.
A little extra, for those of us writing sql commands in our text editor, you might appreciate something like this:
No matter what you’re writing though, snippets can make your life easier. Take advantage of such a useful function.