inessential by Brent Simmons

April 2002

SBook5

I checked out SBook5 last night. It’s Simson Garfinkel’s old NeXT app updated for OS X.

Though I’ve only spent an hour or so with it, I immediately found two very cool features.

The searching is fast and smart—and it updates with each keypress. Which is fun to watch, but it also means you may need to type only the first few letters of a word in order to find the record or records you want.

Perhaps even cooler is the brains behind the editor. It knows when you’re typing a phone number versus an address. It can tell the difference between a company name and a person name.

Besides being cool features, they’re inspiring to me as a developer. SBook5 is a reminder that computers can be pretty smart.

The Power Of Three: XML, XSLT and PHP

PHP Beginner: “This is an introduction and presentation into the value and use of PHP and XML in a single environment. This is a series of articles that take a journey into the basics of XML and the fundamentals of PHP.”

April 2002 Developer Tools Posted

The April 2002 Developer Tools, now available to ADC online members, includes a new version of Project Builder with a flexible user interface. This long-time CodeWarrior user set it to the “Many Windows” configuration, and so far I’m pleased.

Huevos 1.0b2


Huevos 1.0b2 released.

The source code can also be downloaded. (It’s an open source Cocoa app.)

Changes include improved preferences editing and remembering your last search engine and search string between runs of the app.

Frontier/Radio plugin now open source

I just made the source code to the Frontier/Radio contextual menu plugin for OS X available via the open source BSD license. You can download it from the product page.

Frontier Contextual Menu Plugin now Open Source

The source code to the Frontier/Radio contextual menu plugin for OS X is now available. It’s released under the BSD license.

Squirrel mating season

It’s definitely squirrel mating season in my back yard. I’m going to have to find out the gestation period of squirrels.

I’m also going to have to find out if boy squirrels can get pregnant. Holy cow, it’s nuts out there.

Web Services Framework

I read on a mailing list today that Apple’s planning to release a Web Services framework as part of the Core Foundation framework. It would be accessible to both Cocoa and Carbon apps, of course.

There’s a WWDC session named Client Web Services Frameworks that appears to confirm this.

From the description: “An explanation of important concepts and terminology is followed by an in-depth exploration of Apple’s WebServices.framework, a client-side framework for accessing Web Services from Mac OS X. Tools and techniques for writing Web Services glue and adding it to Cocoa, Carbon and AppleScript applications are demonstrated.”

Chimera 0.26 released

This latest release supports the OS home page and proxy settings. And you can import bookmarks.

OS X Beta Testers Sought

I’m looking for a few beta testers for an app that will reach 1.0b1 sometime today or tomorrow. An OS X app, a Cocoa app, that’s designed to be fun. Not the world’s next killer app, to be sure—but I think (I hope) you’ll enjoy it.

If you’re interested and are willing to respect confidentiality, send me email (to brent at ranchero dot com) letting me know.

Apple’s new eMac sports 17-inch screen

MacMegasite: “Aiming to boost its fortunes in the education market, Apple on Monday plans to unveil the eMac, an all-in-one computer similar to the original iMac, but built around a 17-inch flat-screen monitor.”

Optimal String Concatenation in UserTalk

Seth Dillingham: “UserTalk scripts often need to build large strings from smaller strings, such as assembling a web page or an RSS feed in Conversant, Manila, or even the old static site engine. In order to optimize this process as much as possible, there are two things the scripter needs to remember: ‘Avoid copying large strings whenever possible,’ and ‘trigger the secret in-place append.’”

Redirection using PHP

PHP Beginner: “Have you ever seen a webpage that, instead of loading you the information you expect, takes you ‘magically’ elsewhere? I’m sure you have. Well, that ‘magic’ is actually called redirection. Similar to those implemented in HTML but server-side, and in our case using (what else?) PHP. This article will briefly teach you its implementation.”

The Missing Cocoa Docs

Brock Brandenberg: “The Missing Cocoa Docs are intended to help you implement certain basic functionality and to teach you how to implement some of the more unique technologies like OS X’s superb glyph and type handling. For example, they won’t teach using NSViews because there are plenty of tutorials on NSViews and drawRect: methods, but there is little on NSLayoutManagers and accessing font outlines, a technique that is needed for more sophisticated graphics apps.”

Including Files (with PHP)

PHP Beginner: “Another thing we can do is ‘include’ files. This comes in handy when you have the same information on all your pages, over and over again. For example, connecting to the same database, printing the same HTML at the top or bottom of a page. It can be used for headers or footers, or for simplifying things.”

If you’ve been thinking about learning PHP, check out the PHP Beginner site. I wish it had been around when I was learning PHP.

Building Cocoa Applications: A Step-by-Step Guide

A new Cocoa book is on the way from O’Reilly. It’s by Michael Mahoney and Simson Garfinkel.

GoLive Gets Interesting

O’Reilly: “GoLive 6 features a robust workgroup server; support for common scripting languages such as ASP, JSP, and PHP; drag-and-drop WML authoring for mobile devices; MySQL database for dynamic sites; Apache Web server; and a tighter JavaScript code generator for rollovers and other dynamic goodies.”

