Yesterday, Charles Petzold spoke at the NYC .NET Developers Group on the topic "Does Visual Studio Rot the Mind?". I was of course there to hear everyone’s favorite Win32 book author. It was a very entertaining lecture, held totally without any use of PowerPoint or any code examples. Instead he discussed the differences between how we program .NET today with Visual Studio and how it was done in the days of 16bits Windows using C and a simple text editor. Petzold made a point that Visual Studio will force you to program in a certain way and you don’t really have a choice. IntelliSense will suggest what code you want to type next. Code generators and wizards will create your classes and implement large parts of them for you. If your application needs a GUI you will use the Form Designer to draw your form without writing any code. Petzold continued with describing how he missed having to do all the coding himself and be in full control of the resulting code. However, he pointed out we have no choice today. The first Windows API contained around 400 methods. The API for Windows95 contained little over 1 000. .NET 2.0 framework contains around 60 000 public methods and properties. So IntelliSense is a must to find a suitable methods to use, there’s no way anyone can learn them all like before. Automatic code generation and using form designers is also a must for a programmer to be competitive today, everyone else are using them so you will just be considered to be a slow coder instead of a careful programmer who’s in control of his code if you don’t use them.
Petzold said he just finished writing a book called "Programming Microsoft Windows Forms" and just started on his next project, a book about the Windows Presentation Foundation (WPF). Petzold said that he fought WPF was the future but not yet with Visual Studio 2005. Lots of things are missing still like the common dialogs, Open File dialog for example. Even if this is fixed in future versions, for smaller projects WinForms will still be the prefered way, just because dealing with XAML is just not worth it. WinForms are good enough in many cases.