Author Archives: paulvick

Yes, it’s been quiet around here…

It’s amazing how many viruses babies manage to bring into the house. I think we’ve been down with something pretty much continuously since we got back. Fortunately, we haven’t been all sick at once, but this is starting to get a bit old…

Things have also been extremely busy around work. I’ve been working on something that I’m hoping we’ll have at least a mention of at MIX07 and will probably have more to say about later in the year. I realize there are some threads that have been left hanging, so I’m going to try and tie them up in the coming weeks.

And, finally, the mail on my webserver is now working again, so if you’ve wanted to send me feedback on the Contact form and haven’t been able, you’re back in business. Sorry about that!

Demonstration of XML in VB9

For those of you who might be curious about how the XML integration features in VB9 work, there’s now a great screencast up on Channel 9 that walks you through them while building a sample application:

The next version of VB .Net adds Xml as a built in data type using the new LINQ to XML API. As a built in data type, VB 9.0 provides the ability to create XML using XML Literals and to query XML documents using XML properties. This webcast contains a demo by David Schach, the lead developer in this project, of creating a program to share pictures over the internet.

Check it out!

March 2007 Orcas CTP, now with cool VB features!

Maybe you’ve seen this elsewhere, but the big news of the week (VB-wise, at least) is that the March 2007 Orcas CTP is now out. Those of you who’ve been following along with the previous Orcas CTPs will have noticed the paucity of new VB features relative to some of the other VS languages. This has been largely due to the different implementation strategies of the languages–since the Visual Basic compiler is so closely tied to the IDE services, we needed to really plumb the features all the way through before we could consider them “complete.” Anyway, many of these features are now on-line and available to be tried out. They include a bunch of features we’ve discussed before:

  • Query expressions
  • Object initializers
  • Extension methods
  • Type inference
  • Anonymous types
  • XML literals
  • XML access members

And the CTP also includes some pretty nice Intellisense enhancements that have not been discussed previously. I encourage everyone to give the CTP a whirl and let us know what you think!

A belated "five things"…

I thought I’d done this when Bill was kind enough to tag me, but I just found this post tucked away in my “drafts” folder… I know this is well beyond the life of the original meme, but I went through the trouble of writing it, so here are five things you probably don’t know about me:

  • I wrote my senior thesis in college on the role of etiquette in Tom Sawyer and Little Women. (I actually double majored in college and graduated with a Bachelors of Science in American Studies and Computer Science. This may have been the first BS awarded in American Studies at Yale.)
  • My wife and I have a long-standing tradition of reading together out loud at night before we head off to sleep. We started with a number of children’s classics that I had never read as a kid (The Wind in the Willows, Winnie the Pooh) and have since skipped back and forth through a number of different genres. Barnes and Noble’s classics series has been great for this, as we’ve tried out The Count of Monte Cristo, King Solomon’s Mines, several E. Nesbit books and are now starting in to Dracula. When the kids get a little older, we’ll start with them, too, although not with Dracula, of course…
  • I suck at math. Well, I was good enough at faking it to get through multi-variable calculus, but that doesn’t mean that I actually understood any of it. I actually took the GREs twice because I did so much worse on the math section than I did on the verbal and logic sections that I figured that I must have accidentally missed a bubble or something and started answering in the wrong rows. Turns out I didn’t. Second math score was worse than the first.
  • Growing up in the fairly urban, fairly liberal area that is the Research Triangle in North Carolina, there are many ways in which I don’t think I can truly claim to be a Southerner. However, one part of me that will always be Southern is my palate. I constantly mourn the fact that I cannot find any of the following anywhere near Seattle: Chick-Fil-A, Cheerwine, hushpuppies, Brunswick stew, proper cornbread, sliced NC-style BBQ (the kind they make at Bullock’s), creamed corn, Calabash-style seafood, sweetened ice tea or fried okra. Thankfully, we now have Krispy Kreme, red velvet cake is catching on, and I have to say that the Kingfish Cafe’s fried chicken and greens are pretty good.
  • I took piano for nearly seven years and managed to get worse over time, not better. One of the most mortifying moments in my life was when my family was between houses and my mom took me to her friend Mary Lou Williams‘s house to practice. (Mary Lou Williams was artist-in-residence at Duke University at the time, where my mom worked and had become friends with her.) Suffice it to say, if Mary had anything to say about my pathetic use of her piano, I mercifully don’t remember it. (I’m sure she was completely gracious as she always was.)

