Tom Insam

programming languages

Programming languages have grammar. There are languages like perl, where the grammar is composed almost entirely of random '$' and '%' symbols scattered throughout the code. And there's languages like AppleScript, where the grammar is practically english, making it much nicer to read than perl. Hah, perl is often called a 'write-only language', it's so incomprehensible.

But I loathe Applescript, and I think perl is luuurvely. And it's for this exact rule. I can use computers. I'm a geek. And I'm prepared to learn a new grammar. That's fine, and it's a specialist grammar, and programming is like that, I've learnt a heap of these things. But english-like programming languages are confusing. I can speak english. I know how it works. In english, you can rearrange words and have the sentence still make sense. Try doing that in Applescript. Grammars that look like english, but aren't actually english, annoy the hell out of me.


I'm a mac user. I have a blog. Union law therefore requires me to mention Konfabulator. It lets you put 'widgets' on your desktop - little image / XML / javascript components that do stuff like calendars and clocks and cuteness.

It's all too unbearable for words. I used it for almost 4 hours before it drove me crazy. I have tools that do all this stuff. The default widgets are just not compelling. The one thing that would make it bearable would be if I (a) the widgets were on a layer behind the desktop icons, and not fully-fledged windows, so they don't keep popping to the foreground on top of my other windows, and (b) if I could lock the layout so I can't click on them and they won't take the focus. But then they just become 'further for macos'. Which would be a good thing, actually.

Oh, and the widgets aren't configurable. Hell, resizable would do, I really need a frikking battery meter taking up half my visible screen area. And yeah, all the default colour choices are fine, I don't need to change the colod of the stock ticker (stock ticker? Why do these things always have a stock ticker?) so it's not INCREDIBLY UGLY. Sigh.

2lmc weigh in

I've bitched before, but only in a general sense, about the GPL licenses in installers. Specifically, I should not be required to agree to the GPL to install a piece of software. Personally, I feel that once I have a piece of software, I shouldn't have to agree to anything to install it, but that's a different story.

The GPL is explicit about the fact that you can do anything with the software once you have it, because it doesn't cover use. It covers distribution, so if I don't give the .dmg to anyone else, I don't need to agree to the GPL.

I also want to mention this fantastic groklaw article here, about the GPL, because it's great.

fast computers

there aren't any fast computers. Some computers are faster than other computers, but owning a faster computer merely lets you run a more advanced operating system and suite of software, and slows down the actual speed of the computer till it's the same as always. There's always the thought 'I could run, say, Windows 3 on this machine and it would fly', and you could, but there's a reason no-one uses Windows 3 any more, and it's Trumpet winsock (oh, the memories).

every new version of windows (I'm using windows as an example for the moment, but don't get hung up on it, we can and will apply this to other things) has features the last one didn't. I could be mostly happy with windows 2000, say. But Windows XP does this really nifty thing when you put a blank CDs in, it'll open an explorer window and you can drag files into it and burn them to CD, so you don't have to mess with awful 3rd party crap. Or when you plug a digital camera in it'll do the right thing, and again you don't have to mess with nasty 3rd party camera drivers. (yeah, yeah, stifling innovation, waffle waffle waffle. Have you ever used the obscenity Canon try to foist off on you as an interface?)

So on a decent machine with a CD burner that will take it, I'll install Windows XP. And so the more powerful machine will be slowed down by the overhead of trying to look like a huge boiled sweet. I'll live with this, because I get other benefits. But it's annoying.

It's not just Windows. Gnome 2, say, is slower than Gnome 1. But it's much nicer. Mac OS X is a bit slower than Mac OS 9 (a bit slower. Just a little bit). I have a mac laptop now that's 3 times the speed of the last laptop I had. It's about the same speed to use. Certain things have changed - I can scroll web pages now and not have to worry about redraw speed, which is nice, but the slowness has moved into other things. App-switching can be sluggish sometimes. Performing certain functions in apps can be slow. But it's so nice, and I'm sure not running linux on this thing, not after the pure slickness that is OS X, it would be unbearable. So my machine is the same speed as the last one.

(Anyone saying I need more memory is missing the point. There's >300 megs in here, linux would fly... I know MacOS wants memory, that's my point)

Web browser features

blech and I have been talking recently about things that web browsers really should do. We both get annoyed when browsers won't save the state of opened windows (pith helps here for our web browser of choice, but that's not the point. It should be app-level - Galeon was superb in this respect.), but there's other, smaller, things that browsers could do to help people.

For a start, they need to understand the concept of a 'dirty' (changed/unsaved state) window, and prompt the user if they try to close it, in the same way that you can't just close a changed document. Changing data in a form makes a window dirty. A page that's the result of a POST request is dirty. In short, if I'm looking at state that can't be retrieved from a bookmark of the current page, the window is dirty.

Form field contents should be remembered completely. Safari is very good about this already, and does some clever tricks somewhere to figure out which forms expect, say, my email address, and fill it in automatically. IE does this too, and it's a good start. But I'd prefer every form I ever fill in to have it's state remembered by the browser. I want to bookmark a page with filled-in forms, and have them stored in the bookmark. And I want to hit 'back' and have the forms still filled in with whatever I left in them. The number of times I've put something long and complicated into a webmail client, hit 'send', seen a timeout error, and lost what I was writing forever... I have the habit of putting the contents of big Textareas into the clipboard before hitting the submit button. This isn't the habit of a man with working technology.

