Background

I have been writing programs for a long time. It all started with Commodore Basic on a VIC 20. Then I advanced to Microsoft Basic and Turbo Pascal under CP/M. I tried to use MS-DOS when that became popular, but it was too limited, so I moved on to QNX and C. And when I gained experience with C, I expanded my platform-base to SCO UNIX, Interactive UNIX, Coherent UNIX, and Minix. I even did some minor commercial programming on a VAX. Over the years I have used a large number of code editors and integrated developer environments. Turbo Pascal was ground-breaking in it's time. It set the standard for integrated environments. Under Unix I tried different approaches, but usually ended up with some variant of Emacs.

When I started with C++ in 1995, I used Microsoft Windows and Visual Studio exclusively, and was in fact very happy with both. But after version 4, Microsoft messed up the very elegant help browser by migrating it to HTML, and then in 2003.NET the focus seemed to have changed from professional developers, to noobs. There was a lot of things that made it hard to use for professional C++ development.

I'm not exclusively devoted to C and C++. I also use Java, php, python and bash. I like the NetBeans IDE a lot, and often use it to edit XML files. For php, I have tried lots of IDE's. "Zend Studio" IDE is very good. But it's limited and lacks lots of features. Today I use Eclipse for php development for both Windows and Linux.

Moving on to C#

New times sets new standards, and I like my software to look nice. Currently, applications written in C# is often very appealing compared to similar applications written in C++. I've mostly used MFC for C++ end user applications, and today that technology is obsolete. I've moved to wxWidgets for cross-platform GUI programs, but for Windows programs, I believe C# is worth a try. Especially since Microsoft has put a lot of effort into making it fast and easy to create great applications. Visual Studio 2005 is marketed as a RAD (Rapid Application Development) tool. I've read some books to prepare myself for this move.

  • "Applied Microsoft .NET Framework Programming" by Jeffery Richer (great book by a brilliant author!)
  • "Visual C# .NET 2003" by Kevin Hoffman and Lonny Kruger
  • "Pro .NET 2.0 Graphics Programming" by Eric White (Very interesting book by an experienced developer)

In addition to these books that I read more or less from beginning to end, I've also read parts of 4 - 5 other books about the subject. I also attended to a tree-day introduction course to Visual Studio 2005 and Microsoft SQL Server 2005, just before they were released.

 

"Hello World"

My "Hello World" C# application is a project management application that gets its data from a Microsoft SQL Server, and present it much like the gantt diagram in Microsoft Project. A few columns of data and some nice looking graphics to show the resource allocation, time-span and progress. Technically the idea is to make an owner drawn ListView and use the framework for everything but the graphics column. A pretty straight forward approach that should be trivial to do with C# and Visual Studio 2005.

Support for Custom Controls

I cerated a new project, added a standard menubar, toolbar and it looked cool. Then I created a custom control derived from ListView. No problems so far. Except - I found no way to move my custom control into the main form. I searched thousands of books on books24x7 without finding an answer. I tried google groups - and there I learned that what I tried to do was not possible. No one at Microsoft had thought of the possibility that a developer that created a custom control, might wanted to actually use that control in his project! I had two options. I could create the control in a separate project, and add it to the toolbox in Visual Studio 2005. Great. But if I do that - I must remember to delete it and replace it with the one built for release, each time I build a new release-version of my program! And reverse that if I need to change or debug the control. Or - I could do as we did in 1985 - add the control to my form by code. Also - I have two options. I can use the "RAD" environment that's supposed to make things so easy for me, to create two projects, make one depend on the other, and manually change the linkage from the application to the control, each time I switch between debug and release builds. That means changing the linkage to the .dll file. Or - I can drop all help from Visual Studio, and add the control to the application by writing the appropriate C# code myself. That means that Visual Studio 2005 has about the same level of support for Custom Controls that Notepad does!

I'm not impressed. Who is Visual Studio 2005 targeted against? Why in heavens name would someone create an IDE with support for creating custom controls, and then forget to add support for using them? Am I missing something here - or are the developers at Microsoft partially brain dead?

Well - it's really no big deal. I've been writing code for 20 years, and the editor in Visual Studio 2005 has at least nice syntax highlighting and auto-complete. If I have to use it as an native Editor, it's still better than many other editors I've used over the years. I added the lines of code to create my custom list control.