I think this meme is so dead, there’s no point in tagging anyone. Besides, who’s left that hasn’t done it?

I’m back, and some links…

Well, I have to say that in some ways it’s great to be back at work, and in some ways, not so much. Everything’s going great at home, and now it’s time to get back into the swing of things. Two links for people who might have missed them (but I doubt many people did):

More as I dig through my email!

For Jim Gray, wherever we may find him…

Being on parental leave and not that up-to-date on the world, I wasn’t aware of the disappearance of Jim Gray until this morning, when I opened my New York Times and saw a familiar face, much to my surprise. (The last and only other time that happened, someone who was in my class in college had won a Pulitzer.) I don’t really know Jim well, but have crossed paths with him more than a few times in the past several years. The latest was my trip to Japan for the launch of VS 2005 and SQL Server 2005, where I did the VS keynote and Jim did the SQL Server keynote. For someone who has done so much amazing work in the computing field, I found Jim to be an amazingly down-to-earth, gracious and friendly guy. I’m not at all surprised by the outpouring of concern and effort on the part of the computing industry to help find him.

I can only hope that he will be found alive and well. My thoughts are with him and his family.

New arrivals…

I’m happy to announce that the Vick family has grown by two whole people! On January 9th, my wife Andrea’s birthday, we were in Guatemala City, Guatemala and became the proud parents of two boys, Benjamín Conley Vick and Samuel Jorge Vick.

Here’s Ben with some wild hair going on:

And here’s Sam:

After many months of paperwork and bureaucratic hell on all sides, we flew down to Guatemala last Monday and they dropped off the boys on Tuesday. After finalizing their visas with the US Embassy, we returned home last Sunday in a trip that was truly a marathon. However, the kids were pretty good about it and slept most of the way (except for maybe the last couple of hours). The true highlight, though, was trying to adjust our car seats (which had been left in Seattle) to our children’s dimensions in baggage claim at SeaTac airport at 1am. The temptation to pull a Britney Spears was mighty strong, but the icy roads outside suggested that it would have been unwise.

Otherwise, we’re just recovering from the trip and trying to start settling in to a regular schedule. At eight months, the boys are pretty good sleepers, but there are always kinks to work out in the system…

Exciting times

As I wrote back in August, my wife and I are adopting twin boys from Guatemala. At the time I last wrote, the adoption papers for Ben & Sam were wending their way through the Guatemalan legal system. The Guatemalan side of things was finalized back in October (making us officially their parents) and then there was just the small matter of getting the US Embassy in Guatemala to approve our papers so we could get visas to bring them back into the country. Well… It ended up taking a little longer than expected (two months instead of two weeks), but we got the word last week that our papers had been approved, so we’re now headed down to Guatemala! Assuming no other hiccups come along (knock wood), we should be back home next week with Ben and Sam, and I’m sure our house will never be the same again…

I’ll post pictures when we get back, but this also means that I’m going to be on paternity leave for a month as well, helping to get things settled (at least, as settled as they’ll ever get) around the house. I’m sure there’ll be some times I’m up at 4am and have nothing better to do than post, but things will likely be quiet on the VB front during that time. But rest assured I’ll be back!

Ten years… Where does the time go?

It’s hard to believe, but it’s been ten whole years since I joined the Visual Basic team. Back in January of 1997 I moved from Access over to OLE Automation with the thought that automation was going to be the central place to be for development tools at Microsoft. A month or two after I’d made the switch, I had a meeting with some random guy named Brian Harry and some other people talking about this great metadata engine they were working on that was going to totally replace OLE Automation. I remember thinking, “yeah, right.” Of course, that metadata engine went on to become the metadata engine for the CLR…

After a year and a half working on OLE Automation (and, I hope, working on the first and last component I’ll ever have to check directly into Windows), I moved over to the Visual Basic compiler team. To say I had no idea what I was getting into was an understatement. We’d just shipped VB 6.0 and were figuring out what to do next…