Perhaps it’s time for another look at GoLive. Last time I used it, it was GoLive CyberStudio. Adobe hadn’t yet acquired it. I liked it then, but not enough to pay for upgrades.

For nostalgia reasons only: here’s a review I wrote of GoLive in 1997.

OmniOutliner 2.0b3

The latest release adds a Scripts menu for running AppleScript scripts. Scripts can also be added to the toolbar.

Pantomime 1.0.3

Ludovic Marcotte: “Pantomime provides a set of Objective-C classes that model a mail system. Pantomime can be seen as a JavaMail 1.2 clone written in Objective-C.”

What Sessions Are

PHP Beginner: “A session is a mechanism to maintain a user’s state across some period of time. The word ‘session’ can be interpreted as the determinate usage time of your site relative to a single visitor.”

AppleScript S.O.S.

MacScripter.net: “Despite AppleScript's ‘English-like’ syntax, I like many of you have questions about the hows and whys almost every day. I would like to outline here some of the resources I have found most helpful.”

The ABCs of CMS - Part II

evolt.org: “In this installment we will cover logging in a user, presenting them with appropriate navigation according to their user level, and setting up an article table.”

XP on the PowerPC

O’Reilly: “Mac OS X is young and still maturing. Windows XP is a dominating OS that doesn’t play nice with the other kids. Wouldn’t it be great to have the best of both?”

Where’s Jini?

Developer.com: “Three years ago, Jini was touted as the sure path to ubiquitous computing. What happened to it?”

I had completely forgotten about Jini. I remember thinking that Jini was doomed and silly from the start, though I can’t remember why.

Coffee, Conversation and ZUBB

DevShed: “I thought that I would have to design and build this forum myself from scratch—until a search on Google and Zope.org turned up a very neat little Zope Product named ZUBB, which offered all the features I needed.”

Dad

People sometimes ask me, they say, “Brent, why are you such a weird guy? What makes you such an odd duck?”

And I don’t know how to answer.

What can I point to? What’s the cause? Beats me.

Except that recently I’ve wondered if it might be my Dad’s fault.

Dad with big glasses

MetaWeblog API

I’ve been putting off doing an XML-RPC interface for my weblog software. The Blogger API wouldn’t work for me because each post has three elements: title, url, and text.

For some reason I had it in my head that the MetaWeblog API was designed to work with the Blogger API. I thought I’d have to support two APIs, and I wouldn’t be able to get, set, and edit posts with one call each.

I’m so pleased to discover that I was wrong. The MetaWeblog API does exactly what I need (a bit more, actually, but not too much more). My thanks go to Dave Winer and UserLand for a nice spec.

A Cocoa weblog editor should be a piece of cake. Most of the code would be just getting and setting Apple event parameters. (I’d use the Apple Event Manager to send the XML-RPC requests.) The rest is pretty much just layout, building a form in Interface Builder.

I won’t get around to it today or tomorrow or the next day. Maybe someone else will beat me to it, which would be just fine by me.

What with Bill Gates on the witness stand...

What with Bill Gates on the witness stand I figured it’s a good time to point to my bong hits with Bill Gates story from earlier this year. Just in case you missed it.

Interview with Vincent Flanders of Web Pages That Suck

WebmasterBase: “Well, I’m a marketing weasel and I hate everything that's boring—personally, I think being boring is the only sin—so I come up with an attention-grabbing name instead of an appropriate one. Not to rag on Jakob (Nielsen) because Jakob really is a cool guy, but I would imagine Jakob would have called it ‘Web Pages That Have Mistakes.’”

Apache Web-Serving for Mac OS X, Part 6

O’Reilly: “There are a decent number of modules shipped with Apache, so thus begins a two-part article concerning them, as well as the mojo-jojo that can be yours. We’ll keep these articles updated as time goes on, so they’ll always be a handy reference, whether you’re using Apache on OS X, Linux, or Windows.”

AppleWorks outliner

Maybe I’m the last person to discover it—there’s an outliner in AppleWorks. And it’s not bad. Imagine my surprise. Here’s a screen shot.

Cocoa FoundationCollectionsPalette v1.0.0

Kritter: “This palette adds Foundation Collections support to Apple’s IB; it enhances NSDictionary and NSArray, adding an attributes inspector, a connections inspector and a size inspector to both.”

Dirty monkey fingers

Sometimes you pet the kitty, and then he licks right where you pet him, and you’re sure he’s thinking: ugh, dirty monkey fingers.

My first icon

Open in Browser iconSo, to follow up on my earlier post about learning how to do icons—here’s my first icon that’s not completely embarrassing. It’s a toolbar icon that’s supposed to mean Open in Browser.

Icon Building Tutorials

One has to have confidence when learning a new thing. I’ve never considered myself a skilled graphics artist. I can design simple websites with okay results—but note for instance that there are no graphics used in this site’s template.

As a desktop app developer I need to be able to make new icons. Not just app icons, but document icons and toolbar icons. Normally I would say: oh shit, I’m screwed, this is way too far out of my areas of expertise. I’m a text guy.

But I’ve decided to have confidence instead.

Theory: if you’ve reasonably intelligent and imaginative, you can learn to do just about anything pretty well as long as you have confidence.

So I found this cool set of tutorials at Iconfactory to get me started doing icons.