private ReportListView reportListView;
reportListView = new ReportListView ();
reportListView.Dock = DockStyle.Fill;
Controls.Add(this.reportListView);

The project compiled and ran - but where is my list header? After some investigation - it turns out that it's swallowed by the toolbar! How did that happen? As you can see from the code above, I specified Fill. That means that I want .NET to figure out the client-area of the control. I did my share of rectangular math when I handled resizing programs with MFC. Except for the menu-bar, tool-bar and status-bar, there was no controls in the form - so figuring out how to place a ListView should not be that hard - even for partially brain dead people. This is not rocket science.

Well well, I googled and found out that I have to set the "ChildIndex" in order to get this right. How obvious. Any noob would have figured that out right away.

Controls.SetChildIndex(reportListView, 0);

 

Now I got the list-header right - that is - I managed to keep .NET 2.0 from painting over a control that it was supposed to automatically adjust into the available client area of the form.

The first two things I found out about Visual Studio 2005, is that:

 

 

 

 

  • It does not support Custom Controls. That's odd, because even the DialogBlocs IDE for wxWidgets that cost only a few dollars, can handle this without any problem. It can even handle release/debug builds and controls by itself. And that IDE is written more or less by one single developer, and it's not even his primary project!
  • .NET 2.0 cannot handle a simple task like calculating how to place a single control in a form, without help from the developer. That's not RAD. That's friction. Friction is one thing you usually try to avoid in software.

     

    Usability tests

    In the early days of software development, we focused on features, and not really on the the end-user experience. In recent years there have been lots of research on user interfaces, user-interaction and user experience. Today we (the developers) realize that the users have a mental model of how the software works. If we manage to make a user-interface and features that match the mental model for the target-group for the software - the users are happy. They feel that the software is easy to use, meets their requirements and the user experience is positive. If, on the other hand, the software does not meet this mental model, the users gets frustrated and unhappy. It does not matter how brilliant the software developer feels that the software is. If the user is unhappy about it - it basically sucks. In the old days we fixed this by telling the users that they were morons - and that they needed to attend to courses and read big manuals in order to use the software. The software was good. The users were bad. At least until they learned the mental model of the developers view of the program. Today the software industry use lots of resources to make the programs meet the mental model of the target users. This is also the case for Microsoft. Unfortunately - it seems like Microsoft is using noobs exclusively for their usability testing. When you put your hands on new operating systems from Microsoft - you can know this for a fact. You get all these annoying messages about "click the start button to get started" and "the computer might be at risk" when you log on. I would gladly have payed another US$100 for a button "[x] I have used a PC before - please adjust the User Experience to a Professional Level". That would have saved me for a lot of frustration every time I reinstall a machine with XP.

    I have often asked myself if Microsoft did any usability tests (- that's what they call it when they measure if the software meets the mental model of the user) at all with Visual Studio 2003. (At least if any professional C++ developers were participating in the tests). There are simply too many things that does not match my mental model - from silly things like windows that are closed the next time I open a project, to random crashes that make the project loose information (Using the File/Save menu does not really save the project - you have to use File/Save and exit the program in order to save everything)).

    I know of no professional C++ developers that actually like Visual Studio 2003. That means either that Visual Studio 2003 is deliberately designed without the needs of professional C++ developers in mind - or that Microsoft have neglected to let such developers participate in the testing. But after working with C# developers as well - it seems like they have the same experience. Visual Studio 2003 was not build for them either.

    I took it for granted that these things were corrected in Visual Studio 2005. Today we (the software industry) know a lot more about these things than we did just a few years ago. And since I'm using C# - one of the new technologies that Microsoft is working very hard to make developers migrate to - I expected it to be usable for more than point-and-click development. (Point-and-click can be great - Microsoft Access is brilliant for this). You don't need professional developers to do point-and-click development. Noobs can do that. But when things starts to get complicated - when you need something extra - like custom controls - then you leave the point-and-click domain and enter the domain of the software professionals. The more advanced things you want a program to do, the better and more experienced developers you need. I'm very surprised that Microsoft fails to match my mental model on simple things like creating and using custom controls in the same project. That makes me wonder who Visual Studio 2005 really is designed for. Is it really just a point-and-click tool for novice Web developers - like a fellow C++ developer claimed in a Usenet group a few weeks ago? I hope not.

    To be continued...

     

     

  •