Category Archives: Visual Basic

Is it time to replace Mort?

Most everyone who’s steeped deeply enough in the culture of Visual Studio has probably run across some mention of Mort. Mort is one of a triumvirate of personas that the Visual Studio team uses to describe the developers that they are targeting. The other two members of this group are Elvis and Einstein. (I got complaints from internal people the last time I mentioned the personas, so let me take a moment to say that they are open knowledge.) Love them or hate them, the personas have become an integral part of the way that many people talk about VB, C#, and C++, both inside and outside the halls of Microsoft.

There is a problem, though. Let me illustrate, if I may. First, here’s Einstein:

Einstein

A bit of a card, to be sure, but generally a pretty brilliant guy. Sure, he’s spent most of his life chasing some crazy theory of unification, but overall he’s the go-to guy when you’ve got some rocket science project. And, of course, he’s the one claimed by the C++ folks. (Since you pretty much have to be a rocket scientist to fully grok C++…)

Next, we’ve got Elvis:

Elvis

OK, so maybe Elvis’s best years are a little bit behind him and he’s just been coasting on his youthful talent. And, yes, maybe he’s been hitting the corn dogs a little bit too hard. But, c’mon… He’s Elvis, for heaven’s sake! The King! Maybe you don’t call him if you want to go to the Moon in a rocket, but if you want to entertain a stadium’s worth of rabid, screaming fans who won’t notice he’s, um, a little overweight, he’s your man. And, of course, he’s claimed by the C# folks.

Now, we finally come to Mort:

Mort

Hmmmm. Well. Yes.

Now, I should say that this is not the way that I think of Mort. Or that this is the way that our team thinks of Mort. To me, Mort is a smart, pragmatic guy who’s more interested in rolling up his sleeves and saving the world than sitting around noodling on some unified field theory or eating copious amounts of doughnuts. But to a large slice of the world who have an opinion about Mort, this is who they see. A toothless, unkempt hillbilly who’s best kept up in the mountains of West Virginia and away from all nice and normal folks.

And, of course, he’s the one claimed by the VB folks. He’s us. See the problem?

Personally, I think it’s time to let go of the Mort persona. Send him a nice fat check, a referral to a good orthodontist, and thank him for his hard work. And in his place? Well, I’d like to propose hiring this guy as our new persona:

 Ben

Ben, as I’ll call him, is a pretty pragmatic guy and a bit of a polymath, a jack-of-all-trades. In between a writing and political career, he also finds time to be a postmaster, a publisher, a scientist, and an inventor. In short, he does what most VB programmers do: he multi-tasks like crazy, solving problems wherever he goes. (More information about Ben can be found here, for those not steeped in American history.) Now, sure, Ben’s not some rock star like your average George or Thomas is, getting all the attention with flashy military or political antics, but he’s really your guy when you need something done, you need it done right, and you need it done with a minimum of fuss and bother.

Doesn’t Ben sound like a wonderful persona for VB?

Of course, when it comes to product planning stuff like this, what I think doesn’t really matter a hill of beans. I’m sure there’s no getting rid of Mort, no matter what some people may think of him. But we can dream, can’t we?

The silent majority…

One piece of conventional wisdom that I hear now and again is that “nobody uses Visual Basic.” When someone’s giving a talk and asks people to raise their hands if they use VB, they say VB’ers are in the minority. In the buzz-o-sphere, Visual Basic seems to be only discussed when debating whether some other language is the “new” Visual Basic. Even Microsoft has been accused on occasion of seeming to favor C# over VB in things like samples or documentation.

We were having a discussion internally about this piece of conventional wisdom and whether the numbers really backed this idea up. And they don’t. If you look at some of the numbers:

  • Visual Basic is the #1 .NET language (as reported by Forrester Research)
  • Visual Basic is the #1 downloaded and #1 registered Express Edition (topping the #2 position by 20%)
  • Visual Basic is the #1 MSDN language dev center and blog in terms of traffic
  • The Visual Basic Team blog is in the top 1% in readership of all MS bloggers (I don’t know where I fall in that since I host independently.)

All this points to a large “silent majority” of VB users out there who simply go about their work day after day yet don’t make a splash in the places that some people seem to think are the ones that matter (i.e. conferences, blogs, etc.)…

Beta VB 9.0 language specification released…

While I was visiting MSR Cambridge this week with some other people from Redmond, Beth put up the Beta 2 version of the Visual Basic Language specification on our developer center–so she got to beat me to the announcement! This updated language specification corresponds to Visual Studio 2008 and covers the following major new features:

  • Friend assemblies (InternalsVisibleTo)
  • Relaxed delegates
  • Local type inferencing
  • Anonymous types
  • Extension methods
  • Nullable types
  • Ternary operator
  • Query expressions
  • Object initializers
  • Expression trees
  • Lambda expressions
  • Generic type inferencing
  • Partial methods

The following features are not covered but should be shortly:

  • XML Members
  • XML Literals
  • XML Namespaces

The XML features are a little more difficult because I’m debating how much I should just refer to the XML 1.0 spec, versus how much I should specify explicitly. I’ll probably err a little more on the side of the latter, since it’ll be necessary for understandability…