Who knows? Maybe I’ll end up not just okay at doing icons, maybe I’ll end up really damn good at icons. That would be a surprise for this text guy.

Chimera Web browser in the works

MacCentral: “The Chimera project focuses on delivering a best-of-breed browser for Mac OS X, according to Steve Dagley of the project. It’s a ‘blending of the brains/brawn of the core technologies from Mozilla, such as the Gecko layout engine, with the beauty of Quartz text rendering in a Cocoa app,’ he said.”

Make BBEdit into an AppleScript Development Environment

Studio Log: “I began to try and create a script that would take the text of a BBEdit window, compile it in AppleScript and save it to a compiled script. Little did I know that it would lead to a much more interesting exercise.”

Working With Bitmap Images; Document-Based Application Redux

O’Reilly: Programming with Cocoa: “Today’s column is the first in a series that takes a closer look at a number of previously-neglected aspects of Cocoa’s document-based application feature set. The application we will build as a platform for exploring these concepts is an image viewer (and later an editor) application called ImageApp.”

The ABCs of CMS

evolt.org: “Custom content management can be approached like building an igloo, one piece at a time. Start with a solid foundation and you can build up from there.”

Your First XSLT Page

evolt.org: “Putting it simply, XSL is a kind of find-and-replace script, which is executed as the XML parser walks through the document tree.”

Browser detectors

PHP Beginner: “The first step for most of us is to detect the browser the user is using and show the appropriate page to him or her. The popular way is to use lengthy javascript, but, it is just not fair to do when we can rely on our best friend PHP.”

A-Rod

Less than three weeks into the season, the Rangers, who play in SafeCo field tonight, are already 8 1/2 games behind the first-place Mariners.

Do we still need to boo A-Rod? Or would pity be more appropriate?

Me, I like the idea of seeing 40,000 fans playing tiny, imaginary pity violins every time A-Rod steps to the plate.

Maybe it should be imaginary pity violin give-away night at SafeCo. Everybody who comes to the game gets a free, pocket-sized string instrument. (While supplies last.)

Or... on the other hand, maybe we should just boo him. 252 million dollars buys a lot of boos.

CamelBones 0.2

CamelBones is a high-level Objective-C framework that wraps around the Perl embedding API.

Bong hits

I don’t normally pay attention to what search terms I “own” on the various search engines—but I was amused to discover via my referers page that my site is #1 on Teoma for bong hits.

Road Sweep

How sweep it is!

SOAP

Since I work for myself, I can choose to be impolitic when I want to. So I’m going to say something I’m not supposed to say: I don’t like SOAP.

(Simple Object Access Protocol, that is. I like the other kind of soap.)

I like web services. And I’m glad when they’re implemented and adopted, even when they’re SOAP interfaces. Something is better than nothing. The trend is good.

But while XML-RPC is a thing of beauty, SOAP should have been named COAP—Convoluted Object Access Protocol.

It just plain offends me as a spec. People claim there are things SOAP can do that XML-RPC can’t do, but I remain unconvinced.

It’s a shame that for a spec to be adopted in the “enterprise” it requires a level of absurd obfuscation. It’s almost like a continuing employment clause for programmers. If you choose the psychotic spec, well, they can’t fire you, because they’ll need you too much.

It’s like IT managers choosing Windows because it’s harder to maintain, so they know their jobs won’t go away.

All that said, I’ll still use SOAP when necessary, of course.

RezBrowser

Peter Chapman’s RezBrowser tool runs in Radio UserLand and allows one to browse the contents of resource forks.

Goin’ to school

Tonight I’m going to school for the first time in over ten years. I’m taking a continuing education class, elementary French, at the local community college.

I’m pretty excited about it. I’ve learned some French before, but my biggest problem is hearing it. Language is one of those things where to learn it well you need to learn with other people.

On a philosophic note: you’ve no doubt heard it said many times that the purpose of school is to teach you how to think, and that facts, the actual content of learning, are much less important.

I dispute that. Yes, school teaches you how to think—but the content of learning is hugely important.

Otherwise it’s like learning French without learning any vocabulary. You can’t communicate—you can’t even really think—without vocabulary.

Cocoa Browser v0.3

It’s a browser for the Cocoa API reference docs. I use it and recommend it. It’s open source, so it’s also useful as sample code.

Apple releases Mac OS X 10.1.4

MacCentral: “Changes to Mac OS X 10.1.4 include improved network, security and additional disc recording device support, according to Apple.”

Scripts for Big Cat Plug-in

This pleases me immensely—Studio Log published a collection of scripts for my Big Cat contextual menu plugin.

If anyone else publishes scripts for Big Cat—and I hope you do—please let me know about it. I’d like to make a page that links to all the places where you can get Big Cat scripts.

RFC: Cocoa RSS API

I’m working on a Cocoa class for reading RSS feeds. My intent is to make it open source (BSD license) so it’s available to other Cocoa developers. I chose the BSD license so people doing commercial apps can use it too.

Here’s what the API looks like. I’m seeking comments on its 1) Cocoa-ness and 2) usefulness.

initWithData (NSData) takes data and returns an RSS object.

initWithUrl (NSURL) takes a URL, gets it from the Web, then returns an RSS object. (It calls initWithData.)

