C# Code Snippet Chaos
A few weeks back I discovered that Microsoft had created a bunch of C# Code Snippets to make them more complete like the ones VB.NET shipped with (via a href="http://www.codinghorror.com/blog/archives/000522.html"Jeff Atwood). I've been trying to get myself in the habit of trying to take advantage of these for simple stuff when I can, but it take times to learn (and remember) what functionality is packed in here.
Anyway, today, I had occasion to write a quick app to load a delimited text file, check it, clean it, and load it in a SQL table. I went to get a code snippet to open and read text file figuring I'd just update it to read my delimited file. To my surprise, there was a snippet specifically for reading a delimited file.
It dropped my code in and I filled in the delimiter and file name. I thought I was ready to go, but my code no longer compiled. I noticed the code was calling Microsoft.VisualBasic.FileIO.TextFieldParser. I have never used anything in the VisualBasic libraries before. It took me a few moments to realize VisualBasic had its own reference that I needed to add to my project to get this thing to compile.
For those few moments, I was wondering how poor the quality of these snippits must be if one of the first few I used doesn't even compile.