Abandon Text!

W. H. Auden once said: "Poems are not finished; they are abandoned." I have been abandoning writing projects for many years, since only the pressure of deadline and high expectations ever got me to finish, or even start, anything of merit. This blog is an attempt to create a more consistent, self-directed writing habit. Hopefully a direction and voice will emerge.

Sunday, December 24, 2006

Why .NET is cool (yes, seriously)

I suppose I could write about something deep and significant on Christmas Eve, but after all the careful attention paid to making it an optimal experience for the kids, I'm worn out. It's a lot easier, for the time being, to go on auto-pilot. Which, for me, means to talk geek stuff.

I finally, finally started using .NET on two recent projects. Even though the new Microsoft programming platform came out over four years ago, I put off adopting it until the last possible moment -- that is, until I had a business problem that actually required it. I always considered it a strike against .NET that it had taken four years for me to find an problem that made me think, "Hmm, I think I'll use .NET." Even if Visual Basic 6 is ten years old, it's working, and I'm familiar with it, and I have no time for learning curves.

As it is, I was forced to jump by the usual reasons: everyone else was doing it. Or, more specifically, both Salesforce.com and Microsoft Dynamics CRM were using web services to expose the API for their web-based applications, and the only reasonable way to talk to them was to use .NET. So I swallowed hard and jumped in.

Man, what took me so long? Here are the things I wish I could have told myself at least a year or two ago:
  1. If you're worried about the language changes being too cumbersome, you can relax. Almost everything you're used to using is still there. More importantly, the IntelliSense features in Visual Studio.NET 2005 are so vastly superior to previous versions that you're immediately alerted to important changes.
  2. Speaking of which, I can't say enough good things about the IntelliSense. I mean, I appreciated auto-completion of code and prompts for proper structure, but I was also annoyed at how VB6 would throw a hissy-fit if you deigned to move off a line before you had completed it. Now the syntax checking is unobtrusive and in the background: errors are called out with the little underlining squigglies you're used to seeing for spell- and grammar-checks in Office. Unused or undeclared variables are called out. And it even auto-corrects certain mistakes: I had forgotten that they threw out the "Set" keyword for object assignments (e.g. Set obj = New(, QuoteWerks.Application)) but IntelliSense was so smoothly correcting it behind me that I didn't notice for several hours.
  3. The form drawing features are equally unobtrusive but compellingly useful. As you drop and move controls on the form, the environment automatically handles alignment and spacing, showing you what it's measuring from with little red lines . . . again, helpful without being bossy.
  4. The changes that have been made to the language are sensible ones. The inexorable push towards object-orientation is good, really, even if you've still managed to get through your career without ever writing a class module. It might seem a little odd to think of a form or even a string as a class, but the moment you start using them that way, you're glad about it. All the string-manipulation funtions are now methods on the String class, so you can pop them onto the end of an expression instead of at the beginning (e.g. obj.FirstName.Rtrim() instead of Rtrim(obj.FirstName). And again, the IDE does such a good job of autogenerating all the class-related code that you'll hardly notice.
  5. Web services really do make sense. I was extremely skeptical about the idea at first: "Oh, gee, now we're not only breaking things into different components, but now they're going to live on different machines, too? That will be a joy to debug." But we already have lots of client-server applications talking to each other -- it's just that we had gotten used to using TCP/IP sockets and protocols and such. Now the machinery for inter-machine communication is really easy. I once made a COM+ application as a debugging sample, and it was really hard and next-to-useless. But the .NET web service stuff was easy to use . . . so easy, in fact, that we will see the opposite problem, in which people start making web services for functions that have no business being web services.
  6. Installing the .NET Framework is not that big of a deal. It may seem like a massive runtime engine to install, but with bandwidth and diskspace so plentiful, does it really matter if the runtime is 5 MB or 50 MB, as long as you have to install one at all?
  7. Structured error handling (Try...Catch...Finally) is sooooo much nicer than the old kludgy way of using labelled blocks of error-handling code at the end of a Sub. It's so good that hack programmers like me will actually start doing some real error-handling, instead of throwing in "On Error Resume Next" and praying a lot.
  8. Visual Studio.NET 2005 follows Larry Wall's primary directive for programming environments: "Easy things should be easy, and difficult things should be possible." Easy things, like sending an email, or preserving a form's position between runs, are very easy. Hard things, like rolling your own controls, are more possible than ever, thanks to the class-oriented aspects of everything.

Right now, I'm having a hard time thinking about going back to VB6. So if you haven't tried it, I think you can stop waiting.



Post a Comment

<< Home