| You are here: | About>Computing & Technology>Visual Basic> Using VB.NET> How To Use (And Create) Code Snippets - Part I |
![]() | Visual Basic |
How To Use (And Create) Code Snippets - Part IJul 8 2007 The "other" reusable code baseIntellisense Code Snippets are chunks of code that you can quickly plug into your Visual Basic projects but which also have added features supported by Visual Studio and Visual Basic .NET Express. Note that I used the full title: Intellisense Code Snippets. Microsoft made the unfortunate choice of naming this technology using the same word, "snippet" - a few lines of code selected from a larger program - that programmers have been using for decades for something quite different. So if you're searching for more information, you will have to trudge through lots of pages that have nothing to do with this new technology. In this article, I use the name "Code Snippet" to mean this new Microsoft technology, not just a few lines of code. Code Snippets feature much more than just lines of code. They're a complete and well designed system that ...
That's a lot of features! Visual Basic 2005 Pro includes over 500 code snippets and VBE has over 200. (According to the Microsoft team, they use the "russian doll" approach: more expensive versions are supersets of the cheaper ones. You're supposed to be able to download more from the web and the Code Snippet Manager even includes a built-in button for doing that. I think Microsoft imagined that developers would start posting free snippets on web sites like crazy but that just hasn't happened. I only found a few sites that had any at all and there were just a handful of snippets in those. Microsoft isn't giving up, however! Although I failed to find much in the way of third party Code Snippets, I did find Code Snippets that Microsoft has already provided for the unreleased 2007 Office system. These Code Snippets performed functions like:
This should give you confidence that your investment in learning about Code Snippets will be paid back as you work with future Microsoft technologies. Although there aren't a lot of downloadable Code Snippets available, you can create your own either by hand using raw XML or using one of several alternative Code Snippet editors. (Curiously, it seems there are more editors available than downloadable snippets.) We'll check out both of these approaches in Part II of this article. But the first task is to gain some experience just using Code Snippets so we can tell what they are. To do that, see the next page to to revisit the ever popular "Drinking Binge" project that was created to demonstrate how to code events in VB.NET. |
Las Vegas on a BudgetFind a BargainHotel DealsCheap EatsFree AttractionsEntertainment for Less |
All Topics | Email Article | | | ![]() |
| Advertising Info | News & Events | Work at About | SiteMap | Reprints | Help | Our Story | Be a Guide |
| User Agreement | Ethics Policy | Patent Info. | Privacy Policy | ©2008 About, Inc., A part of The New York Times Company. All rights reserved. |


