Monthly Archives: March 2008

One guy’s take on the iPhone user interface

Rather a nice video on this guy’s page showing the iPhone interface, and offering some praise and some critique. As to the user interface overhead added – what he calls “administrative debris” – I completely agree. On desktop GUIs the usual/unquestioned overhead includes titlebars, menubars, and scrollbars – all of which take large meaningless amounts of space on current screens (another case of design that made sense once, but much less so now). On the iPhone the Apple folk generally do a good job of minimizing UI overhead, with a couple exceptions.

At the end though he offers a replacement for the iPhone weather screen, and without a doubt his replacement is a very bad idea. The big/readable day and temperature information from the iPhone version is shrunk to a smaller much less readable size. A large portion of the screen is instead taken up by an animated image apparently from a weather satellite. While undoubtedly cool, the animation carries little useful information. When you are looking for information about future weather, an animated weather map showing the recent past is not especially helpful. All of which means he is using a larger portion of the (small) screen for the least useful information.

Using much-smaller-than-optimal font sizes is a common mistake in web and desktop user interface design. The problem is much more acute on small cell phone screens. Reading small characters may be very difficult in unfavorable light conditions. I can see allowing small fonts when web browsing – as this activity is more likely done while the user is indoors and stationary. For anything that might be used in less favorable conditions – like driving – you want to push up the font sizes and unclutter the screens. You want the user to capture relevant information in a single quick glance.

Which all leaves me in an odd position. This guy is a pretty well-known name (in some design circles). In part he is making a point – to a somewhat large audience – that very much needs to be made. On the other hand, he gets one part very badly wrong.

Oh well. This is pretty much all I can do.

Posted in Software, Web | Leave a comment

Convert at the edges

My time writing software spans from 16-bit DOS and Windows, through 32-bit Windows and Unix. I have written a fair amount of code or ported code to run in different environments. Along the way I picked up practices that proved useful.

One practice I call: “Convert at the edges”.

A data structure may have a pre-specified fixed form when stored to disk, or shipped across the network. You could choose to keep the data in the same fixed form when in-memory. There seemed some logic to this choice – but experience proved otherwise. Long ago, I took this path in one client/server application. Lots of data structures going across network. Lots of data structures going to and from disk. When in-memory you needed accessor functions to read and write fields into the fixed form. The result was a great deal of tedious and not very efficient code.

Ever since I found it much simpler and more effective to perform all conversions at the edges. Data structures stored in-memory are kept in the most natural and efficient form for use by the program. Any conversion needed to more fixed or limited formats is done only when needed. Benefits from using the most-natural in-memory include:

  • More efficient for the programmer to write and read.
  • More efficient to use when the program is run.
  • Less likely to result in program errors.

The last bit was far from immediately obvious … and a bit involved.

The strongly typed Ada programming language was very much a current topic when I was in school. Extensive support for user-specified types, numeric types with exactly defined range, and built-in range checking – this all seemed to make a great deal of sense. Experience both before and since clearly show that typing and conversion is the source of common and serious problems (like Mars probes that slam into the planet). In that context, strong type-checking at compile and run time seems to make sense. Better to exactly define the values and range of each numeric type … or at least so it seemed.

There were counter-indications. On old 16-bit machines the most natural form for an integer was 16-bit word. On current 32-bit machines the most natural form for an integer is a 32-bit word. Compiler-generated code tends to be more efficient for that most natural form than for any of the smaller types. Unsigned integers are the source of occasional program errors. Different compilers on different processors tend to have slightly different rules when unsigned integers are used. Even when running on only one platform, the conversion rules applied by the compiler in expressions are an occasional surprise. For the most part, the additional range offered by unsigned integers is not worth the increase in program errors.

Taken together – in C/C++ using “int” for all integers is more efficient and less error prone. When the disk or network formats require a smaller form, “convert at the edges”. In practice I found it much easier to write portable, efficient code with fewer errors by stripping most of the very-specific numeric types (UINT8, UINT16, UINT32 and the like), using generic “int” through the bulk of the code, and carefully checked type (and range) conversion going from memory to disk or network.

What bought this to mind was a peek into the OpenOffice developers world. The question was what limits Calc (the OpenOffice spreadsheet application) placed on the number of rows in a spreadsheet. The answer lead past this page:

sc: Increasing the row limit above 32000 rows

