Thursday, January 25, 2007

Changing shape size in Microsoft Visio

I use Visio quite a lot. I find it really useful for creating all sorts of diagrams for various presentation purposes and for visual thinking in general.

In many cases, editing a diagram involves dropping many different shapes on a sheet and then playing around with them, arranging them into a visually acceptable layout. In this process, it is often required to perform operations on the shape which are relative to other shapes on the same sheet. Some of those operations are supported by Visio, such as shape distribution, grouping and alignment. However, there are some very basic functions which are simply not there, for example - making several selected shapes the same size.

In my opinion, this is a major usability flow. All you want to do is select several shapes and then click something to make them all same width or same height. It is hard to believe that this operation is nowhere to be found, not even in the 2007, which, frankly failed to make the same breakthrough progress as Word or other Office applications in terms of usability improvements.

Untill now, I have found two ways to deal with the problem. If shapes are of the same type, I copy them instead of dropping fresh ones from the stencil and then carefully adjust the font size to fit in all of them. If I have to adjust their size, I carefully select them all and resize them all at once, which is possible for some not too populated diagrams.

Another, more civilized, way of doing this is to open a Size & Position window from the View menu. In this window, you can see the size and position properties of the selected shape. You can then select several shapes, and update their width or height by typing the required value into the box. In order to make those shapes the same as the one you want, you have to select it first so that its properties are shown in the window. Ah, but there is another problem. You can't just hit enter, the edit box recognizes the fact that no change was made and does nothing, you have to retype the value again to have the desired effect. Still it's better than nothing.

I looked all over the net for the solution and I can't get rid of the feeling that I am missing something here. Can it be? Well, maybe they are saving it for the next version :)

Saturday, January 13, 2007

No Excuse

A few days ago, I watched the Steve Jobs keynote introducing the iPhone. As always, it was an impeccable presentation, delivered with the usual quality and style. The iPhone is simply amazing. I have watched the whole event twice and I have enjoyed it like a good movie. It was just awesome.

However, this blog is not about Apple or iPhone, it is about usability. So let us for a moment forget about most of the features iPhone has. Let us forget about the beautiful multi touch display and the wide screen videos. Lets us put aside the full browser and the email, and even widgets. Let's just concentrate on the phone. Just the phone with the most basic stuff. Even without the camera.

Just the phone.

It has occurred to me that there is something strange going on. I mean, Apple, after all is not a cell phone company. Well, of course they have great designers and innovative thinking, but they are not Nokia or Samsung or Motorola.

Yet, amazingly, all of those companies that have the expertise and experience in building phones for nearly two decades have failed to produce something matching the iPhone usability, not even by a large margin.

There is no new technology there. The magnificent scrolling can be done without the multi touch display. Same for the soft keyboard, which has existed for years on all PDAs. The convenient address book with all the details available at a glance as well as the easy interface for putting someone on hold - not to mention the conference call, all of these are not new. A sensor that turns off the display when I hold the phone to my ear is not impossible to imagine either.

The SMS conversation feature, which allows you to see previous messages from the same person in a same thread, is especially painful. After all, instant messaging services were around for a long time now, and technically it is very simple to implement.

It is very strange that such great companies as Nokia and Motorola failed to compete in their own field with an outsider such as Apple even in the most basic of the features of a most basic phone. The usability gap between the iPhone and the existing offering of phones (not just smart phones) is really huge.

They really have no excuse.

Monday, December 25, 2006

The Thirteenth Step

Well, as the title clearly states this blog is "on everything", so today I want to talk a little about software development in general. I have been interested in software development and related topics for quite a while now, and if I would have to name one person who had the most influence on my views and opinions on the subject it would without a shadow of a doubt be Joel Spolsky.

Back in 2000, Joel has introduced a Test to measure how good a software company is using twelve simple criteria. The Test is very useful, in fact, it is successfully used to rank software companies that appear on Joel's job listing site, and provide a great reference for job hunting developers.

One thing, however, bothers me a little, and it's an issue of a "code review".

A "code review" is, naturally, a process in which a portion of written code is read and examined visually by programmer's peers or superiors short time after it is written and usually before it is committed to a next build or release. This is by no means a definition, "code review" has many uses, but it's the phrasing I would use for the purpose of creation of another step in Joel's test.

"Step 13: Do you have a regular code review? "

Maybe it is so trivial that it is implied and maybe not, I think it is worth mentioning explicitly and I will try to explain why.

Although most would agree that "code review" is a useful and effective practice for continuous improvement of code quality, not everyone is actually doing it, to any extent. The reasons, or to be more precise - excuses, ranges from "I am the best programmer they have there, no one can review MY code" to "We would be glad to, but it takes too much time to review all the code we write here". There are also those who say: "We are so agile, we review our code as we write it". Well, if all your code is written in pairs, then I think you are covered.

It does not take a programming genius to review somebody else's (even another genius's) code. First, if the code is that good it is usually readable and well commented, isn't it. And if it is not, well, here is where the questions will start. In any case, a fresh pair of eyes and a new perspective will already allow to discover wide variety of problems.