The last ten years have been a real learning experience. Sure, I did well in my compiler class in college, but let’s face it–I had only scratched the surface of what it means to build a compiler, and I knew absolutely zip about language design (they just don’t teach you that in college). I’ve been blessed by the opportunity to work with a whole lot of really bright people who were patient enough to teach me what I needed to know along the way and to put up with me the times I got things wrong. I’m proud of the products that I’ve contributed to over the years, and am looking forward to the work that’s left to be done. The great thing about working on development tools is that there’s always something new…

Dunno if I’ll still be doing VB ten years from now, but as Fats Waller said, “One never knows, do one?” 

IIF, a True Ternary Operator and Backwards Compatibility

One of the things we’ve been discussing for VB 9.0 is adding a true ternary operator to the language. It’s been a persistent source of annoyance for myself (and many others, to judge from suggestions and complaints we’ve gotten over the years) that there is no short-circuiting conditional expression operator in the language. True, there’s the IIF method which does most of what you want, but it doesn’t short-circuit. If you evaluate “IIF(x Is Nothing, 10, x.Foo())” and x is Nothing, then you’ll get an exception because we always evaluate all of the arguments of a method call (since IIF is just a regular method). In contrast, the C-style language’s ternary operator (i.e. “?:”, as in “x == null ? 10 : x.Foo()”) does short-circuit and it comes in mighty handy.

The annoyances get even worse with the introduction of queries into the language, because now there are a lot more places where you want to do in-line conditionals (since there aren’t statements in queries). In fact, I was a huge user of IIF back when I worked on the Access query designer in my previous life. So with LINQ coming, it’d be really nice to have a short-circuiting ternary operator available. So we’ve been pondering how best to do it. 

Rather than introduce some new operator, we’re considering doing to IIF what we did to AscW and ChrW and turning it into an intrinsic function. So even though IIF will still appear to be a function call, we’ll intercept the call and turn it into a true short-circuiting ternary operation. The nice thing is that you won’t have to learn any new syntax–things will just start working the way you expect them to. Probably 99% of programmers will never notice the change or like it. However, there probably will be that 1% of programmers (or maybe .1% of programmers or .01% of programmers) who will notice the change and be unpleasantly surprised. Perhaps you intentionally or unintentionally depended on the fact that all arguments to IIF would be evaluated, regardless of the value of the conditional expression. If so, when you recompile your application in VB 9, your program behavior will break or, even worse, silently change.

So what to do? Well, the language spec does say that we reserve the right to break compatibility for new features “only if the impact would be extremely minimal and the benefit of the feature is high.” I think, based on feedback we’ve collected, the second part of the test is no problem. The first part is the question. For example, we introduced some small compatibility breaks in the language when we added support for unsigned types (that might cause some method calls to bind to different overloads than before), but no one to date has ever reported an issue. So that’s a case where a new feature had a minimal compatibility impact and a high benefit. But what about this case?

Well, we’d like to know what people think. Our take on it is that it is extremely unlikely that anyone is consciously depending on the evaluation of both branches of the IIF expression. Extremely unlikely. And that anyone who’s unconsciously depending on the evaluation of both branches of the IIF expression is actually having a bug in their program covered up by a limitation of the language. If this is the case, then changing the behavior of IIF should help most people write more correct programs and should negatively impact very few people, if any at all.

Or will it? What’s your take?

I should also note that IIF currently doesn’t do the cute typing rules that you’d like from a ternary operator — that is, the return type of IIF is Object, so you have to cast in a lot of cases where you really shouldn’t have to. We’d also fix this at the same time (although we could also fix this by introducing a generic IIF method and fixing a few limitations of our generic inference algorithm–currently if a type parameter infers to two or more types, the algorithm fails rather than taking into account the situation where the type are all related to one another).

And one last huge CAVEAT EMPTOR: since we’re talking about pre-release software, do NOT construe this as a promise this feature will make it in to this release. Even though I believe it will get in, surprises always happen. So don’t start counting this particular chicken until you get actual bits that contain the feature. And even then, nothing’s final until we release to manufacturing.

(Bonus question: Why is it the “ternary operator?” It’s a bit of an imprecise name. An operator that takes one operand is a unary operator. An operator that takes two operands is a binary operator. And an operator that takes three operands…? Since “?:” is usually the only operator in C-style languages that takes three operands, the general “ternary operator” is applied to this specific operator. I imagine there are other names for it, this is just the one I’m used to hearing.)