Lately, I’ve been teaching myself iPhone programming. I got myself the book “Beginning iPhone Development” and have been going through it chapter by chapter. I must say, there are some depressing aspects of this book. There’s just a general obvious feeling of rushedness. For one, the indentation is all inconsistent. Sometimes they put braces on new lines, sometimes they don’t, and the differences are for no reason. Other times, they leave unimplemented methods around that just call the superclass methods. Or that just do nothing. (Yeah, I’m whining, but I’m just pretending.) In one place, the text was inconsistent with the code and just plain wrong. But other than those problems, the book is fine. It’s a little out of date — there’s a new version of the book out by now, anyway.
This is my first serious foray into Objective-C. I’ve always viewed it as an ugly, bastard language. And rightfully so. It’s ugly, and it’s bastardly. It’s a lot of fun, too. For example, I’m manually managing memory (and enjoying it). I think the Objective-C style of manual memory management is generally good for the software you design. It forces people to avoid reference cycles, which is good software design in general anyway. Ad-hoc parent pointers and such are (if you ask me) a bad thing. C++ encourages this kind of design too, but sort of in a dickish way.
(Update: I now change my opinion on ad-hoc parent pointers. It’s easy for a parent to pass a closure to help parameterize a child. Is this such a bad thing? I’d say that direct parent pointers could be a sign of bad design, but indirect ones, through closures or other abstractions, are often not.)
Also, since Objective-C is so ugly, I don’t find myself worrying about making absurdly perfect, airtight, mathematically beautiful software design. Specifically, it has no generics system. This lets you relax and enjoy the dynamic language, and to do more thinking with your brain, rather than the type system. The nice thing about ugly software is that even if it’s ugly and impure, you can still code your way through the problem. When you try to make software too prim and proper, you can’t just code your way out of the jam — you’ve got to rewrite all these types you’re using and rethread the information through the program. I think the greatest improvement that’s waiting to be unleashed upon purely functional programming is the ability to make programs a bit more editable without having to rethread a whole bunch of stuff. But let’s save that for another post.
I also need to decide what to do with this blog. I suppose I’ll have a policy of making a new post at 5:00 AM Pacific Time. Really, I’m making it the night before, of course. Let’s hope I don’t get the time zones mixed up.
Also, I’ve decided that permalinks will consist only of /p/the-post-title/. And I’ve decided that category links will consist of /c/category-name/. And tag links will consist of /t/tag-name/. Or something like that.