lastReadDate returns an NSDate specifying when the RSS object was created (presumably when the data was last read).

version returns an NSString specifying the RSS version.

Here are the two interesting ones—the above are fairly non-controversial, I think.

headerItems returns an NSDictionary of all the stuff in the header: the title of the channel, webMaster, and so on.

itemsArray returns an NSArray of all the news items. Each item in the array is an NSDictionary containing the elements of the item: link, description, title, and so on.

I thought about normalizing headerItems and the items in itemsArray. What I mean is I thought about always having a ‘webMaster’ key in the headerItems dictionary even when that item didn’t appear in the RSS feed. (For instance.)

But I decided not to do any normalizing for these reasons:

1. Which spec would I normalize to? All of them? What about optional items? What about new specs that appear later on? In this case, normalization is what we doctors call a quagmire.

2. Normalization would remove potentially important information. You wouldn’t be able to tell the difference between an empty element and an element that wasn’t specified.

The downside is that anyone using an RSS object will have to check for existence. For instance, if you want to get the ‘link’ element of a news item, you can’t assume that the element exists. If it didn’t exist in the RSS feed, it won’t exist in the dictionary for that news item. But I think that’s okay.

The IDEs of Mac

O’Reilly on Java IDEs for OS X: “In this article, I’ll look at JBuilder, IDEA, and a few other IDEs. There’s a bigger issue here that I’ll address in the Pre-ramble: look at the number of choices you have for developing in Java on Mac OS X.”

The Number Game

DevShed: “One of the simplest things you can add to your Web portal is an online poll, one designed to elicit responses and reactions from members to the hot-buttons issues of the day.” This tutorial shows how using Zope and MySQL.

Writing Self-Documenting PHP Code

DevShed: “Most developers can’t stand the thought of documenting their own code, finding it both tedious and a waste of their time and skills (although, strangely enough, they’re the first to complain about the ‘lack of documentation’ when it comes to someone else’s code.)”

Learning

I love learning, the actual experience of it, how you start with some new terminology and concepts, and some of it comes easily and other parts you just don’t get, but you keep at it, and you start to get things more and more, and soon you start to think in that subject, and further learning uncovers further depths.

There’s always a beauty to discover, however imperfectly realized.

F-Script 1.2 released

It’s an open source “lightweight object-oriented scripting layer specifically designed for Mac OS X object system (i.e. Cocoa). F-Script provides scripting and interactive access to Cocoa frameworks and custom Objective-C objects.”

Attack of the Killer Bugs!

WebmasterBase: “Perl is without doubt a very complicated programming language. The tiniest typo can yield an error message that scientists could spend years decoding. However, what most people don’t know is that Perl offers facilities that are specifically designed to eliminate the most common errors.”

Handling Users and Passwords with PHP

PHP Beginner: “Any of these applications are going to require one or more users along with their passwords. If you write it properly, handling users and passwords can be built once and used over and over again in every application you build.”

Making XML-RPC calls from Cocoa or Carbon apps

I was wondering: how do you make XML-RPC calls from Cocoa apps?

It turns out that the Apple Event Manager supports XML-RPC. That’s so cool. Any developer already familiar with constructing Apple events will find doing XML-RPC calls a piece of cake.

And of course the example used in the above page is the canonical betty.userland.com example, a nice touch which warmed my heart.

From Woeful to Wow! - 6 Steps to a Stunning Site

WebmasterBase: “Absolutely never let a user (or users) have the power to defame your site. Forms of this include guest books with undeletable entries, and other similar not-so-bright ideas. One of my favorites is the ‘Vote Me off the Net’ polls, where users may rate a site from, say, 1-5.”

Variables Inside Cocoa Objects

O’Reilly posts a second article about supporting AppleScript in Cocoa apps. “Today we’re looking at accessing the instance variables inside your Cocoa objects, and in the process we’re going to explore part of the Core Text Suite that we get for free with Cocoa.”

Losers

The Tigers still haven’t won a game. They’re 0-8. Ouch. Wow. Holy cow.

Presence Management

Woof! Woof!

As presence becomes more of a big thing, the old adage that “on the Internet no one knows you’re a dog” becomes less and less true.

They’ll not only know you’re a dog, but they’ll know when you go for walks, what kind of dog food you eat, who your dog-friends are, and so on.

There are two kinds of presence: real-time and not-real-time.

Not-real-time presence includes things like email and weblogs. This type of presence allows for an editable, leisurely, thoughtful projection of self.

Real-time presence is things like chat. You are really there, right now. An amazing technical and social achievement.

My issue with real-time presence is that it feels like surveillance. Voluntary and self-imposed (for now)—but how long before it’s more-or-less mandatory?

Even if it’s never abused by employers and governments and so on, even if it works just the way it’s supposed to work, it still means that you know what I’m doing.

I don’t want my computer to be your eyes upon me.

I want to use my computer to see out. And whatever I choose to reveal of myself I want to be able to think about first.

I don’t want you to know that I’m actually a dog.

Squirrels in love

When I walked outside today to get the mail I surprised a group of squirrels engaged in a menage à trois. No kidding.

I am now deeply confused about the animal kingdom.

Guidance sought

