Matt Gertz, the compiler development lead, has written an article in the latest edition of MSDN Magazine about VB’s background compiler technology. It’s a good expansion on the entries (part 1, intermission, part 2) that I wrote last year. Check it out!
Category Archives: Visual Basic
Imperfect Feedback Loops
In one of the comments on my Community Can Be Cruel entry, Karl said:
One of the problems with custom engagement in the forms of these blogs is that it makes the customer believe he or she might be able provide input which will ultimately have an effect on decisions taken. While this may be true in some cases, it certainly isn’t in others. This isn’t anything wrong on your part, and I certainly don’t want you to stop, it’s just hard sometimes for the community to accept that decisions have been made and that our arguments via feedback are, at best, good theoretical debates.
I think Karl’s right that people end up feeling this way, and it’s something that is partially unavoidable and partially due to the way this product cycle has run. On the unavoidable side of things, there’s no getting around the reality that when a complete consensus cannot be reached someone ultimately has to make the decision. To take the example of the default instances debate, we really did listen to all the comments that people made concerning the feature and discussed them seriously. And, belying our Borg reputation, there was a lively debate internally about the feature, with people on all sides of the issue. This included people who, I should say, voiced many of the same concerns and objections that community members did. In the end, though, a decision had to be made and one choice among the many chosen. I know that when a choice is made that doesn’t agree with your opinions, and especially when those opinions are shared among others in your particular network, it can seem very much like your opinion wasn’t listened to or valued even if was taken into full consideration. We do our best to try and let people know that we listened and be up front about our reasons for taking a different course, but some difficult feelings are probably inevitable.
That aside, though, I think that there has been an extra level of angst about feedback this time around due to factors that aren’t inherent in the development process. The nature of things is that many product design decisions are made well before a beta ever ships. While we always can and do make changes based on beta feedback, the truth is that some decisions are hard to change unless they are caught very early because of the size or the risk the change would entail. Similarly, by the time that a beta is out most of the new feature development time has been used up, so feedback on priorities (i.e. “I want feature x more than I want feature y.”) can be difficult to react to, especially if the features requiring significant development investment.
The problem with the Whidbey cycle is that many of the community engagements that we’re now using to gather feedback (forums, blogs, MSDN Product Feedback Center) didn’t come online until later in the product cycle. I believe the product feedback center came online during Beta1. The forums are coming online in Beta2. Even this blog didn’t really get going until the winter of 2003/spring of 2004. What this means is that a lot of the feedback mechanisms that many of you are participating in now didn’t exist early on in the product cycle when many of the critical decisions were being made. This isn’t to say that there was no feedback – we have lots of traditional feedback channels that were being consulted throughout the cycle – just that many of the communities that are now plugged directly into the feedback loop weren’t there. That’s the bad news. The good news, of course, is that as we approach the dénouement of this release and start gearing up to look beyond, you’re all going to be right there from the beginning.
And, finally, there have been some interesting rumblings from my management chain about moving towards an even more transparent development process in the future. How this will play out is unclear to me, but I think there may be some interesting experiments in community engagement coming…
Refactoring: For VB 2005!
As someone very wise once said, the problem with making confident predictions about the future is that time has a way of making a liar out of you despite your best intentions. The good news in this case, in case you haven’t heard it elsewhere, is that VB 2005 will have refactoring features! Both Brad and Cory have some good discussion on this and you can check out the official announcement on MSDN. Personally, I think this is just great and kudos to the VB folks and the Developer Express folks who made this happen.
I will also observe that the old debate appears to be settled for the moment, at least…
New VB IDE team blog
Lisa Feigenbaum asked me to pass along the info that the VB IDE team (those responsible for the VB portion of the Visual Studio development environment, as opposed to the core compiler/language) has put up a new blog! It’s already got some interesting content there, so check it out!
Visual Basic 2005 Beta 2 has shipped!
You’d have to be living under a rock not to have noticed by now, but I thought I’d add my voice to the chorus: VB 2005 Beta 2 has shipped with a Go-Live license. Take a look, check it out, let us know what you think!
I’ll be at TechEd2005…
Just a quick note – it looks like I’m going to be headed to Orlando in June for TechEd 2005! At this point, I think I’m just going to be doing booth duty and other fun stuff like that, more details as they become available…
Default Instance Considered Harmful…?
Way back in the mists of time (better known as January), I wrote two entries on the default instance feature we’re reintroducing in 2005. The first talked about what default instances are and the second talked about why we thought they were a good idea. I promised at the time to talk about the criticisms that have been leveled against the feature “soon,” but that “soon” has turned into “two and a half months or so.” This is partially because my work load suddenly ramped up, but it’s more because my blog entries and the accompanying comments prompted another round of internal discussion over the feature. That, unfortunately, took much longer than I wanted it to, which further delayed this (since I didn’t want to say one thing only to have to take it back later). So I apologize for the delay in getting back to this.
Anyway, now that we’re past that, the objections to default instances seem to tend to boil down to two major issues:
First, although default instances exhibit most of the attributes of singleton objects, they are really only “semi-singletons” because they can still be instantiated. In other words, in addition to saying Form1.Show(), you can also say “x = New Form1()” and then “x.Show()”. When you use New, you’re creating a second (or third or fourth…) instance of Form1 that is totally separate from the default instance. The relationship between the singleton form and the instantiated form can be obscure at best, causing confusion between the singleton nature of the default instance and the multi-instance behavior of the normal type.
Second, a default instance that can be accessed through the type name (at present, only form default instances do this) erases the distinction between instance and shared members. When I say “Form1.x,” I have no way of knowing, without looking at the object browser or MSDN help, whether “x” is a shared member or an instance member.
(There is a third objection that because non-dialog Windows Forms lose state when they close, default instances are not as useful as they were in VB6. This is a limitation of the Windows Forms design, not VB – when a form closes, everything on the form is disposed, including the controls. Bill proposed a workaround that, I’ll confess, I don’t entirely understand, but it’s something we’re talking to the Windows Forms teams about, although I wouldn’t expect anything for VB 2005.)
The bottom line is that both of the major criticisms of default instances are valid. Despite their usefulness, they do create some semantic confusion that did not exist in the language prior to their re-introduction. Why, then, did we do it? In the end, we felt that, on the balance, the semantic confusion created by the feature was greatly outweighed by its usefulness. Working with forms (and, in VB 2005, web services) as default instances is a very natural and understandable way of doing things, regardless of experience level or knowledge of the language. In our continuing quest to make Visual Basic the most approachable and easy to work with language, this seemed like a very natural feature, not just because it happens to be compatible with VB6.
The standard rejoinder to this line of argument is, “well, fine, re-introduce the feature if you must, but why must you make me have to deal with it?” In other words, “why aren’t default instances optional?” This has been the subject of many long-running discussions internally and we’re open to the idea, but found no good way to do so in this release. We considered introducing a single instance/multi-instance mode switch into Windows Forms, but that would mean that changing the instancing mode of a form would cause drastic changes in the way the form was used in code. Thus, it would be vital to choose up-front whether a form was going to be single instance or multi-instance, and woe be unto the developer who chose incorrectly. We just didn’t feel that was a good user model for the feature.
The other major idea we considered was introducing some kind of configurable warning into the product that would allow people to turn the use of a default instance into a warning or error. This seemed much more palatable, but ultimately died because of what it would imply: warnings and errors indicate code that is probably or definitely wrong. They’re intended to ferret out errors, so adding a “warn on use of default instance” warning would imply, well, that using a default instance is an error, which is something that we don’t believe.
So, where does that leave us? One idea that we’ve started to kick around is the idea of integrating the concept of a “programming style” into the product. In other words, if your programming style is to not use default instances, great – you set that style parameter and then the compiler will warn you when you violate that style. Once you start down this path, you can imagine a great number of possible style settings that the compiler could flag – things that are entirely legal and valid, but which someone somewhere might not like. Unfortunately, this kind of feature is well beyond our VB 2005 schedule. However, as we start to think beyond our existing release, we’d love to hear what you think about the idea!
(For the less-aged among my readers, the title of this piece refers in an ironic way to the seminal paper Go To Statement Considered Harmful by Edsger W. Dijkstra, one of the founding luminaries of the computer science field. I would also note in passing that Visual Basic still has a GoTo statement…)
So it has a name… the Sapir-Whorf hypothesis.
A long, long time ago I riffed a little bit on the question of “why do we have VB and C#?” The idea I was trying to struggle towards was that even though two languages may share many similar constructs and be able to express roughly the same thing, design decisions on little things can make a big difference in the experience of using the language. Now I learn from Dave Remy that this is hardly a new idea and even has a name: the Sapir-Whorf hypothesis. There’s even a discussion about how it might or might not apply to programming languages. Well, you learn something new every day…
(And, yes, I am a geek. When I first saw the phrase “the Sapir-Whorf hypothesis,” my first thought was, “what does this have to do with Star Trek?”)
The Visual Basic 6.0 Resource Center
Just a quick note: Jay Roxe has announced a new MSDN site dedicated to VB 6.0 content and migration. Check it out!
Never penalize someone for speaking their mind…
Bill Vaughn reports that there were hard feelings and veiled threats from some Microsoft people in response to his signing of the MVP petition. I think Michael Kaplan captures my feelings about that situation pretty well. Forget the question of whether Bill’s an MVP or not – the bottom line is that no one should ever be criticized or penalized for speaking their mind, as long as it’s done in a respectful and honest manner (as it was in the petition). Although I think that the aims of the petition are unrealistic, I can understand why someone might sign it and don’t fault or harbor any ill will towards anyone who has done so. As far as I can tell, the petition is an entirely legitimate expression of customer sentiment, which is something we want to hear more of, not less off. Even if it’s saying things that might be difficult to hear or I don’t agree with.
So let me apologize on behalf of the unnamed Microsoft people, Bill, and in the unlikely event (I hope) that you do run into any problems with your MVP status because of the petition (and this goes for anyone else), let me know and I’ll see what I can do.