Tuesday, October 23, 2007

I am blogging this

Here we are in Montreal. OOPSLA 2007 is on the way.

After two days of workshops tutorials and great weather, we are today in the first official day of the conference. So far, it was OK, but my expectations are high. There are about 1250 people from all over the world, I guess some of them will have some interesting insights and ideas to present. Our presentation is still two days away, but we are mostly ready.

We also took some time to explore Montreal, which was very nice especially in a view of unbelievable 24C heat. I will be attaching a pic or two when I get the time.

Stay tuned :)

Friday, October 5, 2007

Mac and PC: End of the battle

I have got a Mac recently, I actually wanted one for quite some time. Before I got a Mac I was, for a while, a part of the ongoing discussion on Mac vs PC comparison. I was reading posts on the subject, listening to podcasts and marveling the Steve Jobs keynotes. I was getting a lot of how Mac was better in so many ways and so on and so forth. Until I got a Mac of my own and discovered a very important thing about a Mac and a PC. They are exactly the same.

What??? Yes, yes. They are. In every practically important aspect they are exactly the same.

Here is the list of examples that I came up with.

Apple is bragging about Mac OS X not having any viruses. I haven't had a virus on a PC for seven years now. Apple is bragging about the ease of use and how things just work. For me, using Windows XP is just as easy and stable. Design flaws? They both have some. See the window switching on Mac OS X, it's really horrible.

Media? Same thing. Yes, the Mac comes with a remote and turns into some sort of media center, neat indeed. But don't get me started about iTunes or Quick Time, they are incredibly bad. So in the end I use BSPlayer on Windows and VLC on Mac and I use plain old folders to keep my stuff.
Development tools? Well, eclipse runs everywhere. I had hard time finiding a good text editor for both. I settled for UltraEdit for windows long time ago, on Mac I am currently on jEdit which is not that good but it does the job.

The Office suite is almost the same, so are all other productivity tools which for most of the world are online anyway. Yes there may be some amateur editing apps bundled with every Mac but for the heavier stuff you quickly move to the very same Photoshop and more professional video editing software.

Speaking about hardware, sure Macs are pretty, but there are beautiful PCs out there as well. Sony makes some great looking notebooks and for the desktops there are great looking cases coming from Thermaltake and Antec, not to mention modds and customs. Glossy displays have also become a common experience today as well.

That's enough, though there is much more. To sum this all up. Regardless which platform you get, you will require a lot of tinkering before you get it just the way you want it for this period of your life, after which it is a smooth ride until something changes.

For all practical purposes, Mac and PC are exactly the same.

Changes

There are some changes around here so it's about time they got to this blog as well.

First of all, I have changed my workplace. I will not talk about either my previous or my new place of work as of right now, but one thing that has on this blog is that I am no longer developing eclipse plug-ins. For this reason, the topic of this blog will change to more general issues. Usability will, of course, remain one of them, but others will follow. Eclipse will also not be abandoned since I remain a great fan of the platform as well as it's evangelist and supporter.

Second, I have decided to write more often than I did before, therefore expect more smaller and less technical posts. It's not that I have more time on my hands, it's just that I feel the itch. We will see what will happen next.

Third, I am writing this on my new Mac Book. Yes, I have joined the fine cohorts of Apple users, but don't worry, I will not join the Microsoft critiques or Apple fan boys. In fact, I will not write too much about the whole Win / Mac comparison theme, except for the next post in which I will explain my position on these issues. So it will be quiet on that front unless something really exceptional comes along.

Well, this is kinda it. So you have been warned :) Keep on reading.

Thursday, October 4, 2007

OOPSLA 07'

If you want to learn eclipse plug-in development, we are giving a tutorial at OOPSLA 2007 in Montreal. The tutorial is called "Developing plug-ins and applications on eclipse platform", it's number 49, on Thursday afternoon. There are still places available and the registration is almost over so hurry up. Together with Amir Kirsh, we will have a beautiful presentation, comprehensive eighty page long companion and breathtaking demos. We will cover GEF, RCP, SWT and jFace, all this on the new eclipse 3.3.