The issue of the personal abilities of the reviewer is so unimportant that I once thought of creating a tool called "semantic debugger". It would go over a code, compiler style, analyze it a little and ask you random questions like: "What is this variable for?", "When do you enter this function?", "Why is this exception unhandled?" and so on. I think the very fact that a programmer would have to think about answering those questions would by itself uncover a bug or two.

To conclude, the "code review" helps to find bugs, improves coding style consistency, allows less experienced programmers to learn from the more experienced ones and much more. A code review is definitely an important procedure one would want in a good software team, and possibly important enough to make Joel's list.

P.S. To the more theoretically minded, here is a link to an interesting work(.PDF) on how to estimate the number of problems that iterative code review allows to discover.

Thursday, December 21, 2006

Why would you use the Package Explorer to delete a function from your class?

This is a good question, however, since it is allowed, I might as well do it if I please. One might, if so inclined, expand a class in the Package Explorer and the delete a specific function or member or whatever, no problem at all.

There is however a little something one should be aware of. In case this operation is performed on a class that is not currently open in an editor, there will be no going back - no undo will be available!

I have discovered this little glitch while trying to work with the new Common Navigator framework that was added to the 3.2. After reading the excellent tutorials on the subject, I have tried to create a view very similar to the Package Explorer, but for my own file types. In order to show the contents of my file, the view should be aware of my model. In case the file is also being edited in the editor, the Common Navigator view should be updated to reflect the current state of the model and correctly display the model in the tree. In the tutorial example this is done via the file system - each time the file is saved in the editor the navigator view is notified and updated. This is OK, for the example, but it is very inconvenient when working with a real model. Also, this is not a way Package Explorer behaves, a function appears there as soon as it is written even before the file is actually saved.

A friend I have been working with has suggested to put a model in a singleton container, so that it would be accessible from both a view and an editor, and implement some kind of notification mechanism to track the changes. That eliminated the need to reload the file from the Navigator view each time a change was made. Everything looked really good.

Until we started to implement the actions we wanted to perform on our model elements from the Navigator View. There we discovered that it was impossible to undo the operation that was performed on the model when the editor was closed, since that's where our command stack has resided. The only solution we saw was to move the command stack from the editor to the same singleton and thus allow to undo the performed operations from both the editor and the Navigator view.

During our attempts to determine whether this was a wise decision, we asked ourselves how did this work in the Package Explorer? Well, the problem was there too. The undo for operations on the file contents did not work, unless an editor was open, and even then it only worked from the editor and not from the view itself.

Unfortunately, we did not yet have time to go deeper into the code of the Package Explorer to understandit's inner workings. We also did not find a bug on this in the list. So meanwhile, the question remains: where to hold the model and the command stack so that both actions and their undo are available from both the Editor and the Navigator.

If, by any chance you know someone who knows the answer to these questions, please use the comments. That's what they are there for, you know :)

Wednesday, December 20, 2006

The Update Manager and the RCP

Two days ago I needed to create a small demo of updating an RCP application using the Update Manager as a part of the presentation I was doing on Eclipse technology. The point was to show how easy it is to update an existing application by downloading a new feature from the update site.

Since the point of the demo was the update process, I chose a simple plugin example called the "Intro". For a "new feature" that will be added, I wrote a small plugin that contributes a single menu item that would appear after the update is performed. When clicked, it displays a message box that declares that the demo has succeeded. Nothing fancy, but it illustrates the point.

All went well for a while. I used a nice tutorial to create an update site, at this point as a local directory, and published there my new feature. I also manually contributed a "Software Updates" submenu (the "Help" menu already existed in the example) and delegated the operation to the UpdateManager class as demonstrated in this article (.pdf).

And then the problem began. I would not install my feature. Whenever I checked my feature on the update site, and error status would float up declaring that "Resulting configuration does not contain the platform." Mmm, that's strange. Last time I checked the platform was alright...

Not having a clue what that meant, I tried to Google my way out of it, but it did not work out very well. A first search discovered that this specific error is either very rare, or extremely unpopular. In any case I did not find a quick fix, nor after hours of playing with configuration, adding and removing plugins from features and dependencies. It just would not install my feature.

I will make the long story short. I really should have read my tutorials thoroughly. In the RCP tutorial is clearly says that "If your product needs automatic update, then eventually you should convert it to use features." And I didn't even look in this tutorial since I thought I know what I'm doing.

Well, when I converted my RCP to use features instead of plugins the update finally succeeded. As an extra "bonus", since I included platform and RCP features, I have received the "Search" and "Run" menus, as well as another "Software Updates" submenu. Now I had two update menus when I only needed one and two additional menus I did not need at all! I was able to get rid of the search menu by removing the search plugin and I also removed my "update" menu contribution. I have decided to leave the "Run" menu and not waste time on removing it programmatically. I hope it will be easier in 3.3 :)