I want to provide an RSS feed of my Macintosh news aggregator. Since it’s an aggregator it gets news from other RSS feeds. It is very important that those other sources get credited.

So what I did was use RSS 0.92, since it has a <source> element where I can put the name and URL of the source.

Here’s the feed itself.

Another option would have been to stuff information about the source into each description. That didn’t feel quite right to me. But then I suspect that not every RSS reader knows about the <source> element. Hmmmm.

What do you think?

P.S. This is another searchable RSS feed. Here for example are the search results for applescript. It seems to me that RSS is a natural format for search results, and I wonder why Google didn’t adopt it.

Displaying HTML in Cocoa

Yesterday I figured out how to display HTML in Cocoa. Given an NSTextView it’s just a half-dozen lines of code. Very easy.

The problem is that there are still some bugs. For instance, when I put my links in a table, the links stopped working. Nuts.

Coffee

I love that first sip of coffee in the morning, that hot bite, the taste of potential energy.

Getting Paid on the Internet

Webmonkey: “Several companies have developed payment systems that you can use either on a one-off basis, as a subscriber, or as a full-fledged credit merchant. Each service has its advantages and hang-ups, which is just what we’ll be looking at as we examine a variety of services in the pages that follow.”

Python 2.2.1 released

It’s a bug-fix release.

DiveIntoOSX

Mark Pilgrim: “This site is a repository of information for Mac OS X and OS X Server administrators. It is not a discussion forum, a bulletin board, or a place for topical Mac news. It is a wiki, free to all and freely editable by all.”

AppleScript for Google API

Steve Zellers posted AppleScript scripts for calling Google’s new SOAP API.

Fixing Your Site with the Right Doctype

A List Apart: “You’ve written valid XHTML and CSS. You’ve used the W3C standard Document Object Model (DOM) to manipulate dynamic page elements. Yet, in browsers designed to support these very standards, your site is failing. A faulty DOCTYPE is likely to blame.”

CURLHandle 1.5 released

It’s a public domain Cocoa wrapper around cURL. This latest version is built as a stand-alone framework.

Earth People

You won’t find Earth people quite the easy mark that you imagined!

Flattened fifth

I ordered a harmonica and a book on how to play it the other day. I love the dirty, tense sound of the flattened fifth. The secret knowledge of everything that’s nasty and fierce is suspended in that sound.

Cold wars and cold cold wars

Theory: there are two types of cold wars on the Internet: cold wars where an intense PR battle is fought and cold cold wars where the entities do not acknowledge each other at all.

(A hot war on the Internet is where one or both entities do nasty stuff like denial-of-service attacks or selling a product at a loss in order to harm the competition.)

So one of my hobbies is cold cold war detection. Take any two entities that don’t acknowledge each other. Is there a cold cold war going on? If so, is it mutual or one-sided?

The trick is, any two entities may be quite reasonably indifferent to each other, and thus no war at all is going on. So it’s hard to be certain (unless you have inside information).

Searchable history

I’m interested in the intersection of the web and desktop apps. One app I’d like to see is a search engine for pages that I’ve visited. I often want to go back to something but can’t remember where it was but I can remember what it was about. A Google search would turn up too many hits. But if I could search just pages I’ve visited then I could find it.

The easy part is dumping the source of a page into MySQL or whatever and running a search page. The hard part is knowing when a new page has been loaded in the browser.

I can think of at least two ways to do the hard part, but I don’t like either way. (Proxy server or app that polls the browser.)

Years ago it worked with Netscape to tell it to please notify me when a new page has been loaded. I wonder if this still works, and which browsers it works with. This would be the best solution. Perhaps I’ll try it. (Or perhaps I’ll work on the dozen other things at the top of my to-do list.)

GNUstep

The GNUstep project is interesting, essentially a cross-platform Cocoa. I like the possibility of being able to port my Cocoa apps to Linux (or maybe even Windows).

This tutorial should seem familiar to Cocoa programmers.

Zope and MySQL

DevShed: “I’m going to show you how to hook your Zope server up to a MySQL database, and write DTML code that allows you to retrieve and manipulate MySQL table records using standard SQL commands.”

OmniObjectMeter 2.0 public beta

Omni Group: “OmniObjectMeter is a Mac OS X application that makes it easy for Cocoa and Unix developers to find and fix memory leaks, excessive memory operations, and prematurely deallocated objects. The end product is faster and more robust applications.”

How I get started on a new app

I’ve been working on small-ish apps lately. Web apps and Cocoa apps. Here’s how I get started on a new app.

1. Define precisely what it does. I may or may not write it down—the goal is the feature list should be so small that I can keep it in my head without even trying. Also, the app should be describable in one sentence, even if that one sentence doesn’t cover all the features.

2. Sketch out the user interface. I use actual pen and paper. I may make several sketches until it’s right. A few days may pass between sketches as it gels in the back of my mind. The final sketch has labels and arrows so there’s no question of what does what.

3. Layout the interface in Interface Builder (if a desktop app) or with BBEdit and a web browser (if a web app). There may be iteration here, and I may have to go back to step 2.

