Blotter

PyObjC is very, very cool. Even not knowing python, I prefer using it over CamelBones, if only because the out-of-box experience is nicer. But a very compelling reason is that making standalone apps with it is soooo easy. Thus, I present Blotter 0.5, an experimental notepad application. It stores notes in a SQLite back-end DB, and gives you revision history, etc. It’s gonna be buggy, I wouldn’t use it for storing nuclear missile launch codes just yet, but it’s already dogfood, after very little development effort.

Oh, and scuse the nasty icon…

More things I don’t like about Python

I’ve played with python some more, and there are more things I don’t like about it.

For objects, attributes and methods are called with the exact same syntax, the ‘.’ character. So for an object ‘foo’, foo.bar is the attribute (member variable) ‘bar’ of foo, and foo.baz() is a function call on the method ‘baz’ of the foo object. But if a foo object has an attribute ‘bar’ and a method ‘bar’, foo.bar gets the attribute, and foo.bar() explodes, because an attribute isn’t a function. I don’t like that you can hide functions behind attributes.

More object stuff – there’s no abstract ‘call my superclass method’ calling convention. You have to either explicitly call a class method on your superclass (calling it by name, so changing your superclass would be Pain) and passing ‘self’ as the first parameter, or you use the magic ‘super’ method, which requires you to pass your class explicitly, also meaning Pain if you rename things. Hello? self.super? Sigh.

Incidentally, there are plenty of things about python I’m really liking – it’s not all pain. But people don’t blog about things that they like, they blog about things that annoy them. Human nature – deal with it.

things I don’t like about Python

You don’t declare variables in python, you just assign to them. This isn’t as bad as it looks, because you can’t assign as a side-effect, so you can fake declaration by initialising the vars you want. Referencing a variable that hasn’t been initialised is a run time error. This leads to the following annoyance:

for var in (1,2,3):
    pass # don't do anything

print var # prints '3'

which makes sense, and:

for var in (): empty list!
    pass # this won't happen

print var # throws run-time error

GARHHAAH

notes on a blank desktop

Things that have pleased or annoyed me over the last few days. See my last entry for context.

Bad thing: I can’t use Screen Capture. Or whatever the Apple Command-Shift-[34] app is called. It writes files to the desktop by default, and I can’t seem to change this. With a non-writable desktop, I can’t take screen captures, and I’m reluctant to sacrifice the non-writable aspect. I could just let things write to it, and move them quick, but making the the thing ‘no access’ acts as a fail-safe. Screen captures aren’t worth losing that.

Good thing: It’s really, really pretty. I can also use quite cluttered-looking wallpapers that I wouldn’t otherwise be able to use, and they work well. I’ve found that the Mac OS ‘cycle through the pictures in this folder’ background works quite well, too. I never liked it before, because my icons look good in different areas of the screen depending on the wallpaper and where it’s ‘busy’, but with no icons, I can use anything. I feel so arty.

That’s it. On the whole, I’m very comfortable with a blank desktop. It’s changed my working style almost not at all.

Other notes

blech reminded me that Risc OS had a completely blank desktop, and treated it merely as a background and not somewhere you could put files. The linux equivalent, the ROX Desktop, almost does the same thing, you can place aliases to things on the desktop, which spoils it, but then I recall add-ons to Risc OS that let you do that, so I suppose it’s forgivable. Linux weenies are notoriously hard to break of their habits, which I think is a shame. Embrace change!

Comments on my previous entry mentioned that recent versions of Windows are becoming more sparse as it comes to desktops. ‘My Computer’ has vanished, as has ‘Network Neighbourhood’, in XP, and apparently 2003 Server takes things further. Longhorn… well, hah, PDC this weekend, we’ll see about Longhorn.

My problem with Windows in this respect is that just about every program under the sun feels that it needs its icon on your Start Menu and your Desktop. The particularly arrogant ones want a place on your Quick Launch Thingy as well. All time worst app award goes to Winzip, which by default puts itself on the top of your start menu, thus ranking itself with ‘Open Office Document’ in importance. Now, I don’t know about you, but I don’t think I’ve launched winzip as an app once in the last 5 years. I use the context menu, where it belongs. Why do I need it 2 clicks away at all times?

But I’m getting diverted from my point.

Oooh, windows 3 had a good desktop. It was totally un-special. Windows could minimise to it, but this works, because they were still windows, and therefore allowed to be on the desktop. They were just really small windows. Nothing else could touch the desktop. Windows 95 was weird for ages, all these spaces were things you could put files in..

Gnome 2 for a while had a nice option where you could use ~ as a desktop, flying in the face of all those osses that has decided that the desktop was a ‘special’ folder, but that treated it like it was your starting point for everything. I really liked ~ as a desktop, it encouraged you to keep things clean, and your desktop then really was the base of your GUI experience, etc, etc, yadda yadda. Alas, this option died, although I think it’s still buried in what passes for a registry in Gnome. Pity. Linux users again, I guess.

Enough. I’ll stop now. Comments – any other osses / windowing systems with nice desktops?

Update (4 years later!) – I’ve been informed of a hidden Finder option, this works as of 10.5.3:

defaults write com.apple.finder CreateDesktop 0

Prevents the Finder from managing the desktop window. Exactly what I oringinaly wanted – this means there’s still a ~/Desktop, and screenshots go there, but I don’t have any icons on my background. Lovely.

NNW subscriptions