It will be fun, so you are all welcome.

See ya there.

Tuesday, August 21, 2007

Oh, I just want it to work as, you know, in Explorer

"I mean, is it too much to ask" said my product manager. All she wanted is to be able to rename an element in the tree viewer we have in our application. "Just like in Windows Explorer", she said.

Right.

In Explorer, when you click an element and then click it again, after some time, an in place editor is opened allowing you to rename the file or directory. But if you click fast enough, the system recognizes this as double click and performs the associated operation (i.e. opens a file or enters a directory). We wanted to do the same in our tree control.

At first it looked easy, the Internet is full of examples of how to add an in place editor to the SWT Tree control. However, problems began when we tried to determine when the editor should be activated. It should be when the same element is selected twice in a row, but not it should not happen when the element is double clicked.

Now, I have to admit, I am a little confused since there are two different types of events. There is a Selection event, which can handle both single and double click operations. There is also a MouseDown event, which also can be used for this purpose. In addition it is possible to monitor events that occur in the jFace TreeViewer or the underlying SWT Tree control itself. Very confusing.

First attempts left us with buggy, inconsistent behavior, nowhere near our Explorer ideal. We had problems with activation, the double click still activated the editor. We also had different problems with TRAVERSE_ESCAPE event due to the fact that we did not know how to correctly handle FocusOut. It was really frustrating.

I would like to present a solution which seems to satisfy all our requirements, though I admit it is not a peak of beauty. It does seem to work, however, which in our line of business is a plus.

The solution is based on a single SelectionListener implementation attached directly to the Tree which handles both single and double clicks (through widgetSelected and widgetDefaultSelected methods). In addition we remember the last selected element and whenever a double click is recognized we raise a special flag. The purpose of this flag is to avoid entering the editor in case an already selected element is double clicked.

Each time widgetSelected is called, it updates the last selected element and then waits for about half a second. It then checks whether a double click flag is up, and if it is not, opens the rename editor. After the editor exits, the flag is reset.

I really hope there is a better and shorter solution which provides the same functionality, I did not check Eclipse 3.3 yet, I hope it is there. In any case, if you need this solution add comment with your email and I will send you the source. It will also be available for download from here as a part of the new RadView Reporter. Look for version 10, it should be there in about two weeks. You will be able to find this code in the TemplatesView class.

Sunday, August 12, 2007

Would you trust them?

Several days ago Steve Jobs announced a new line of iMac computers, beautifully designed, thinner than ever, great products for those who care. Not only are they a better value than the old ones, but the 17" model was replaced by the 20" one for the same price. Clearly no one in his own mind would buy an old iMac today, wouldn't he?

Not in the opinion of this, large (by local standards), computer store chain, here in Israel, who keeps advertising and selling old iMacs on their site without a word of warning. I am really interested whether one of those was sold these days. I bet there weren't any, since Apple users are generally perceived as an knowledgeable and updated bunch.

Yet, if this obsolete piece of machinery sits happily there on the site, then what could we say about less celebrated computer related products. Hard drives, cameras, computer monitors? Would it be nice to buy a 22" display just to find out that a better model is already out for the same price. Not keeping the site updated, just teaches the consumer not to trust this store and its site and always double check everything.

Clearly not a reputation you want to have.

Friday, June 29, 2007

Weird behavior

