Why So Many Snippets

time to read 1 min | 161 words

So Microsoft has posted a lot more snippets, a Jeff has made them more accessible. I downloaded them and took a look. I'm pretty sure that you could hear my cries of horror all the way to Remond.

Why? That is the question I have. Snippets are useful for things like generating a foreach (although the Microsoft implementation sucks, try the way ReSharper does it.) or maybe generating a method skeleton. I see them doing things there like Hashing A Password, Encrypting Files, etc.

Why? This is just a recipe for disaster. If I want to hash a password, I write a method to do it and then I call it. I don't create a template for hashing a password. By all means, provide more utility methods, but don't do it like this. Allow me to hardwire method calls to intelli sense, cool. Encouraging users toward code duplication, Not Cool.