4. Write a list of milestones. They should be simple, very fine-grained. The first milestone is usually just a do-nothing app that builds and displays the interface. The second milestone will do some small thing with hard-coded data. I’ll usually write down the first five or so milestones. I do not do a milestone list that takes me to the final product. Why not? Because I know to expect the unexpected. So what I do is add to the milestone list as I go along. I won’t know what milestone 10 is until I do milestone 5, for example.

I do fine-grained milestones because otherwise I get discouraged. I like crossing items off lists, and the more often I get to do that, the happier a developer I am.

I also use pen and paper for lists instead of a computer so I don’t have to switch out of my development environment to look at my list.

5. Now vee may perhaps to begin... In other words, get to milestone 1 and keep going.

I don’t necessarily advocate this process, by the way, I’m just describing how I personally get started on a new app. Note that I’m not working on a team or doing apps to someone else’s specs, both of which would require different processes.

New feeds added to the Mac News aggregator

Yesterday I added a bunch of feeds to the Mac News aggregator. Up to 15 feeds now.

I confess: I’m a news junkie.

Cocoa reminds me of Frontier

In some ways Cocoa reminds me of Frontier in that there’s (usually) an easy way to do something and then lots of hard ways to do something.

The problem is that the easy way is not always obvious. The other problem is that I forget the rule that says, “If you’re standing on your head to do something, look for the easy way.”

So I was looking all over for how to set up an NSSplitView—a split window, like that used by most email apps. I couldn’t find anything. There’s no NSSplitView in Interface Builder’s widget pallete.

Then finally I noticed that I could do it via the “Make Subviews of” submenu of the Layout menu. It was so easy. And of course it just plain works.

Simple Stored Procedure Emulation with PHP/mySQL

Brent Ashley: “My ‘third time, automate’ rule came in handy again recently. I’m doing all sorts of PHP/mySQL work and I found myself hacking together the same SQL queries over and over with just some different filter or sort order. Being used to stored procedures, I was missing the easier syntax.”

Scalability’s New Meaning

evolt.org: “The funny thing was that many developers were finding that their applications were able to support greater demand than expected. So much more than expected, that managers were becoming less worried about the scalability of their applications and more worried about the scalability of their development teams. What caused this apparent change in attitude? A law that has governed the computer industry since its inception caused this change.”

Error Handling in PHP (Part 2)

DevShed: “In this concluding section, I will demonstrate how you can piggyback your code on top of PHP’s core engine by triggering your own errors and writing custom handlers to deal with them. I will also show you a simpler method of logging errors, and will (as usual) put the theory to the test with a couple of real-world examples. Much mayhem ahead...”

DocServer2man

Emmanuel Décarie’s new tool converts Frontier DocServer pages to man pages.

Tip for Huevos Users

Tip for Huevos users: you can search recent Macintosh news by adding a new search engine called Mac News with this URL:

http://ranchero.com/macnews/index.php?q=%@

PHP-HTML Templates: A New Working Relationship

PHPBuilder.com: “The phrase ‘HTML-embedded scripting language’ reminds me of my days in ‘dot-coms’ (‘dot-gones’ for now). I was involved in the development of corporate portal sites. My working counterparts were mainly webpage and graphic designers with little or no programming knowledge.”

Hot Java Revives Mac Programming

eWeek: “After years of being infamously unfriendly to casual programmers, the Macintosh has suddenly become the machine of choice for out-of-the-box programmability—with tools that not only generate great-looking Macintosh applications but that also generate them in Java so you can take them anywhere.”

Chimera 0.2

I downloaded and tried out Chimera 0.2, the latest build of the Mozilla-based Web browser with a Cocoa UI and Unix back-end. They write: “The plan is to produce only a browser (no other apps!), and to keep the UI as simple and as clean as possible.”

So far so good. No one claims it’s ready for daily use yet, but if they continue on this path, there’s a good chance it will eventually be my browser of choice—probably alot of people’s browser of choice.

Aesthetics of Application Design

I’ve been working on an aesthetics of application design. I don’t claim that it’s complete or the only valid theory. Here are my thoughts in progress.

Abundance

This is an age of software abundance. Sure, there may be apps that don’t exist that you wish you had—but there are far more apps available today than ever before.

This includes Web apps, a giant category which didn’t even exist a few years ago.

A few things follow from this observation:

1. People are asked to learn more user interfaces than ever before. Learning user interfaces is difficult and takes too much time.

2. If you the software developer don’t do something, some other software developer will. And that’s okay: that’s a good thing. It means the richness of the computer world doesn’t rely all on you: we can’t help but collaborate.

3. There is an abundance not just of software but of people using software, and each person has different needs, wants, and feature requests.

I conclude several things:

1. The simpler the user interface the better. A UI should be instantly learnable and usable, or as close to that as possible given the problem being solved.

In other words, the more apps there are, the more aggressively one should simpify your UIs. Anything else is just not fair to the people who use them.

2. Small apps that do one thing very well are better than monolithic apps that do lots of things unevenly.

Here’s what I mean. Say you have ten features you could implement. You could make a giant app that has all of those features. But any one person will only use three of those features. The problem is, for each person it’s a different three.

So an alternative approach is to do several smaller apps. Each one has a far simpler UI than the big app would have. Each one does one or a couple things very well.

Then users can pick and choose. They’ll choose which apps they want to use based on which features they want or need.