2lmc , as always, have an opinion on this, which is what sparked this ramble off.

The Finder Toolbar

The Mac OS X Finder has an interesting toolbar. blech will happily rant about it for hours, and I agree with him, toolbars do not belong on Finder windows. Or at least, not in the icon view Finder windows, and neither of us like the Browse view at all. But that's missing the point. I'm convinced the toolbar on Finder windows is a vestigal shelf, although I can't find anything on the web that backs this up, and I've never used NeXTStep, where the shelf was originally seen. You can drag things onto it from finder windows, and they'll stay there and you can run / open them by clicking on them.

The way it fails in this is that you can't drag files off the toolbar into another folder and move the original - dragging things off removes them from the toolbar. Arguably better from a least-surprise point of view, but it removes one of the nicest things about the shelf, it's use as a scratch area. Oooh, thought, this is exactly how the right hand side of the dock behaves, except you can't drag apps onto the right hand side of the dock.

Oh, and there aren't any tooltips, so if you have 'icons only' toolbars, you can't tell where things point. That's annoying.

There was a throw-away comment by Dan Hill in an article on Elite about the desktop metaphor and the workarounds we have to use to make it work. Now, I don't think exposé is a work-around. I think it's the most sophisticated window-management system I've ever used, it's lovely. But it does hilight something that's need nagging at me for a while. The Desktop.

Now, essentially, the desktop metaphor is broken. It's not a desktop at all. It's far too small, for a start, I've heard it described as the airplane seat metaphor. But the most important distinction is what's underneath all your bits of paper. Suppose you have a real desk. Pick up all the things on it and look underneath them. What do you see? You've got a completely blank desk. Ok, now hide all your windows and things from your computer 'desktop'. Got a blank desk? No? Didn't think so.

Eventually, everyone needs a hack in their windowing system so that they can get at the desktop. Windows has 'Minimize All', or in extreme cases, 'Show desktop' (there's a difference between these two. Try explaining the difference to a non-geek). For me, Windows always seems neatest with all windows either maximized or minimized. The fact that the only graphical way of getting at your hard disk is the 'My Computer' icon on the desktop means that you need to be able to get at it easily. Mac OS X 10.2 and before never had a really good solution to get at the desktop. There are various third party hacks but the only decent way I ever used was to Command-Option-Click on the desktop, or Command-Option-H with the Finder focussed. This hides everything except Finder windows. Of course, if there are Finder windows blocking your desktop, you're stuffed. Ah, well.

Exposé solves this - one button and all your windows get out the way. Yay! Finally they've solved a problem Windows solved 5 years ago. (Or whenever, I don't care).

I'm tired of working round this. I can shuffle through all of my windows with Command-Tab, but I can't get to the desktop without moving all the windows out the way? This is an annoying special case, and I don't like it.

New philosophy. Nothing will go on the desktop. Nothing at all. I won't display drives on it, I won't save files on it. I'm going to change it's permissions so that I can't write to it. My default download folder will be a folder in my home directory. We'll see how long I last before I go insane.

Update - I follow this up here

blech has been on at me recently to finish my half of our evil 'Wire and string' project - it's a cunning, cunning plan which we really should put more effort into. Anyway, here's a heap of self-congratulation that I'm done, and he should get off his butt and implement the other half.

Essentially, the problem is as follows: We have a computer in the lounge that can play music, hooked into the network and the stereo system. But there's a complete lack of decent software to control the thing. We searched and searched, and all the interfaces we could find sucked.

Now, the best music control interface we know of is iTunes. We want iTunes to control what is being played on the lounge machine. But it's not a mac. Hence the goal - have iTunes on a mac locally, pick up what song is selected/playing, and send that to the lounge computer, which will then play it through the amp. blech took the iTunes half (the Wire), I got the server half (the string).

Now, there are no non-awful MP3 playing interfaces for perl. None. Almost everything that I could get to compile at all (and didn't need non-free libraries you can't download any more) wrapped either mpg123 (now that's a pretty web page) or xmms. The mpg123 wrappers seemed to be the best bet, and for the most part they work, but there are... issues. I didn't get proper events for songs ending or stopping, it was quite easy to wedge the thing to the point where you couldn't control it any more, etc, etc. | believe these are limitations of the command line mpg123 interface, and I can work round them, but I don't want to have to patch the source code just to get a working system, and it makes distributing things a complete pain. I also need the server to be absolutely robust, it's no good having to SSH in every 5 mins to fix the server - the whole point is to avoid having to think about it.

Wrapping xmms isn't much of an improvement. It's got a much nicer interface to control it, but, of course, it's controlling xmms, which is a seperate app that needs to be running, and it needs to be running on a machine with an X server. Hard, given this is a headless server.

But, in the end, that's what I used. I was saved by Xvfb - I can run an X server on the machine without having to worry about graphics cards, and launching xmms from the cgi is possible, so it will run as the right user and everything. After a lot of messing with annoying permissions, I have a CGI that will make noise.

The other problem is that the Mac only knows where the music is on the machine locally. Rather than having the iTunes end convert the local path into something the server knows about, I take anything that might possibly be a path to some music, and trim things off the left of it till the right hand side matches something in the 'locate' database. Disadvantages - you need an up-to-date locate database. Advantages - you can pass just about anything that is music, and the server will have a shot at playing it. In practice it works really quite well.

So, yeah, code . w00t.