13 May 2007

Bad Programming


The self-checkout kiosk at the local supermarket blocked, waiting for employee input instead of giving me errors. Why? Bad programming.

Planet keeps brining up my old posts if I modify them (typically to correct errors). Why? Yup. Bad programming.

Bad programming doesn't necessarily mean bugs and buffer overflows. It also means bad predictions about program flow. If a narrow sequence of events is all code can accommodate without some easy and automatic method to attempt recovery and/or to bring things back on track, its badly programmed.

Programmers aren't mind readers, but they need to consider the "what ifs". When a program behaves in a manner that is just plain stupid, its probably badly designed!


harda said...

I would like to point out, on planet's behalf, that it is following the Atom specification. In particular, RFC 4287, section 4.2.15 says: ``The "atom:updated" element is a Date construct indicating the most recent instant in time when an entry or feed was modified in a way the publisher considers significant.''


My blog generator makes updating the atom:updated element optional. If a post is changed, even if atom:updated is not, planet will incorporate the changes into its dynamicly generated output. I use these two features to update my posts without changing their position or status in blog aggregators like planet.

I can probably tell GnuJersey's planet to not depend on atom:updated for your feed. This means you won't be able to use that element to tell GnuJersey to re-order your posts. Please let me know (preferably by email) if that's what you want. Also, I suggest you submit a bug to blogger and ask for control over atom:updated.

-Dave Harding

Christopher Ingram said...

But it *was* updated. It seems silly not to let the updated field be set properly.

No matter what, it seems silly to order based on the time updated without explicit intervention. Systems shouldn't keep users from shooting themselves in the foot but damnit it shouldn't make it easy.

I just like to complain about this kind of thing if you haven't noticed.

harda said...

I agree, it was updated, but was it updated ``in a way the publisher considers significant?''

Most flavours of RSS don't have something like the atom:updated element; that means the aggregator has to keep track of when it saw each post. It has to retain that information indefinately, and if that information is lost, the user will see every old post (still in the feed) again. I think that's wrong.

I also think ordering posts by updated time makes perfect sense. I've made important changes to old posts and decided to update the updated time so everyone gets a second look at the post. For example, I once blogged about an event I wanted people to attend, but I put the wrong date in the blog; upon updating, I wanted everyone to see the new date.

(I just like to argue about this kind of thing if you haven't noticed.)

Also, I would like to register a bitchy complaint: blogger makes these comment boxes too damn small.

Christopher Ingram said...

Yes, Blogger's comment system sucks. I may move at some point.

I consider any corrections significant updates. If a post needs to get bumped back to the top in a system which publishes based on date and time, then the offending item can be "re-published". Not that the original publish date should change, mind you.

harda said...

You and I disagree about the definition of a significant change. The maintainers of planet agree with my definition[1], and they intentionally programed planet to do the most reasonable thing with regards to that definition.

[1] http://archives.free.net.ph/message/20070411.020639.b8d5f7ff.en.html

Such intentional programing can never be (by itself) bad programing. It can only be, if the definition is provably wrong, bad defining.

Christopher Ingram said...

Whoops. Forgot to break this out of moderation. Oh well.