Vincent Gable’s Blog

July 7, 2008

Bug Triage Priorities

Filed under: Programming,Quotes | ,
― Vincent Gable on July 7, 2008

Roughly, my triage order is:
* Data-loss bugs
* Unavoidable crashers
* Functionality-blocking bugs
* Avoidable crashers
* Avoidable bugs
* Misfeatures
* Performance issues
* Feature suggestions
* UI feedback
This is, of course, a rough ordering

Wil Shipley

I totally agree that data-loss / corruption is a higher priority then crashes. You can upgrade|downgrade a crashy program. But once data is gone, it is gone. Protecting users data should be your prime directive. I have always strongly disagreed with any bug triage that put crashes at spot #1.

Rands First Law of Information Management

Filed under: Quotes,Tips,Usability | , , , ,
― Vincent Gable on July 7, 2008

Rands’ First Law of Information Management: “For each new piece of information you track, there is an equally old and useless piece of information you must throw away.”

Rands in repose

So true.

Programatically Excluding Things from Time Machine Backups

Filed under: Cocoa,MacOSX,Objective-C,Programming,UNIX | , ,
― Vincent Gable on July 7, 2008

To exclude files/folders from a Time Machine backup, you can use the C-function CSBackupSetItemExcluded().

As far as I know there isn’t an official way to do this from the command-line or a shell script. As near as I can tell, the safest way to it without using compiled C-code is:

sudo defaults write /Library/Preferences/com.apple.TimeMachine \
SkipPaths -array-add "PATH-ONE" "PATH-TWO"

where "PATH-ONE" "PATH-TWO" are of course paths to items you want to exclude.

Credit to Ellis Jordan Bojar for this solution. (original article) Using defaults instead of tinkering with .plist files directly is really the way to go!

The Cost of Computing

Filed under: Programming,Quotes | , , ,
― Vincent Gable on July 7, 2008

But if you look at the history of the computer business, where we are at now in terms of costs is probably similar to where we were in the 80’s and early to mid 90s. Most of the cost was in manpower. That was the case then and it is the case now.

Hank Williams

See also, Jeff Atwood: Hardware is Cheap, Programmers are Expensive

July 6, 2008

Open Systems Can Be Built With Closed Systems

Filed under: Quotes | , ,
― Vincent Gable on July 6, 2008

Even the worst of our closed platforms, the telephone system, wasn’t closed enough that the internet couldn’t be built on top of it.

— Jack Shedd

Designers Don’t Solve Stuff

Filed under: Design,Programming,Quotes
― Vincent Gable on July 6, 2008

Designers are so low on the list of people capable of solving the problems we face … I don’t care how clever your layouts are, we, as designers, are incapable of solving global hunger, poverty or warming. We are what we have always been. The messenger, not the message.

Developers on the other hand …

Jack Shedd

Absolutely true, if “Designers” continue to limit themselves to style, and not how it works.

July 5, 2008

FourCharCode2NSString

Filed under: MacOSX,Objective-C,Programming,Sample Code,Usability | , , ,
― Vincent Gable on July 5, 2008

As I have written before, the best way to convert a FourCharCode to an NSString* for NSLog()ing is to use the NSFileTypeForHFSTypeCode() function. But for the life of me I can’t remember that name, even though I use it about once a month. It’s too long, and it has too little to do with what I’m using it for.

So I have added the line:
#define FourCharCode2NSString(err) NSFileTypeForHFSTypeCode(err)
To my prefix-files, because I can remember FourCharCode2NSString().

UPDATE: (2008-08-06) There is an even easier way.

-dealloc Warning

Filed under: Bug Bite,Cocoa,MacOSX,Objective-C,Programming |
― Vincent Gable on July 5, 2008

The only time you should call ever call -dealloc in Objective-C is on the last line of your own -dealloc method. This call should be [super dealloc];. The proper way to dispose of an object is to send it a -release message — -dealloc will then be called if appropriate.

Now when I was first learning Cocoa, I sometimes disposed of objects by calling -dealloc directly. This caused all sorts of problems. Truth be known, if I’ve been messing with several object’s -dealloc methods, I’ll sometimes dyslex out and type dealloc when I mean release, just because it’s more fresh in my head. This is very rare, but it has happened once, and will happen again. I’m fallible like that. Murphy’s law tells us that I won’t catch it every time.

So I humbly propose that GCC should warn you if you use -dealloc any way other then calling [super dealloc]; on the last line of your own -dealloc methods.

Missing Frameworks

Filed under: Bug Bite,Cocoa,MacOSX,Objective-C,Programming | , ,
― Vincent Gable on July 5, 2008

I tried using an AMWorkflowView in a project, but when I ran it, I would crash with the following printed to the console:


*** Terminating app due to uncaught exception ‘NSInvalidUnarchiveOperationException’, reason: ‘*** -[NSKeyedUnarchiver decodeObjectForKey:]: cannot decode object of class (AMWorkflowView)’

It turns out I just forgot to include Automator.framework in my project!

It turns out that you also have to include Automator.framework to use any OSAScriptView objects.

I hope this helps someone who googles the error message :-).

July 3, 2008

NP-Complete is Often Easy

Filed under: Design,Programming,Quotes | , , ,
― Vincent Gable on July 3, 2008

There are a lot of problems that are, in theory, incredibly difficult – but because the difficult cases are very rare and rather contrived, they’re actually very easy to solve. Two examples of this that I find particularly interesting are both NP complete. Type checking in Haskell is one of them: in fact, the general type inference in Haskell is worse that NP complete: the type validation is NP-complete; type inference is NP-hard. But on real code, it’s effectively approximately linear. The other one is a logic problem called 3-SAT. I once attended a great talk by a guy named Daniel Jackson, talking about a formal specification language he’d designed called Alloy. Alloy reduces its specification checking to 3-SAT. Dan explained this saying: “The bad news is, analyzing Alloy specifications is 3-SAT, so it’s exponential and NP-complete. But the good news is that analyzing Alloy specifications is 3-SAT, so we can solve it really quickly

Mark Chu-Carroll (aka MarkCC

« Newer PostsOlder Posts »

Powered by WordPress