Yesterday I was working on final graphics of our new Eclipse RCP based application (http://www.webload.org/ ). Among the icons, we have asked the designers to prepare an application window icons, which are set in the branding section of product configuration. The designers did a great job, the icon looks excellent.

But when we tried to put it in place, we have discovered that the dialog is only able to accept GIF format, nothing else.


The designers, have supplied the icons in the PNG format, clearly a much better suited for graphical work. I have asked them to convert the icons to GIF, and they said, "OK, which background would you like?". I didn't know. I said, well, I kinda need it transparent, to look good in the different versions of windows and in the Alt + Tab window, is that possible? They said "yes, it is". However, they said, there are no transparency levels, it is all or nothing. So, the icon looks pretty awful, especially when switching between applications.

Clearly I was not satisfied. I pointed at the eclipse icon, which looked great and asked them to make ours in the same way. The said that it could not be done with GIF and offered me a bet if I could find that icon in eclipse installation and show it to them. They sounded confident enough, so instead of taking the bet I have downloaded a small utility that can look into JARs and looked for all images called "eclipse" in the installation directory. I found quite a few GIFs, but none of them was what I was looking for. On the other hand, I found quite a lot PNGs, just like designers have said. I was very glad I did not take that bet but I still had a problem. How would I put PNG into a field that only accepts GIFs. One of the designers suggested that I put it there nonetheless. I was skeptical but decided to do it. It has produced an ugly warning, but, amazingly, it worked. The icon worked exactly as required.

Needless to say I was looking a little stupid, I also felt bad for eclipse, after all - what is that? I did not manage to find a good explanation for this strange behavior so far. Why would this dialog only allow to put GIF images and not PNG images that work much better. I will try to investigate this further and keep you posted but if by any chance you know the answer, or you know an already open bug on the subject please tell me.





























Thursday, June 28, 2007

iDay tribute


This days I am a little confused. What will it be, the long tail or the fat head?

The long tail sounds smart, insightful. One of those, "did you know" things. Fat head sounds simple and powerful, you are the best in the world and you get four times more than the next guy. What are you doing now? Quit it and go be the best in the world.

So which will it be?

Well, both, of course. Be the head and use the tail. Just like Apple does today with iPods (the head) and iTunes (the tail). But though both are smart ways to make money, the head has something that the tail doesn't. Romance.

Now, as I write these lines, there are people sleeping in the street. There are people, sleeping in the streets of New York. People sleeping in the streets, with little tents and blankets. Waiting for iPhone, to arrive three days from now.

It's not a gadget, it's not a product, it's a dream. It's a romantic dream of red eyed high tech workers and amateur tech lovers, consumers and engineers. You see, now that's a product. It can do this, it can do that, it's amazing. It's something worth waiting for, for three days in the street. That's what this is.

It's a dream about doing something right. Right now. Will it work well right from the start, maybe not. But we dream it will.

It's an epic launch. Will it sell? Who cares. Windows 95 launch was a blast. Did it sell? It did. So what. Was it a great product, probably, at the time, I don’t remember. What do I think of it now? It sucks.

So what is it about. It's about hype. And today, hype is global. It's about inspiration. It's about watching the commercial, and wishing there were more like it. More dreams.

It's about lifestyle. It's about what you think about when someone around says "simple", "clean", "white".

It's not about tomorrow. It's about today.

It's about winners. It's about being the best in the world. It's about big fat head.

I choose the head.

Friday, April 20, 2007

Dear computer, please tell me why...

It might sound like a regular customer service rant.

Yesterday my wife and I went to a large supermarket near the house. Among other things we have bought three bottles of juice that had a special price, something like "take three and get 40% discount". I am not a great believer in discounts so naturally, when we approached the cashier, the only thing that really interested me was to make sure we get it.


As expected, once the purchase was complete, we found out that the computer did not give us the discount on the juice. I would be actually surprised if it did since the complexity of these, so called, discounts is just too large to be practical. It would take a supercomputer to track them all. Without going into technicalities let’s just say that Jurassic Park failed for the same reason.

Of course, we asked: “Why?”

Now, cashiers in those kind of places are caught in constant crossfire between bosses and customers. They have to enforce the random policies invented by the store managers and at the same time patiently explain them to the angry customers that argue with it. Of course the woman at the register did not know why the computer missed the discount in this particular case. She did not invent it and she did not program it into the system. What could she do?

It was at this point that the giant usability problem in this whole system became painfully obvious to me and the poor people stuck behind me in the line for whole ten minutes. This system was not designed to answer the question why? The cashier had nothing she could do with all this complex, full-of-colorful-buttons, vertical-shaky-touch-screen piece of junk. It was of no help at all. In fact, she had only two good old fashioned choices. She could either call the manager or get up and go across the floor to the shelf to see with her own eyes what was written on that bloody label.

Well, since it was never about the money, we closed the account as it is, right before the raging mob behind us managed to get hold of their lawyers. Later, I went to the store management and got my couple of dollars worth of discount back by proving them I was right and they were wrong and we went home happy, to sleep off the heavy headache.

Now we get to the point.

The point is that we were wrong. The very small letters on the discount label stated that it was for “some blah blah card holder only” and we didn’t have that specific blah blah card in the first place. So we were not actually supposed to get this discount and the computer was right after all. It just could not explain it to us, the cashier or the store manager. As a result we all have wasted lots of time and nerves because the computer could not answer the question why?

Deeper analysis of the situation shows that it is as simple as one, two, and three.

One. All these discounts, sales, cards, rules and policies are too complex for any man to grasp. They can only be upheld by complex dynamic computer systems like the one we have seen in that store.

Two. People dealing with these systems are tired cashiers with sore finger from touching the screen all day from one end and angry, suspicious customers, tired from constantly checking, arguing and eventually returning products that were not priced as they expected because they failed to read some small letters somewhere or made a mistake in some complex percent calculation on the other.

Three, and the most important. The system is not designed to explain its rules to the user. It can make a decision but it can’t explain why it made it.

Back in time, moment of sale, customer asks a question, the clerk pushes the “Why?” button, screen comes up. “Dear Sir, the discount for juice is for: 1. Card holders only 2. That bought over this amount 3. And wear a black tie. You were rejected for 1. not having a card. Please be more careful next time and have a nice day”. And if the customer does not believe it, it will show the exact scan of the label that appeared on that shelf so that the customer can be sure he talks about the same sale.

How cool would that be.

Have a nice day indeed.

Tuesday, March 13, 2007

Guess What Happened

I will start with an old haiku which seems painfully appropriate for the moment:

Three things are certain:
Death, taxes, and lost data.
Guess which has occurred.

It all happened so quickly. I have created a new project in Eclipse to add some minor library to the prototype application I have been writing for three days. Since my projects sit outside the workspace, I had to uncheck this little checkbox suggesting me to put a new project in default location and type the new location (a directory not far from there) by myself.

For some strange reason, when you uncheck this box, the text field with the directory path becomes empty so despite the fact that the directory I needed was just beside the one that is already written there by default I had to switch to explorer, copy and paste the path manually into the field.

This is where I erred. After pasting the directory, I forgot that this was the path of the directory where all my projects resided, the parent directory - not the directory of the new project I wanted to create. Before I realized that I hit OK, and there it was - my new project created in the projects parent directory instead of a nice little directory of its own.

Well, I suppose these things happen, said I when I realized my mistake, I will just delete that project and create a new one in the correct directory. So I said, and pressed the "delete" button.

But this story is not about me, it's about Eclipse. After I pressed that button, Eclipse inconspicuously asked me whether I wanted to remove the project from the workspace only or delete its contents as well, all that with straight, poker face, calm as a frozen lake. I thought "why would I need to keep contents of an empty, just created, project in the wrong location" so I hit "delete contents" - and that was exactly what Eclipse did.

He deleted the contents of the entire directory, all three meaningless files that were created with the new plugin project and ALL SUBDIRECTORIES WITH ALL MY OTHER PROJECTS as well.

It was almost too easy. BOOM - everything was gone.

I know what you are thinking so NO - I did not have a backup, NO - it was not in a source control and NO - I did not have anyone to blame. Three days of work, were gone. Eclipse does not have any Recycle Bin and I did not have a good recovery software installed, and I only have one logical drive - so if I would install one I would risk accidentally overwriting the very data I was trying to rescue. The irony tends to get thick in situations like these.

It looked hopeless, but I know you are waiting for the happy ending, so here it comes.

Once, in one obscure Eclipse conference, I heard that there is such a thing called "local history" in Eclipse 3.2, and that in that history they save all the files you work on so you can go back and undo some changes that you have done and compare previous versions. Lucky for me, this history is saved in the workspace .metadata directory that was not deleted during the accident. After a few minutes I have found it, a bunch of tiny little files with long meaningless names, just lying there happily, each holding a class full of my precious code.

It only took three hours of scraping around to restore 90 percent of the code I have written, and I filled in the rest - so in almost no time I had all my stuff back in good working condition, even better, as in some cases I found bugs while reviewing the code and looking for the changes.

Now for the moral.

First, do backup, do use source control and don't be an idiot.

Second, be extra careful with what you DELETE with Eclipse. Eclipse has it's own file system underneath, so everything it deletes does not go to the Windows recycle bin, or any other place you can salvage it from. This is just plain barbaric. Even my browser has a trash can, in case I accidentally close a tab I did not yet bookmark.

Third, just for the sake of emergencies. Find, try and buy a good piece of software that restores deleted files and keep it installed on your computer at all times. It might save you some nerves one day or another.

And last, listen carefully in conferences, you never know what might save your day next time :)

