My MSDN Magazine article is up on the MSDN site…


It is all about “My”, a feature of Visual Basic 2005… and I think it is fairly interesting stuff 🙂

Check it out here…

 

Comments (12)

  1. Really interesting… thanks!

  2. Ninputer says:

    The ‘My’ namespace is so cool!

  3. Samuel Jack says:

    Will any parts of the My namespace be available through C#?

  4. "My" seems very usefull. I certainly hope it will be available to c# developers as well.

  5. As far as I know (Samuel and Brian), "My" is a VB-Only feature.

  6. Check out the great new feature!

  7. Stephen Toub says:

    Parts of it are available to C#, but not in as easily accessible a way as it is for VB developers.

    As Duncan points out in his article, My provides easy access to two different categories of information. First, My makes it easier to get at parts of the framework, and second, My exposes information about your current project. It does the former predominantly using the Microsoft.VisualBasic.dll, which exposes classes such as Computer, FileSystem, etc. In C#, you could certainly add a reference to this dll and use its functionality in your C# applications. You could even use an alias to make using it more similar to writing in VB:

    using My = Microsoft.VisualBasic;

    or something like that. Not exactly the same, but similar.

    That said, a good chunk of My is implemented in the compiler. If you examine the exe or dll compiled from a Visual Basic project that uses My, you’ll see a whole set of classes generated for you by the VB compiler. These classes expose information about the forms, web services, etc, in your project, and they’re what make My.Forms, My.WebServices, etc, possible. It’d be much harder to get this functionality in C#, though you might be able to craft something using reflection to walk through your assembly looking for classes that derive from Form, classes that have methods attributed with WebMethod, etc. Definitely not as clean or efficient, wouldn’t give you strong typing, and not built for you already like it is in VB.

  8. I am intrested in VB LANGUAGE

  9. WEIKUROIUEWFHSDMCMNBSXXC

  10. Stephen Toub says:

    Oops, My.WebServices is client side, not server side, so if you wanted to semi-replicate its functionality using reflection, you’d have to find all classes that derive from the soap client proxy rather than those that have methods attributed with WebMethod.

  11. robert smith says:

    so… a bit off topic, I guess: You’re still calling it "VS 2005"? I guess that’s fine (Win95 came out the tail end of November 1995 after all so it squeaked in too) but I just had to ask. Over a year out, "how much of this is really going to be in the product" might be the real question I should be asking even though I realize it can’t be answered till… 2006 maybe.

    Nice artice though thank you. Can’t wait to see more on the language/syntax because, to be honest, it’s getting tiresome to keep hearing so much about new Wizards that VB8 is getting which implies that MS has decided that most of us only use VB syntax because we’re too stupid to write code 😉

    Thanks again.

    -smith, Kirkland

  12. robert smith says:

    so… a bit off topic, I guess: You’re still calling it "VS 2005"? I guess that’s fine (Win95 came out the tail end of November 1995 after all so it squeaked in too) but I just had to ask. Over a year out, "how much of this is really going to be in the product" might be the real question I should be asking even though I realize it can’t be answered till… 2006 maybe.

    Nice artice though thank you. Can’t wait to see more on the language/syntax because, to be honest, it’s getting tiresome to keep hearing so much about new Wizards that VB8 is getting which implies that MS has decided that most of us only use VB syntax because we’re too stupid to write code 😉

    Thanks again.

    -smith, Kirkland