Apparently, there is a “glamour” photographer who shares my name. (Be careful following those links; they may not be safe for workplace viewing!) Occasionally I receive e-mail — generally consisting of a young, hopeful model’s portfolio — intended for this other Phil Weber.
Not that I’m complaining: I could be getting this guy’s e-mail!
The Classic VB petitioners have posted a FAQ page explaining their goals and the motivations behind them. (Hint: Contrary to what you may have read elsewhere, the impending end of mainstream support for VB6 is not the primary issue!) On the lower portion of that page is a section titled, “Myth Busting” which includes a myth of its own:
To take a trivial example, there is no defensible reason why a QuickSort algorithm should need to be rewritten because you have a new compiler for a language targeting a new platform.
Is it true that a VB6 QuickSort algorithm must be rewritten in order to recompile it for .NET? Let’s see…
Here’s a VB6 QuickSort implementation I found on the Web:
Public Sub Quicksort(ByRef list() As Integer, ByVal min As Long, _
ByVal max As Long)
Dim med_value As Long
Dim hi As Long
Dim lo As Long
Dim I As Long
' If min >= max, the list contains 0 or 1 items so it is sorted
If min >= max Then Exit Sub
' Pick the dividing value
I = Int((max - min + 1) * Rnd() + min)
med_value = list(I)
' Swap it to the front
list(I) = list(min)
lo = min
hi = max
Do
' Look down from hi for a value < med_value
do while list(hi) >= med_value
hi = hi - 1
If hi <="" lo then exit do
loop
if hi <="" lo then
list(lo) ="" med_value
exit do
end if
' swap the lo and hi values
list(lo) ="" list(hi)
' look up from lo for a value >= med_value
lo = lo + 1
Do While list(lo) < med_value
lo ="" lo + 1
if lo >= hi Then Exit Do
Loop
If lo >= hi Then
lo = hi
list(hi) = med_value
Exit Do
End If
' Swap the lo and hi values
list(hi) = list(lo)
Loop
' Sort the two sublists
Call Quicksort(list, min, lo - 1)
Call Quicksort(list, lo + 1, max)
End Sub
And here’s the same implementation in VB.NET:
Public Sub Quicksort(ByRef list() As Integer, ByVal min As Long, _
ByVal max As Long)
Dim med_value As Long
Dim hi As Long
Dim lo As Long
Dim i As Long
' If min >= max, the list contains 0 or 1 items so it is sorted
If min >= max Then Exit Sub
' Pick the dividing value
i = Int((max - min + 1) * Rnd() + min)
med_value = list(i)
' Swap it to the front
list(i) = list(min)
lo = min
hi = max
Do
' Look down from hi for a value < med_value
do while list(hi) >= med_value
hi = hi - 1
If hi <="" lo then exit do
loop
if hi <="" lo then
list(lo) ="" med_value
exit do
end if
' swap the lo and hi values
list(lo) ="" list(hi)
' look up from lo for a value >= med_value
lo = lo + 1
Do While list(lo) < med_value
lo ="" lo + 1
if lo >= hi Then Exit Do
Loop
If lo >= hi Then
lo = hi
list(hi) = med_value
Exit Do
End If
' Swap the lo and hi values
list(hi) = list(lo)
Loop
' Sort the two sublists
Call Quicksort(list, min, lo - 1)
Call Quicksort(list, lo + 1, max)
End Sub
Can you spot the difference? (If you intend to point out that Integers and Longs are different sizes in VB6 and VB.NET, please include an example demonstrating how that difference affects the algorithm’s behavior.)
Here’s another:
Why not leave functioning code in VB6, and write new code in VB.NET?
That's a fine solution for the problems it fits. Many developers can indeed let existing applications linger in VB6 forever (assuming future OS changes don't break them), and concentrate all their efforts on developing new VB.NET-based applications. For the great majority of VB developers, however, there is continuing need to revisit and revise legacy applications. While Microsoft may no longer want to support VB6, great numbers of VB6 developers still intend to support their customers with ongoing bug fixes and application enhancements.
Ahem. What prevents VB6 developers from supporting their customers with bug fixes and application enhancements in VB6? Nothing. That’s exactly how my employer is supporting its customers’ VB6 code.
Much has beenwritten over the past week regarding a petition asking Microsoft to continue development of “Classic VB.” I have chosen not to sign the petition; here’s why:
First of all, let me emphasize that I am not unsympathetic to the difficult choices faced by those with a large investment in pre-.NET VB code. Some people have built entire companies around products written in VB; the future of that code is quite literally the future of their livelihood. Microsoft has put them in the unenviable position of having to choose whether to leave their code in VB6 and hope that it remains viable, or to rewrite it some other language, which will cost time and money.
If I had been in charge when VB.NET was being designed several years ago, I would certainly have kept those developers in mind, and not broken compatibility with VB6 unless it were absolutely necessary. But wait: Microsoft is full of brilliant people; don’t you think the VB team thought of this? It’s the height of arrogance to believe that we’re aware of considerations that have never occurred to them.
VB.NET is a product of conflicting goals: On one hand, the VB team sought to maintain backward compatibility with VB6. On the other hand, they needed to make VB.NET a first-class .NET citizen, or risk further accusations that it’s a “toy language.” On a third hand, they needed to ship .NET and its key languages as quickly as possible in order to compete with Java and other tools that were nipping at Microsoft’s heels. While there were undoubtedly features the VB.NET team would like to have delivered in version 1.0 (such as edit-and-continue and closer compatibility with VB6), the tight schedule simply didn’t allow it.
How should Microsoft have handled cases in which “the .NET way” and “the VB6 way” were at odds (such as the size of the default integer data type)? The “correct” answer depends upon your point of view; the VB team was damned either way. I’m sure there were many spirited discussions on issues like this one. We may not agree with the final decision, but that doesn’t mean Microsoft didn’t seriously weigh both sides of the issue.
This is one problem I have with the Classic VB petitioners: They focus solely on the goal of VB6 compatibility, while ignoring the perhaps equally important goal of parity with other .NET languages. Any proposal which Microsoft is to take seriously must consider VB’s future, as well as its past.
Another issue: Microsoft doesn’t create development tools out of the goodness of its heart. The business case for tools like Visual Basic and Visual Studio is to drive adoption of Microsoft’s platform du jour. (Remember Steve Ballmer’s “developers, developers, developers” chant?) In the last decade, that platform was Win32, and versions 4 through 6 of VB helped a lot of people create a lot of software for that platform.
Today, the target platform is .NET. Company representatives have stated that Microsoft has “bet the company” on it. But here’s the problem: Some of the Classic VB petitioners — in fact, many of the driving forces behind the petition — have made no secret of the fact that they have little interest in learning or using .NET. They would have Microsoft keep cranking out new versions of COM-based VB for as long as it’s willing to do so. What’s the incentive for Microsoft to spend millions of its dollars and years of its developers’ time, if it won’t help drive adoption of its current platform?
Now, if the petition had said, ‘We want Microsoft to help us migrate our VB6 applications to .NET as easily as we were able to move our code from, say, VB3 to VB4,’ I would have signed in a heartbeat. Classic VB developers could preserve their code assets, and Microsoft would get potentially millions of additional developers creating .NET applications. Everybody wins.
Of course, nothing prevents the Classic VB petitioners from working on their own compiler/conversion tool/compatibility library to ease migration of VB6 code to .NET. This would be an ideal project for the 2,000+ signers of the petition, and I have repeatedly suggested and offered to contribute to such a project. I have also pointed out that the source code for two “nearly-VB” .NET compilers is readilyavailable. If you’re interested in contributing to such a project, please post a comment below.
I'll never forget my first e-mail address. Back in 1986, I signed up for a CompuServe account; my address was 72451,3401. Several years later, I opened an account with a "real" ISP and started using my new e-mail address in newsgroups and on my Web site. It was then that I was introduced to the scourge of spam.
Three years ago, when I registered the philweber.com and philweber.net domains, I thought, "Here's my chance to retire an address that's on every spammer's list and get a fresh start!" I informed my friends and family of the new address and scrupulously avoided using it anywhere it might be seen by spammers. Or so I thought.
Then the spam starting trickling in. How had they found me? Turns out I had used my new address to register my domains! D'oh!
Rather than change addresses again, I began using spam-filtering tools, starting with Qurb, a PC Magazine Editor's Choice. Qurb works well enough, but it integrates with your e-mail client; if you check your mail on the Web or with a mobile device, you're out of luck.
To address this limitation, I've been using a server-side spam-filtering service, MailSift. I simply set my POP3 server to forward all messages to MailSift, then point my e-mail software at MailSift's server to retrieve my messages. (MailSift can also poll your mailbox if your ISP doesn't support forwarding.) The service works great, and at $2/month it's quite affordable. (My current stats reveal that since I signed up two months ago, I've received 767 spam messages, but only 247 legitimate e-mails.)
Another annoyance with which I've been dealing recently is comment spam. If you host a blog on Movable Type 2.x, I recommend MT Blacklist, a donationware plugin that blocks comment spam by comparing the commenter's URL against a list of regular expressions. It can also despam your comments if one of those parasites slips through your defenses.
I recently switched to Vonage for our residential phone service. The process was relatively painless: I asked one of my co-workers, a satisfied Vonage customer, to refer me; he thereby gets two free months of service, and I get one. (If you're considering Vonage and would like a free month, drop me a line.) I completed an online application and printed, signed and faxed the (optional) Letter of Authorization to transfer our existing number to Vonage. That was it.
A few days later, I received a package containing a Linksys VoIP router. My network topology is very similar to Omar's; I followed his instructions and was up and running in minutes.
It took about a month for Qwest to transfer our number over to Vonage (Vonage provided a free temporary number for us to use while the transfer was in progress); that process went smoothly as well. Qwest didn't terminate our service until about 24 hours after our number had gone live on Vonage, so we never missed a call.
It was only after Qwest had disconnected us that I remembered that our TiVo, which is at the opposite end of the loft from the Vonage box, needs a phone line in order to download its program data. (Newer Series 2 TiVos include a USB port which can enable them to download program data over a network connection; unfortunately, I have an older Series 1 device.) It's possible, I'm told, to connect Vonage to our internal wiring so that it's available at all our phone jacks. But I'm a software guy, and TiVo was complaining that it only had a few days of program data remaining, so I just strung a 30-foot phone cord from one end of the loft to the other; if it worked, I'd think about connecting Vonage to our internal wiring later.
But it didn't work. Apparently the digital-to-analog-to-digital conversion was just too much; no matter what I tried, I couldn't get TiVo to complete a successful call on the Vonage line.
I now faced several alternatives: I could order a bare-bones phone line from Qwest (about $15/month) solely for TiVo's use. I could purchase a new Series 2 TiVo (about $90 after rebate), which would be able to download its data over my wireless network. (This option also appealed to me because we could then use Series 2's Home Media Option, allowing us to enjoy PC-resident music and photos in our living room.) I was about to drive to Costco to pick up a new TiVo when I realized that I'd also have to purchase a new "lifetime" subscription ($300) or pony up $13/month for the TiVo service. (I have a lifetime subscription for my existing TiVo, but it's not transferable to a new box.)
I eventually decided to retrofit my existing TiVo with a TurboNET Ethernet adapter (about $70). I also found these instructions for connecting TiVo's serial port to a Windows computer and using that computer's network connection to download TiVo's data (I wasted an evening trying, unsuccessfully, to get this to work with Windows XP SP2; apparently SP2's enhanced security prevents TiVo from accessing the network. It works just fine, however, with Windows 2000). Finally, I ordered a Media Center PC to replace my aging desktop system, and a Media Center Extender to connect the PC to my TV and audio system.
My plan is to transfer the 120GB drive from my current desktop PC to the TiVo when I install the TurboNET card; then I'll have a capacious TiVo with network access. In the meantime, I'm using a serial connection to my laptop to keep the TiVo up-to-date. The Media Center PC and Extender will give me the equivalent of a second TiVo with Home Media Option, but no subscription fee. And hopefully it will all get along with Vonage! I'll let you know how it turns out.
Mr. Leland: I'm sorry, there's just no way that we can keep you on. Kramer: I don't even really work here! Mr. Leland: That's what makes this so difficult.
Proof that my life is actually a Seinfeld episode: I've been fired from a volunteer job.
Since 1995, I've been designated a Microsoft Visual Basic MVP, based on technical assistance I've offered in various online communities. Most recently, I've been active in the DevX Technical Forums.
The arbiters of the MVP designation, however, grade on a curve. Though my online activities have remained relatively constant over the past few years, they apparently no longer qualify as "outstanding." When I pointed out that I have posted over 1,000 messages to the DevX Forums over the past 10 months, my MVP "Buddy" replied that some other MVPs have posted over 4,000 messages during that same period. (To which I say, "Go outside!" Who are these people? ;-)
I'm not bitter; I'll just work a little harder and earn back my title. You can help: Post your VB/C#/ASP.NET questions to the DevX Forums or as comments to this blog.
P.S. -- Adding insult to injury, at the conclusion of our last conversation, my MVP "Buddy" added, "...and Betsy asked me to tell you to quit stalking her!" :-)
Poor Betsy Aoki: I think my Betsy Fan Club initiative creeped her out. All I meant was that I thoroughly enjoy her online persona -- it's a breath of fresh air among the mostly humorless blogs to which I subscribe -- and I wanted her to know that her efforts are appreciated. (I could have proposed a Rory fan club for the same reason, but he has more than enough fans already, and I find him far less attractive.) Unfortunately, I may have been excessively effusive (in retrospect, I concede that my marriage proposal was over the line ;-) and come off as a bit of a wacko.
To her credit, Betsy didn't decline to meet me for lunch when I visited Redmond a few weeks ago, but she did bring along a bodyguard. I took my meds, though, and hopefully the experience was a pleasant one for all concerned. Betsy was even gracious enough to chronicle the event on her weblog, going so far as to declare me “quite normal” (my therapist was thrilled!)
So, thanks, Betsy! I'm still a fan, not at all underwhelmed. And I promise to honor the restraining order.
For much of the past five years, I've been a remote employee working from home. While I certainly enjoyed the flexible hours and lack of commute, I did occasionally miss interaction with coworkers. No longer...
One of the benefits of my new job is an informal Professional Development Book Club: Each week (more or less), we read a chapter of a popular business book (we're currently working through The 7 Habits of Highly Effective People), then discuss it over lunch.
During a recent discussion of Habit 2 ("Begin with the End in Mind"), my friend Bala shared this article from Fast Company magazine. I'm sure it will resonate with many of us, particularly anyone who has worked on a dysfunctional software development project.