Calling VB.NET forms from VB6: Interop Forms Toolkit

Kathleen McGrath over at the The Visual Basic Team blog has released a short (approx. 6 minutes) screencast on the Microsoft Interop Forms Toolkit 1.0, showing how to create a Windows form in Visual Basic 2005 that you can call from your Visual Basic 6 applications.

The idea is that it enables you to incrementally enhance your VB6 applications utilising functionality in the .NET framework. Might be a good solution for someone supporting an existing VB6 application.

What is the most important phrase in software development?

I bet you’re thinking “It was on fire when I found it!” aren’t you? Well, that might be the second most useful phrase, but joking aside, I believe that this is the most useful:

Don’t take anything personally.

It encompasses all of the following traits of good programmers:

  • Being open to the ideas and opinions of others.
  • Being humble.
  • Not letting ego play a part in your thinking and decision making.
  • Not being affronted by other people’s suggestions.
  • A willingness to learn from others.

Early on in my career I will freely admit that I was guilty of not following this advice often enough.

I used to be an end brace man…

Don’t worry, I’m not about to burst into song (that would be unpleasant)!

Over the past two decades, I have shed most of my personal biases towards coding style. Where once I would have argued vehemently for a particular syntax just because I currently used it, I am now always happy to be shown a better or more logical way. I still believe that any coding convention should be backed by the reason it makes the code more readable, rather than just personal preference. When there is no benefit in one style over another, then personnal preference obviously comes into play.

But the one thing I can’t shed is the placement of curly braces in the C style languages (C/C++/C#). Now I’m not trying to ignite a holy war here.

For the first 3 or 4 years I programmed in C and C++, I positioned the curly braces like this:

if () {

}

But over time and exposure to many other languages (and many other programmers’ styles) I felt that it was unbalanced so I switched my style to

if ()

{

}

where I remain. To me, the semantics suggest Begin … End, so the second style seems more natural. This seems to be the default standard for the Visual Studio IDE. I had taken heart in the fact that the majority of the code I’ve seen coming out of Microsoft generation tools has followed this style, but to my horror I recently spotted generated code that follows “1st brace at the end of line”! After a bit of nosing around it seems it’s roughly 60/40. Even the .NET Framework Design Guidelines use the first style, despite the fact that Lance Hunt’s and other popular and freely downloadable coding guidelines specify the second.

One thing I don’t understand is why developers who adhere to the second style don’t write their methods the same way? i.e.

public int MyMethod(int x, int y) {

return h = x + y;

}

So all the C# coders who read this blog, please leave a comment indicating your preferred brace style. I’m curious, so don’t be shy!

Daily Developers Wants You!


The Daily Developer site needs your help. We want you to add some content, no matter how small. This site has been set up so that developers like yourself can share tips and experience and help others. The content theme of the site is anything to do with the day to day life of being a programmer. Come on, you know you want to!

Missiles, Money, Cabs

Some time ago I watched Martin Grenell‘s presentation “How to get your Grandmother to Build Missile Defense Systems”, and in it he briefly showcased an application built using the Composite Application Block called CommSee, an internal application written and used by the CommonWealth Bank of Australia. This presentation is downloadable from the PDC 2006 webcast series. [The Composite UI Application Block is a proven framework for creating ‘pluggable’ applications, based on the MVC/MVP composite pattern].

While I was watching his excellent presentation, I thought it would be interesting to find out more about the design and process behind this application. Well Ron Jacobs has done just that over at Arcast. Nice one, Ron!

TechEd 2006 WebCast Series

If you haven’t seen this already, you can download around 140 of the TechEd 2006 webcast and breakout sessions. It never ceases to amaze me how many resources Microsoft offer for free. [They also seem to have streamlined the registration/download process somewhat. Thanks Ron!]

In fact, Dan Appleman (the VB legend) recently commented on this phenomena, mentioning what it was like to develop software back in the mid to late 1980’s, before Google and when documentation was a lot scarcer than it is now!

Microsoft Privacy Guidelines

Microsoft have released a must read, downloadable document Privacy Guidelines for Developing Software Products and Services based on their internal privacy guidelines.

Before collecting and transferring personal information, you, as the entity
requesting the information, must have a compelling business and customer value
proposition. A value proposition that benefits customers may create a
natural incentive for them to entrust you with their personal information.
Only collect personal information if you can clearly explain the net benefit to
the customer. If you are hesitant to tell customers “up front” what you
plan to do with their information, then do not collect their data. This
applies to data collected and stored locally on the customer’s machine or
transferred over the Internet.