|Rob Windsor (Microsoft Most Valuable Professional (MVP), User Group Leader)|
Rob Windsor on Discoverability
The .NET Framework is big - very, very big - and it grows with each new version. While many developers are still trying to incorporate the features added to .NET 2.0 into their applications, .NET 3.0 has been released and .NET 3.5 is less than a year away. Keeping up with the avalanche of new features and understanding if, when and how to use them is getting to be an extremely difficult task.
In this blog post I will suggest some techniques and resources you can use to find the information you need in the shortest amount of time possible. When applied correctly they will help you get your work done faster so you can (hopefully) get home in time for dinner.
Situation #1: You know what class or method you want to use but you are unsure how to use it.
This one is the easiest of the three situations and, for most cases, you should be able to get an answer fairly quickly.
Option 1. The Integrated Visual Studio Help or MSDN Library
Help almost always does as good job here. The trick to getting to the place in the help system that is likely to have the answer you need is to provide context with your search. Type the class or method name in the text editor, place your cursor on top of the name, and then hit F1. This will not only search the index for the keyword but it will do so knowing which project template (e.g. Windows Forms or ASP.NET Web Application) and language you are using.
You can also do a search by typing the class or method name in the search box in Visual Studio's toolbar but instead of pressing ENTER, press F1. If you use this technique, make sure to append the type of language element you are searching for to the name. For example, search for 'random class' or 'insert method' instead of just 'random' or 'insert'.
Option 2. The Shared Source Common Language Infrastructure (SSCLI or "Rotor")
OK, help didn't give you the information you were looking for, what's next? How about looking at the source code of the class you're interested in? For the 1.1 and 2.0 versions of the Framework, Microsoft has published the Shared Source Common Language Infrastructure. From the MSDN web site:
The Microsoft Shared Source CLI Implementation, affectionately known as "Rotor" to those of us on the team building it, is a complete implementation of the ECMA-334 (C#) and ECMA-335 (CLI) standards in source code form. It's an amazing piece of software for those who love browsing or tinkering with programming language infrastructure. In its million-plus lines of source code, you will find compilers, tools, techniques for automatically managing memory, just-in-time (JIT) code generators, component and Web services infrastructure, globalization know-how, security protocols, and all sorts of other intriguing realizations of abstract concepts.
Microsoft has built the Shared Source CLI so that researchers, students, professors and other interested developers can teach, learn, and experiment with advanced computer language infrastructure. To achieve this goal, the source code to both the Windows XP and FreeBSD versions of the software has been released using the shared source approach to source code access. The license for the Shared Source CLI Implementation permits anyone to use or modify its code for non-commercial purposes.
What this means to you is that a fairly large subset of the classes from the .NET Framework, written in C#, are freely available for you to download and explore.
Option 3. Lutz Roeder’s .NET Reflector
OK, the class you're looking for isn't included in the SSCLI or it's in some custom assembly whose original source is not available, now what? Don't worry, there is still hope. You may able to see the source code using Lutz Roeder’s .NET Reflector. Reflector is a tool that allows you to decompile .NET assemblies in to Visual Basic, C#, C++ or Delphi. As long as the assembly has not been obfuscated, Reflector can examine the Intermediate Language (IL) code inside and reconstruct something close to the original source.
The screen shots below show a simple VB application in Visual Studio and a look at the compiled assembly in Reflector.
Option 4. The Intermediate Language Disassembler (ILDASM)
The Intermediate Language (IL) Disassembler is part of the .NET Framework SDK. Among other things it allows you to view compiled Intermediate Language code inside an assembly. It works in a pinch if you can understand IL and you can't use the two previous options.
Situation #2: You know what task you need to do but are not sure how to do it.
This one is a little harder than the first situation but not overly so. The issue you're facing has likely been faced before and discussed in some form on the Internet. What you need is a way to effectively find that information and put it to use.
Option 1. Google Groups
Google Groups is a twenty plus year archive of postings to Internet newsgroups (USENET) and, to me, is the most valuable resource for developers out there. Even though newsgroups are getting to be out of vogue, there are still hundreds of questions asked and answered every day on the Microsoft newsgroups around .NET. When searching on Google Groups, begin all your queries with 'dotnet' as it is part of the newsgroup names and thus is an excellent filter. When reviewing answers look for those from Microsoft Most Valuable Professionals (MVP), these people have been recognized by Microsoft for their track record of giving useful and accurate answers to questions in the past.
The MSDN Forums are newer and will, over time, replace the public newsgroups. If you're looking for answers on newer technologies (e.g. .NET 3.0) start here. For stuff that's been around for a while, start with Google Groups and use this as a secondary resource.
Option 2. Google Search or SearchDotNet
Google is still the best search engine around but it's effectiveness can actually be a problem. When searching for information from web sites it can provide too wide a spectrum of results. Wouldn't it be nice if there was a Google search for .NET sites only? Actually, there is. Dan Appleman used Google's custom search technology to build SearchDotNet, a custom web search engine for .NET developers. From the site:
Each day I am more and more convinced that the greatest challenge facing .NET developers is discoverability - finding information and answers that already exist. I find myself spending a great deal of time searching for answers or solutions online, much of that time on Google. When I read about Google custom search, it occurred to me this could be a great tool to help make my own searching more successful, and as long as I was going to put in the effort to create a custom .NET search site anyway, why not make it public?
The screen shots below show the difference in results for a search on 'object relational mapping' using Google and SearchDotNet.
Situation #3: I want to know what I don’t know. How can I find out everything that is in .NET?
This is the toughest and most time consuming of the three situations. Unfortunately there is no single resource that tells you everything available in .NET in an easily consumable format so you'll have to spend time monitoring different web sites to keep up. There are community sites, blogs, podcasts, screencasts, webcasts, magazines and more that have extremely valuable information available for you to use. These resources are great for two things - getting an introduction to technologies you haven't worked with and expanding your knowledge of those that you have. The key here is to pick your battles. You're not going to have time to read/listen to/watch everything so scan the titles and pick out what's most important to you right now, leave the rest for later.
Here is a short list of sites I visit regularly.
http://blogs.asp.nethttp://weblogs.asp.net/ (Thanks, jmanning!)
- http://www.visualstudiotalkshow.com (French language)
You can keep up with the rapidly expanding technologies but to do so you need to know how to get information quickly and where to spend your time doing research. Hopefully you find these resources and techniques help you to do just that.
Rob Windsor is an independent consultant and mentor based in Toronto, Canada. Rob focuses on the development of custom business applications using Microsoft technologies and is also an instructor for Learning Tree International where he teaches many of the courses in the .NET curriculum. Rob is a regular speaker at User Group meetings in the Toronto area and is President of the Toronto Visual Basic User Group (TVBUG). Rob has been recognized as a Microsoft Most Valuable Professional (MVP) for his involvement in the developer community.