Monday, February 19, 2007

One File Is Not Enough

Every once in a while I come to a situation where I need to attach together different types of data. It could be a PDF to which I want to add some notes, or a picture that I want to describe, or a song to which I want to add lyrics. In certain cases I want to bundle together several files, some of which could be pretty complex themselves, such as add the Visio diagram of a database schema to an Access database file.

What I basically need, is to put together several different files while preserving the ability to access each and every one of them individually.

Sure I could zip them, but that would not really solve the problem since I would have to unzip them before I can use them. I could put them in a folder, that would help the situation, but it I would still be able to delete one and leave another and I would have to separately manage their names and so on, definitely not a solution I would prefer.

It seems that in the current state of affairs, there is no way to do this in neither of the existing file systems. Why? Well, I guess there are several reasons.

First let's look at the definition of the file. The way I would describe it, a "file" is a collection of data of the same type. Of course, this is no longer entirely true for modern files which may include different types of data (think about a Word document with embedded picture), but it still works most of the time (you could still call it a document, only with picture). Wikipedia, defines file a little differently (take a look). I liked the phrasing "available to a computer program". It means that a certain file is related to a certain computer program as in - can be open by a certain editor. Another editor, another file. This makes sense and correlates with the everyday experience, indeed, how often did you see files that could be open in two entirely different editors (I don't count similar editors from different vendors and text editors that can open everything).