3. Apps should talk to each other.

This means using common, standard data formats, supporting Web services, Apple events, COM, pipes, and so on. Not that every app should support all these things: they should support whatever makes sense for that app.

It’s a key point, though. A computing universe of small apps would be just chaos and noise unless the apps can talk to each other and exchange data.

4. Scripting is important.

This goes to the above: a user should be able to do unexpected but important things with scripting. There’s a special place in the computing world for scripting systems: they’re the glue that ties everything together. Scripts are the energy that moves the bits.

5. Core apps should be extendable via plugins.

Apps such as BBEdit, Photoshop, Apache, and Radio UserLand—apps that implement core services of some kind—should be open platforms. There are plenty of cases where, instead of implementing another app, what a developer really wants to do is integrate his or her app into one of these platforms. That’s completely appropriate.

And note that BBEdit, Photoshop, Apache, and Radio all do have a plugin architecture, and this explains part of their popularity.

Two examples

I recently released two apps. One, Huevos, is a small and simple desktop app for OS X. The other is a Web app, a Macintosh news aggregator.

In both cases the user interface is as simple as I could make it. Huevos has one main window: choose a search engine from a popup menu, type in your search terms, then click a button to run the search. It would be hard not to understand it right off the bat.

I’ve had a number of people write me with feature requests, things I could add to Huevos. Several people have asked about adding a local find, something like a GUI wrapper for grep that would allow one to search your local hard drive.

And I think that’s a great idea—but if I do it, it will be another app. It won’t be Huevos. Because as soon as I add that feature to Huevos its UI would no longer be simple and instantly graspable.

My Macintosh news aggregator is also as simple as I could make it. I could have added a bunch of prefs so that members could customize their view by choosing how many items to display, what RSS feeds to show, and so on. I could have added a bunch of options to the search engine.

But I chose not to. Why? Because I want you to feel like you understand it, understand the entire thing, right away.

Because I respect you, I also want you to be able to decide right away if the app will meet your needs or not. If not, there are plenty of other aggregators, and probably one of those will work for you. I don’t want you to waste your time with a lengthy decision process regarding an app you understand only partly.

Anyway...

I’m still thinking about all this. Comments are, of course, welcome.

A Quick and Dirty Blog using Zope

evolt.org: “At its simplest, then, each news item is an Object containing content and meta-content—information about the content. What we want to do is have each news object as self-contained as possible so that we can build pages and indices just by calling simple methods on that object—and that will be our entire system.”

Queue Suite Updated

Macrobyte Resources: “The Queue Suite is a queue processing daemon for Frontier and Radio. A queue daemon processes items one at a time, in the order in which they are received. This is also known as a First In First Out Processing System. The Queue Suite is used in Conversant, the AttSearchEngine, RCSearch, and various other tools and software produced by Macrobyte.”

Macintosh News Aggregator

My weekend project was a Macintosh news aggregator. It shows the latest news; it’s also searchable.

PHPBeginner.com

I didn’t know about PHPBeginner.com until today. Looks pretty good.

Tips for Building Web Database Applications with PHP and MySQL

O’Reilly: “PHP’s popularity stems from its power and flexibility: it is easy to include PHP scripts in HTML documents; it has a powerful performance-oriented library for accessing MySQL; and it shares syntax with other popular programming languages.”

JavaScript Weblog Editor Demo

Just for jazz, and because I think it’s cool, I put up a demo of the weblog editor I use for this site and for ranchero.com.

It doesn’t actually let you change anything in the database, but otherwise it works.

It uses JavaScript to do a couple things I think are neat.

One is the Preview button. When you click it, it shows you a preview of the post you’re working on, formatted as it will appear on the home page. No round trip to the server required.

Another is the expanding/collapsing chevrons. I use those so I can glance at the titles to find the post I want to edit. Then I click the chevron to expand it.

When a post is expanded, then there are Delete and Edit links. If I click Edit, then the editing field at the top of the page is filled in—again, via JavaScript. No round trip to the server.

Anyway, you’re free to view source of course and lift any of the JavaScript code.

There’s also a search field, so I can search previous posts and edit or delete any. (It’s not a JavaScript thing; I’m just pointing it out.)

One thing you can’t see: when I submit a new post, the CMS pings Weblogs.com, and I see the text returned from Weblogs.com right there in the page. It’s a friendly little confirmation that the ping worked. Of course, sometimes Weblogs.com reminds it would be a good idea to take a break...

Note: the JavaScript code may not work in your browser. It works in mine.

Ranchero: new Spring colors

In celebration of Spring I changed ranchero.com’s color scheme from a dull brown to a bright green. I had been going for a desert look, sort of a southwest thing, but it was kind of drab.

Bug Tracking Thoughts

Here’s what I’m thinking about today: a Web-based bug tracking system that’s easy to use and easy to set up. The systems I’ve seen are too complicated. I want something simple that has just what’s needed to do the job and no more.

It may be that such a thing exists and I just don’t know about it, of course.

The ideal system (for me) is implemented with PHP and MySQL, since that’s what I have access to. It’s template-based. It’s membership architecture is open so that it can be extended to be used with an existing membership system on an existing site.

