There was a reason the .NET DA Website wasn't updated - the meeting was cancelled (without telling the meeting leader or the speaker of course!). Stay tuned as I'll probably be giving this presentation in the near future. I'm sorry for the confusion.
In case you've missed my previous presentations, I'm going to be giving my EntLib Exception Handling presentation again on the Microsoft campus in Redmond. This time, I'm giving it for the .NET Developers Association. Their website isn't updated yet, but I'm going to be on at 7pm in Building 40, Steptoe Room #1450.
The original SecureQueryString 2.0 samples did not compile because I accidentally packaged the 1.0 samples with the 2.0 codebase. It compiled correctly on my machine because my IIS virtual directory that the SLN file pointed to the 2.0 samples even though the packaged files were incorrect! The
article has been updated with a new package, or you can just
download it here.
There’s no doubt that RAD is cool. While some developers feel threatened by features that make software easier to develop, I welcome innovations that allow me to focus more specifically on the problem domain and less on the “plumbing”. Whidbey, or .NET 2.0, is just around the corner with some great innovations that are bound to make our jobs as developers easier. One area that has been getting a lot of attention is VB.NET’s My keyword. This keyword exposes six different objects that wrap common functionality into an easy to use API:
- My.Application
- My.Computer
- My.User
- My.Webservices
- My.DataSources
My.Computer, for example, allows you simply get a registry value via My.Computer.Registry.GetValue(…). Tasks such as playing audio, detecting network connectivity, and performing simple data operations are just a small sample of what can be done with My.
Abstracting sometimes leads to a less robust or less flexible implementation. While this may be the case for some of the My features, I believe that at the very least they will be useful for rapid prototyping and in many cases will be useful for production applications. So while this feature may get some flack from some, I believe that this will be a great addition to .NET.
That leads me to my first, and biggest problem, with My. Why is this not a platform feature? I would much rather see this as a part of Microsoft.Helpers.MyServices (for example) than as a part of Microsoft.VisualBasic.MyServices. What about My is a language feature of VB.NET? I understand that VB.NET’s goal is to become more of a RAD language. However, it seems that this goal has placed an artificial limitation on RAD features that are added to the platform. At least when it comes to My, there’s nothing special with VB.NET in respect to RAD other than a keyword that maps to an object. In fact, you can use all of the features of My in C#:
using Microsoft.VisualBasic.MyServices;
// ...
MyComputer my = new MyComputer();
my.Computer.Registry.GetValue(...);
So while I’m grateful for the VB.NET teams contribution to RAD with .NET, I’m surprised that an internal product group review hasn’t recognized
My as a platform feature instead of a language feature. I’d love to have first class IDE support for these features with C# as well as any .NET language. I don’t see any reason why VB.NET gets special treatment in this case.
Me-My-fo-fum. I smell the blood of an ever confusing language. Which brings me to my second issue with My. The Me keyword, which refers to the current instance of a class, was always a little confusing in my mind. Who, or what, is “me”? I didn’t realize that my objects were self aware. In VB.NET 2.0 My is added into the mix. “My” what? To me, My can just as easily (or confusedly) mean what Me does. I can see a beginner to VB.NET get very confused between the two. There’s got to be a better keyword that more clearly describes the functionality that it exposes. Or should there even be a keyword at all? The keyword essentially acts like a global object. Don’t we want to try and avoid those? And while I’m all for RAD, is instantiating a helper object something that really needs abstraction?
Again, I want to give out my sincerest gratitude to the work put into My. It’s a great set of helper functions that will really help .NET compete against technologies like PHP, Cold Fusion, or other scripting or RAD languages and platforms. Nevertheless, I think that Microsoft needs to seriously look at their strategy for “differentiating” languages. I don’t mind if VB.NET gets some RAD features that don’t make it into other languages, but My appears to be just a code library full of helper classes coupled with some IDE features that make implementing them a bit easier.