13 August, 2011

lastfm-node 0.7.0 released

lastfm-node has made it to version 0.7.0. There are two major changes in this version both of which have potential to break existing code.

The first is that data emitted from LastFmRequest is now in the form of JavaScript objects rather than raw text. This saves consumers having to manually JSON.parse and inspect the results for errors. Errors returned by the Last.fm API are now emitted with the error event.

While reviewing the code I noticed that many objects in lastfm-node had properties and methods at too high a level of visibility. This has been cut back in this release. The only documented property which has changed is RecentTrackStream.isStreaming which has been replaced with an equivalent method, RecentTrackStream.isStreaming().

1 August, 2011

lastfm-node roadmap

The development of lastfm-node has mainly been driven by the needs of boxsocial. This has meant that lastfm-node’s own API has changed quite dramatically over time which, from my own experiences with consuming beta software, I know can be a nightmare for developers. Additionally it’s also missing a few key features (such as auto-retry of failed scrobbles) which any Last.fm wrapper should really support out of the box. As I’d really like to start encouraging other node.js developers to use the library, and I don’t want to piss any of them off by changing the API too much in the future, I want to get to version 1.0 pretty soon.

With that in mind I’ve sketched out a vague roadmap for future development

0.7.0

Responses from lastfm.request are automatically converted to JSON.

0.8.0

Failed scrobbles are automatically retried when appropriate.

0.9.0

Caching support. Memory and reddis with other pluggable datastores to follow.

1.0.0

Finalise API.
Tidy JSON responses*

1.1.0

Radio API/playlist support.

* the json spat out by the Last.fm API seems to be automatically converted from the XML which gives it some weird quirks like track.artist[‘#text’] to get an artists name.

10 March, 2011

“Why does this happen to code? Why does good code rot so quickly into bad code? We have lots of explanations for it. We complain that the requirements change in ways that thwart the original design. We bemoan the schedules that were too tight to do things right. We blather about stupid managers and intolerant customers and useless marketing types and telephone sanitizers. But the fault, dear Dilbert, is not in our stars, but in ourselves. We are unprofessional.

This may be a bitter pill to swallow. How could this mess be our fault? What about the requirements? What about the schedule? What about the stupid managers and the useless marketing types? Don’t they bear some of the blame?

No. The managers and marketers look to us for the information they need to make promises and commitments; and even when they don’t look to us, we should not be shy about telling them what we think. The users look to us to validate the way the requirements will fit into the system. The project managers look to us to help work out the schedule. We are deeply complicit in the planning of the project and share a great deal of the responsibility for any failures; especially if those failures have to do with bad code!

“But wait!” you say. “If I don’t do what my manager says, I’ll be fired.” Probably not. Most managers want the truth, even when they don’t act like it. Most managers want good code, even when they are obsessing about the schedule. They may defend the schedule and requirements with passion; but that’s their job. It’s your job to defend the code with equal passion.”

— Robert C. Martin, Clean Code