What are Snip2Code Properties?

Posted on Posted in About Snip2Code

snippet-propertiesOne of the most useful and distinctive features of Snip2Code are snippet properties. In fact, you can add to your snippet both tags and properties. But what’s the difference between tags and properties?

Tags are simple attributes of snippets, used to search them for an exact match (or ‘LIKE’ behavior with jolly characters). Properties add scope to the features of the snippets, and the capability to search with ‘>’ and ‘<‘ operators. In this way, a snippet with a property like “Windows Version = WindowsXP” will match the search “Windows Version < Windows7”. You can also create your own properties, to expand the management capabilities of your basket of snippets!

Basically, with properties you can define the specific characteristics of the code snippet which will be used during the search. Search for tags alone doesn’t always give results targeted to the needs of the developers. Think, for example, to a snippet with C # code only supported by the relase 4.0 of .NET framework (eg, use of the Dynamic Dispatch), or a snippet in which you use a function embedded in python no longer compatible with release 3.0 + (eg iterators lists dict.iterkeys (), dict.itervalues ​​()). It will be nice to find the right snippets at the right time combining tags and properties.

But the best way to understand the effectiveness of properties is to use them!!! Below you can find some example:

Leave a Reply

Your email address will not be published. Required fields are marked *