Position accessing methods There are a lot of class ScDocument methods (see inc/document.hxx and source/data/documen*.cxx accessing a cell position by MethodName( USHORT nCol, USHORT nRow, USHORT nTab ); where at least the nRow parameter will have to be changed to long, but it should be evaluated if all methods taking separated col/row/tab parameters couldn’t be changed to take one ScAddress (see below) parameter instead. Similar, the class ScTable methods (see inc/table.hxx and source/core/data/table*.cxx) MethodName( USHORT nCol, USHORT nRow ); and the class ScColumn methods (see inc/column.hxx and source/core/data/column*.cxx) MethodName( USHORT nRow ); and the class ScAttrArray methods (see inc/attarray.hxx and source/core/data/attarray.cxx) MethodName( USHORT nRow ); row parameters have to be changed, also all MethodName( …, USHORT nStartRow, USHORT nEndRow, … ); of all of those classes. Search( USHORT nRow, short& nIndex ); of ScColumn and ScAttrArray and similar are special in a way that the short& nIndex reference is used to return a position within an array where the position may at most be the number of rows used. This of course has to be changed as well.

My first inclination on reading the above is to want to strip out all the overly-specific numeric types. Doubtless that would make me completely unacceptable to the OO developer community. At the same time this specific example helps prove my general point. The wide use of very-specific numeric types means that a change to raise (say) the number of rows in a spreadsheet involves massive changes to the source code.

In fact, I would argue that at a design level this usage is flat wrong:

MethodName( USHORT nCol, USHORT nRow );

The row and column numbers in a spreadsheet are exactly that – numbers. At this level in the design there is no reason to use anything more specific than an “int”. Certainly the in-memory representation of a spreadsheet might be limited to a smaller range. Certainly the on-disk format chosen might be limited to a smaller range. But … either could change. A different algorithm or structure used for in-memory storage could raise the limit. A different on-disk format could raise the limit. Oddly enough the simpler declaration is much more useful:

MethodName( int nCol, int nRow );

First, the compilers tend to generate slightly more efficient code. Second, changes that raise limits for the in-memory or on-disk formats will not require changes to this declaration. Third, the range limit implied makes sense for the machine. On a 32-bit machine “int” limits you to addressing 2 billion rows and columns. Even with sparse storage you just are not going to be able to have 2 billion of anything on a machine with (at most) 4GB of memory. On a 64-bit machine you could use bigger memory to support bigger limits – without changing the code – as long as you were not over-specific in your declarations.

I started out using specific/exact types. After years of practice and varied experience, what I eventually found more effective is simple use of the machine’s “natural” types combined with careful and exact checks “at the edges”. The result is easier to write code with fewer errors that is both portable and efficient.

Posted in Software | Leave a comment

Not cool enough

As my kids could easily tell you, I am just not cool enough.

What appeared on Facebook the last time I logged in:

Got a Tattoo in January.
Age 45. What’s poker online spielen texaswww poker gamegratis poker ohne anmeldungpoker spielen ohne registrierungpoker bonus code no depositpoker game deutschpoker texas holdem kartenpoker kostenlos online spielendraw poker onlineparty poker onlineparty poker deposit bonuspoker game sharewareparty poker softwareonline poker anfängeronline poker browserpoker spiel für pctexas holdem kostenlos downloadentexas holdem poker online gratisrichtig poker spielenpoker gratis downloadpoker gratis downloadenpoker spiel zum downloadenparadise poker bonus codeparty poker codetexas holdem poker game downloadpoker spielen gegen computerpoker online spielen ohne anmeldentexas holdem tipsholdem poker turnierpoker live turniertexas holdem pc gametexas holdem online kostenlosomaha poker regelnomaha high low pokerall in holdem pokerhollywood poker bonuspoker bonusestexas holdem kostenlosonline gewinn spieletexas holdem checkpoker pc spiel downloadpoker gratis ohne anmeldenvc poker bonustexas holdem poker spielgratis poker im internetvc poker bonus codegeld gewinnengerman pokerpoker gratis online spielenomaha high life without experiences? Connect with singles who are over 40. Join Lavalife Prime today for free.

Nope. Sorry. No interest in tattoos – no matter who thinks they are now cool.

You have a SuperPoke invitation.
S*** F*** sent an invitation using SuperPoke!:

S*** F*** thinks you should check out SuperPoke!. Why just poke when you can pinch, hug, tickle, pwn or even throw sheep (among other things)?

After a bit of playing around, I removed all the Facebook applications that were less than useful. Not feeling a need to “throw sheep”.

You have a Best Friend request.
S*** F*** sent a request using Best Friend Contest:

I just nominated you as the best friend on Facebook! Join now and don’t let me down :(

Somehow I doubt a bit of software of dubious origin on Facebook is going to make us “best friends”.

As with pretty much all the “social networking” sites, I do not find “Facebook” especially engaging. Oh well.

Posted in General, Personal | Leave a comment

A pleasant surprise

Last week I had an intermittent problem with my Internet connection. Rather more trouble than usual, in that the internet connection would degrade, become unusable, and then start working again – with no discernible pattern. Cox (the cable company) sent out a guy, who re-did all the coax cable connectors, and then replaced the cable modem. The next day the connection failed again – and this time the entire neighborhood was out. Cox sent a guy out to work on the big box at the end of the street. He was there for hours. Afterword the connection worked … until the next day. Again Cox sent out a guy to work on the box at the end of the street, who again was there for hours. Seems the last visit solved the problem.

This was pretty much the worst problem I have had with Cox Cable. I did end up calling the Cox Support phone number several times. My initial guess (based on the symptoms) – that the problem was outside my house – was right. Kind’a wish they could take better advantage of a well-educated guess. On the other hand, intermittent problems can be hard to track down, and my opinion of the service from Cox Cable is still very high.

Along the way – a bit of a pleasant surprise. When the Cox tech finished working at my house, as a check he wanted to run a speed test, so I visited the Speakeasy – Speed Test and got surprisingly fast results:

Last Result:
Download Speed: 31134 kbps (3891.8 KB/sec transfer rate)
Upload Speed: 489 kbps (61.1 KB/sec transfer rate)

Since my Cox service is (officially?) 7mbps download, and 512kbps upload, the above is not bad at all. I have seen a couple large downloads peak at a bit over a megabyte/second (off sun.com), so …. not bad at all.

Posted in Personal | Leave a comment