The big "D"-word

WARNING: This is a speculative post. Caveat emptor.

I know that I’m running a great risk of touching the third rail of the VB community by even speculating about this, but it seems like the right time to have a bit of a conversation about the big “D”-word.

That is, deprecation.

Yes, deprecation. Now before anyone starts freaking out, foaming at the mouth or writing a petition, let me emphasize that my thinking along these lines is entirely within the guidelines discussed in the language specification, which mandates a long and gradual process of deprecation that involves continuing to support the deprecated feature for a reasonable period of time. The guidelines also state in part:

…feedback must be solicited from the user community on deprecation of the feature and full notice given before any final deprecation decision is made. The deprecation process may be reversed or abandoned at any point based on user community feedback.

So I’m really just floating some personal trial balloons here. After all, it’s now been almost three major releases since the big move to .NET, and I think it’s started to become clear that some of the features we carried forward are a bit, uh, underused. In the interest of paring down the language specification just a bit in it’s inevitable march towards more and more pages, I’ve been pondering the question: “If I was going to deprecate parts of the language that don’t seem to be used, what would I deprecate?” I’ve come up with a few candidates that seem pretty safe:

  • Type characters. Yes, we still allow you to say “Dim a$”. So far as I have ever seen, no one uses them anymore. It would be nice to reclaim a bunch of characters at some point in the future, and it would be relatively easy to include error corrections to fix this up.
  • Copying of boxed value types. I’m not even sure I could explain this in a bullet point. If you read section 8.6 of the language spec, Value Type Conversions, it’ll discuss this a little more detail. I think this is counterintuitive behavior for most people and is incomplete in any case. The only real question here is: are there programs that depend on this behavior? We’d need to think/talk a lot more about it before we could even consider this one.
  • Mid$() assignment. Bet you didn’t know you could even do this, did you? See section 10.6.3 in the language spec for more on this.
  • End statement. I’m curious if this one is still used by people, especially now that most frameworks like WinForms and WPF have Application objects that have a proper Exit/End method. If this one is popular, it might not fly as deprecatable.
  • Erase statement. I’ve found that ReDim is actually still fairly useful as a shorthand way to redimension an array. However, Erase is completely useless–you could just replace it with an assignment to Nothing and you’d get the same thing.
  • REM comments. Bet you didn’t know you could even do this one either, did you? There’s something nostalgic about it (Erik Meijer loves them), but, really, who uses them anymore?

You’ll note that I’m only including things here that I think are truly not used much or not useful. There are things I think some people would like to see disappear (like, say, On Error), but are still being used heavily enough to make them be not reasonable candidates.

I’m curious what’s people’s feelings about this are. Does this just bring up bad memories? Are there other candidates you’d throw on the list? As I said, at this point, I’m just talking. Depending on the reaction, the next step would be to look a little more formally at it in the team…

What’s on my mind for VB10 (and yours?)

WARNING: This is a speculative post. Caveat emptor.

Last week, one of the VB MVPs asked on a private alias what our thinking was about VB10. As I kind of indicated in my previous entry, I don’t think we have a clear idea yet of what’s going to be on the table for the next rev-VB 2008 was kind of an aberration in that LINQ was in gestation long before VB 2005 even shipped. But I can say what’s at least on my mind:

  • Hosting or, more generally, opening up the compiler services to the outside world.
  • Decreasing lexical “noise” when looking at VB code.
  • Increasing the extensibility of the language so that it takes less work to extend the language and can be done by libraries (Ruby is an example of what I’m thinking of here, but only a general example).
  • Addressing UNDONE tasks from Orcas (object initializers, statement lambdas).
  • Addressing persistent annoyances (line continuations is a good example here).
  • Addressing whatever else comes up from the community as we release VB 2008.

I know that I’ve already added the usual caveats above, but I want to make double clear this is just what’s on my mind at the moment-in other words, things that I’m personally thinking about. These are not official team priorities, planned for the next rev, or anything like that. The next version could look radically different than the list above. I should also add that I mostly think about the language, so that’s why this list doesn’t talk about the IDE.

I’d be interested (in keeping with the last bullet point) what people might be specifically in for the next release. What’s at the top of your list these days?

An update on VBx…

Things have been pretty quiet around Panopticon Central since I did a bit of talking about “VBx” back in May. Partially this has reflected the fact that we’re at a pretty early stage of thinking about the post-VS 2008 world, so there isn’t a lot solid to talk about. Partially this has reflected the usual shifts in emphasis and strategy that occur around the end of a major product cycle as more and more people start to get freed up to think beyond what they’re delivering next month. And partially this has reflected that I’ve got two kids at home now, and that just seems to suck up some of the extra time that I used to use for blogging…

That said, I think it’s worth spending a moment catching up on what’s going on with “VBx” (at least that I can talk about in public).

