< Work Smarter using Code Snippets >
Although programming is a lots of fun (or not), doing it for hours, days and especially nights, it can become a quite maddening task.
When I started programming I was always told to find better ways to facilitate my work. To whenever possible put the machine doing the work for me so I could concentrate on the parts that the machine is not able to do it by itself. It was only after a certain time that someone introduced me to code snippets and I must say I was astonished.
What are Code Snippets?
Code snippets are an easy way to insert and customize blocks of code using just a keyword.
Why do you want to use them?
Code snippets are great to speed up your coding. With just a keyword you can insert a whole block of code. For example by just typing the keyword for you can get a whole for loop written in your document (BTW this is a snippet already defined for you to use).
Code snippets are customizable. Besides creating automatically blocks of code, it allows you to define the customizable areas of your code. For example in the example above you can customize the variable i and the max.
Code snippets are great, and this is my favourite advantage, to use very complex blocks of code without having to remember exactly what to type each time you need them. Like I said in the beginning, it is the machine that should facilitate your work and not the other way around. If you already know how to do it and foresee doing it a lot just save it in a snippet.
Always work smart, not hard.
How to use them?
Check our TUTORIAL on how to create and use your own code snippets in Monodevelop.