Which brings us to the second point, the file extension. OK, the names are no longer eight characters short (though I still avoid putting spaces in file names) nor are the extensions limited to three characters but they are still very important and dominant in a way we manipulate files today. In most cases, extension determines the type of editor that will be open (at least by default) to edit the file. This can be changed, of course, but if a .pdf you download turns out to be an ArcView Package Definition File - you will be very mad. After all, extension defines format, and implies content.

And finally, let's take a look at our file systems, ladies and gentlemen. They are, well, old. I use Windows XP which came preinstalled (see: Windows Tax) and I think I have NTFS, but I don't really care, since I dont use it's "advanced" features anyway. For those who were sad when WinFS was dropped from Vista, relax - I am not sure it would improve the situation. It was more about being a database, and having meta data. We are very obsessed with search these days.

We have gone a long way since 1977 (that was a good year), but we still can't treat several different files as one. Sad, and frankly, a little bit strange. Haven't anyone encounter this problem before?

I think, in a way, media guys did. They had this problem of distinguishing between two different types of file content (audio and video) and the file container that will bundle them together. The way they solved it is, in my opinion, far from optimal but it is a good point for the case. They distinguish between a codec, which is used to read and understand specific video or audio data and the file format used to hold them. Each media player in the world supports this scheme, as well as every other tool which needs to access the media files. First it reads the file, just as regular editor, in a way determined by file extension, and then it uses a codec specified in the file to read the audio and video data. This way your media streams always stay together, you can't accidentally copy a video and forget a voice track or vice versa.

Does this solve a problem? Eh. Well, partially, for this specific case, you still can't add anything else to your file - those who ever used subtitles will see what I mean. This solution is not scalable enough, and besides do you know how many video file formats are there?

I believe this is a real problem, a solution of which will present a next big step in file systems, no less than the search and the database stuff. I think that this problem is encountered and solved each time with one compromise or another, mostly as a workaround. I don't know what you think (I will if you comment) but for me: One File Is Not Enough!

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.