I think the first thing that’s worth saying is that pretty much everyone seemed to dislike the codename “VBx,” mostly because it overlaps too much with the old VBX controls and partially because it seemed to imply that we were developing another version of the language (which we aren’t). Fair enough. For the moment, then, instead of talking about “VBx,” I’m going to talk about “VB10”. This isn’t an official codename at all, just a personal shorthand way of referring to “the next major version of Visual Basic.” Maybe it will be version 10, or maybe it won’t, but I hope it will be a little less confusing than “VBx” was, in that it should emphasize the continued unity of the VB language.

Back in May, our goal was to have something to CTP in the PDC07 timeframe, which would have been this month. But that turned out to be a more aggressive timeframe than expected. However, even if we haven’t got something solid to CTP just yet, we’ve still got some ideas of where we’re headed and what you might expect to see in VB10. So over the next few months, my goal is to write some speculative pieces on what we are thinking. The purpose would not be to make feature commitments or say what’s definitely in or out of the next version, but instead to get some of our ideas out there and see what people think, see whether there is any traction or not, and determine if we’re crazy or not.

Each entry, though, would need to come with some pretty heavy caveats. To wit:

WARNING! This is a speculative post. It reflects the individual thoughts of the author at a particular point in time. It does not necessarily reflect the future beliefs of the author, nor does it necessarily reflect the beliefs, current or future, of the team as a whole. No conclusions can or should be drawn from this article about future features, plans, or directions of the Visual Basic language. These features may show up in the product as some point, or they may not. If they do show up, they may not look or work as described here. Caveat emptor. No warranties expressed or implied. Your mileage may vary. Fnord.

I hope this will give people a pretty accurate idea of how big a grain of salt to take them with…

lowercase keywords, redux

I’m back from vacation and finally got a chance to wade through the 47 comments on my previous entry on lowercase keywords. Anything that touches on lexical or syntatic issues usually provokes a pretty strong response, and I was glad (?) to see that this still held true. Reading through the comments, I think there are a few things that I should add to my previous entry:

  • I was only musing about changing the appearance of keywords and was saying nothing about changing case insensitivity. I like case insensitivity and there are absolutely no plans to propose changing that at all.
  • The purpose of this thought experiment was not to chase some imagined “C# vibe,” it was to see if there is anything that might improve the visual experience of using VB. If I wanted to work on C#, I could walk down the hall, talk to a few people, and it would be done. I wouldn’t even have to move my office, probably. But I don’t. I respect C#, but I really like VB and am always on the lookout to see if there are things that might make working in VB an even more pleasant experience for myself and the millions of other developers out there.
  • I also wasn’t proposing this as some grand solution, it was more of an off-the-cuff curiosity. I agree with the comments that there certainly are other things to look at when we think about lexical simplicity. (My #1 desire is to get an option or something that will make the pretty lister stop adding back the superfluous “ByVal.” My hope was to have that in Orcas, but…)
  • Along with the previous point, I’m not saying this is somehow more important than, say, the few things we didn’t get done in Orcas but wanted to. Not at all…
  • I’m not sure what I was thinking, of course this would have to be an option. There’s no way we’d force something like this on people. In an ideal world, this would be part of a larger constellation of formatting options. We’re well aware that our automatic formatting is not to everyone’s liking and we see this as a place we can improve.

Oh, and I had to bootleg the compiler, as someone observed, not because the core language services wouldn’t accept lowercase keywords, but just to get the pretty lister to stop listing things back upper-cased…

lowercase keywords?

One of the raps that VB sometimes gets is that we’re too “verbose.” There are a few things that we think might contribute to this perception that we’re looking at for the future, but I had an interesting flash the other day. I wonder how much the fact that we uppercase our keywords affects our perception? So I built a bootleg of the compiler and tried it out on some code of mine. Before:

        Private Function ParseSimpleNameExpression() As SimpleNameExpression
            Dim start As Token = Peek()
            Dim name As SimpleName = ParseSimpleName(False)
            Dim typeArguments As TypeArgumentCollection = Nothing

            If Peek().Type = TokenType.LeftParenthesis Then
                Dim leftParenthesis As Token = Read()

                If Peek().Type = TokenType.Of Then
                    typeArguments = ParseTypeArguments(leftParenthesis, False)
                Else
                    Backtrack(leftParenthesis)
                End If
            End If

            Return New SimpleNameExpression(name, typeArguments, SpanFrom(start))
        End Function

After:

        private function ParseSimpleNameExpression() as SimpleNameExpression
            dim start as Token = Peek()
            dim name as SimpleName = ParseSimpleName(false)
            dim typeArguments as TypeArgumentCollection = nothing

            if Peek().Type = TokenType.LeftParenthesis then
                dim leftParenthesis as Token = Read()

                if Peek().Type = TokenType.Of then
                    typeArguments = ParseTypeArguments(leftParenthesis, false)
                else
                    Backtrack(leftParenthesis)
                end if
            end if

            return new SimpleNameExpression(name, typeArguments, SpanFrom(start))
        end function

It’s a little frightening how much just changing the casing of our keywords makes us suddenly look like C#, at least to my eyes. I’m curious what people think of the idea? Would you like to see us switch to lowercase keywords? Provide an option?

(My replies to this entry maybe a bit slow–I’m going to be on vacation for a little while, but something to think about while I’m gone…)