So I wanted to see which of my NNW () subscriptions were dead. And I wanted to get the hang of AppleScript. Right.

set errorlog to ""

tell application "NetNewsWire"
  repeat with check in subscriptions
    set err to error string of check as string
    if length of err > 1 then
      set errorlog to errorlog & “Error for ‘” & ((display name of check) as string) & “’ (” & (RSS URL of check as string) & “): ‘” & ((error string of check) as string) & “’r”
    end if
  end repeat
end tell

tell application “BBEdit”
  make new text window with properties {contents:errorlog}
end tell

Pretty nifty. Course, you have to have BBEdit. But making it use TextEdit shouldn’t be hard.

referrer and agent mixup

The blogging/RSS community has discovered HTTP headers actually have a defined purpose. Amazing. It’s like when they discovered that HTTP actually allows you to see if a page has changed since you last downloaded it and not get the whole thing. That was fun, too.

Ok, that’s a little bit too bitter. But I can name one linux RSS reader that’s done the Right Thing here for months. </smug>

tabbed browsing

Dave Hyatt, the insane fool who is the public face of Safari, has actually asked for comments about the UI of Safari. So naturally every single comment and trackback mentions tabbed browsing. Hell, there’s even a comment saying roughly ‘I’ve never used tabbed browsing, but lots of people clearly like it, so they should put it in’. I consider this another good reason to kill all humans.

My house as a whole isn’t a big fan of tabbed browsing. blech will grouch on about them for hours. hitherto has actually ranted in a public place about them. But given the massive number of pro-tab advocates out there, I find myself needing to stick an oar in and splash as many people as possible as well, just to keep things even. And not only that, but I have the opportunity to trackback to someone who’s invited it. Oh, the excitement.

So. Tabbed browsing. it’s been around a while, I personally first remember it in Opera, but my first serious exposure to it was in Galeon, under Gnome 1. And verily, it was Good. I could put my browser on one virtual desktop, set all links to open in tabs, and then click links merrily from other apps. When I was done, I’d go back to the desktop that held my web browser, and gosh, look, there’s a big heap of links here! Shiny! When I switched to Phoenix (or whatever it’s called nowadays) under Gnome 2, I used in exactly the same way. And it was still good. And faster than galeon, even.

But that’s all missing the point. I was forced to use tabs there because the window-switching system is totally brain-dead under Gnome. I typically have 20+ browser windows open. Hell, I can have 40 if I get distracted. (aside: I loved galeon for this – the crash recovery was second to none. I’m afraid to open that many windows under any other operating system because if the browser dies, I lose them all.)

The problems with window-based browsing:

  • Opening links pops a window to the top of the stack. I hope Alt-Tab works properly, because it’s a pain finding what you were just doing otherwise.
  • If I’m using a taskbar, all the window buttons get tiny. I can’t pick the browser I want. I can’t pick any other app either, for that matter. All the buttons say ‘Docu…’ – really handy, that.
  • If I’m using some sort of window list, all my non-browser windows are hidden in the huuuge list of browsers. Oh, and the 10 windows called ‘Terminal’, that was great too.
  • I’m not even going to describe what the Alt-Tab list looked like. Ok, I am. 40 ‘web’ icons. Brilliant.

I’m now on a different platform. I use a mac. And the mac has per-application switching. So my Command-Tab list is manageable, I can switch between a relatively small number of running apps using the dock. And once I’m using the app, I can have a window list of all the windows belonging to that application. So I know I want a terminal, so I switch to the terminal app, and then I can flick through the terminals I have open until I find the right one. I can switch to the web browser, and easily get a list of open web browser windows. In fact, I can click and hold on the web browser icon, and jump straight to a required web browser with one (long) click. Handy.

Essentially, the task/window switching on the mac isn’t like windows. It’s very different, much more than appears superficially. Under windows, and under linux, tabbed browsing seems to work, giving you the same ‘switch to app, then decide what window I want’ behavior. It’s a different interface on the whole MDI nightmare that windows suffered from for so long. Under linux… hell, linux is a world to itself, as per usual, and I’m not going to judge it. But the mac has a way of dealing with this problem. It’s always had a way of dealing with this problem. People need to stop coming up with other ways to solve it, ways that aren’t as good.

Oh. And an actual feature I would like? It would be nice to be able to click on an RSS feed from a site, and have NetNewsWire subscribe to it. So I need the ability to set programs to be run for specific MIME-types. That would be nice.

trash and file replacement

this morning, blech pointed me at a wonderful daring fireball article about file replacement and the trash and things. Now, most of my comments on this stuff is said better by other people, as usual, but there’s one point that I feel hasn’t been covered.

Application bundles, .pkg files, etc, these are all files from the point of view of the user – I can almost never get the finder to behave as if they’re something else. Even copying them around, the finder displays the copy as if it’s only one file, a win over the way Risc OS did this. (oh, yeah, riscos. It had bundles 10 years ago. whatever, stale rant.) But they’re not, they’re folders. So, instead of files replacing files, folders replacing files, etc, we have to special-case bundles as well. That takes us from 4 possible interactions (file-file, folder-file, folder-folder, file-folder) to 9. Quite a jump.

Personally I’m a fan of the ‘trash the overwritten thing’ approach, and let the user do what they wanted. But on the other hand, I’ve been bitten really quite badly by the ‘running things out the trash’ problem. You can’t run them by double clicking them, because the trash is ‘special’. But you can run them if the dock points at them… Very annoying.