Most importantly its interface should be attractive and easy. The idea is that people who use my software should want to report bugs and make feature requests via the system. I figure most people just want to report bugs pretty much the same way they do in email—just type something and click a button to send it. A big intimidating form is not cool.

As an admin I have to want to use it. I don’t want to spend a bunch of time classifying bugs; I want it to maintain itself. For me it should be much like a discussion group: I just want to reply to bug reports.

However, there should be some minimum attributes. Which product, for instance, is important. Type of bug is important. I might like to be able to set priorities. (Maybe. That might be too much.)

It would have to be searchable, of course. And a desktop client (which communicates via XML-RPC, naturally) would be nice.

Huevos

Resource Inspector Idea

Here’s an OS X app that would be useful to me as a developer: a resource inspector. Given that I can’t run ResEdit (since removing Classic from my machines), I still sometimes have a need to look at resources. I don’t need to edit them necessarily, but I need to see them.

So this app would provide an outline view, or perhaps a browser view, of the resources in a file and show me their values. The top level would be resource types; the second level would be ids; the third level would be values.

I don’t think I’m going to write this app. (I already have plenty of other things to do.) But I’d sure be glad if someone wrote it.

Six Common Enterprise Programming Mistakes

O’Reilly: “I remember my first few years of programming when I knew that I was going to always innovate, always create, never copy, and never need any help. Of course, I later found out that most of my clever ‘innovations’ were poor solutions to well-understood problems, many with established ‘best-case’ solutions. It’s absurd to be so egotistical as to refuse to accept help when it’s offered.”

Embedding Tomcat into Java Applications

O’Reilly: “In this article, we’ll extend our Tomcat discussions to the application level by creating a Java application that manages an embedded version of the Tomcat JSP/servlet container.”

Netcraft March 2002 Survey Released

evolt.org: “The latest Netcraft Web Server Survey, for March 2002, has been released with somewhat inconclusive results. Their survey of over 38 million sites shows Microsoft’s IIS stealing ground directly from Apache to pull 10% closer.”

Using PHP with Java

DevShed: “You can do a lot of very interesting things with PHP. And one of the more interesting ones includes hooking PHP up to Java and accessing Java classes in a PHP script.”

PapaScott’s Rolling Referers Page

PapaScott used my article to set up a rolling referers page. Cool. That means it can work with Moveable Type weblogs.

Butterflies

I’m watching for the first butterfly of Spring. It’s a beautiful sunny day today, and I keep looking out the window, hoping to see something, even a cabbage white, go flitting by. Where are you, little friends?

Better Templates for iPhoto’s BetterHTMLExport

O’Reilly: “BetterHTMLExport, at version 1.3 at time of writing, provides significant improvements over the built-in HTMLExport filter, including the option for you to create your own templates.”

Transport Layer Security for Frontier and Radio Updated

Macrobyte Resources: “This product provides scripts for accessing secure websites and services from Frontier and Radio, and for serving secure websites (from the same).”

NibLocalizer 0.1 beta

NibLocalizer 0.1 beta is a free tool for localizing strings in nib files.

Objective-C Wrappers for SQLLite

Blackhole Media released SQLDatabase, “a set of Objective-C classes that wrap around the SQLite library, an embeddable SQL database engine which reads and writes directly to and from database files on disk. This is very handy for developers who need some sort of flexible database solution. The SQLite library is public domain.”

URL-encoding in Cocoa

I was going ape looking for a URL-encoding method in Cocoa. To my surprise it appears to lack one.

So this post is here for the search engines. Cocoa developers: you can call CFURLCreateStringByAddingPercentEscapes in the CoreFoundation framework to URL-encode a string. It takes (and returns) CFStringRefs, which are apparently interchangeable with NSStrings.

The World Wide Barking of Dogs

I always thought it was funny, the dog communications network. I’m walking along the sidewalk in my neighborhood and a dog starts barking at me. In sympathy another dog starts barking, which sets another dog to barking. Somebody in a house nearby gets a call from a friend in Chicago. Then dogs in Chicago start barking (since, with their great ears, they can hear the barking through the phone). The barking spreads all over the world in a flash. Then I cross the street to a block with no dogs. The barking all stops.

Writing

My fledgling writing career is starting to take shape. I just turned in an article I had been assigned, and I pitched an article idea to another magazine (an idea that wouldn’t have been appropriate for the first magazine).

This is fun! I can’t believe people get paid for this.

Of course I’m still learning about the business side of being a writer. I’ve got a little spreadsheet that shows the status of articles and ideas, for example.

Got tips? I’d love to hear from experienced folks on, well, pretty much everything, whether it’s about writing itself or the business side.

OS X Icons

What are people using to create icons for OS X?

Internet Version Checking

Cocoa Dev Central: “One of the simpler ways in which you can provide functionality to your users by embracing ‘The Internet’ is by allowing users to check for new releases of your software from directly within the application. How’s it done?”

OSAShell Scripting Component

The point behind the OSAShell Scripting Component is to provide developers a basis for writing new OSA components for OS X.

It’s open source (BSD license).

On Using Multiple NIB Files

Bill Bumgarner: “The key—as usual—is to remember that there is no magic when developing Cocoa applications.”

Happy Opening Day!

Happy Opening Day!