Google Reader will now generate feeds for Web pages that do not already have them. You can plug in a URL and it will figure out a way to track changes to the page and notify you of them. From a technology standpoint, I’m fascinated. About 10 years ago, I worked for a company called Alerts.com that tried to do this sort of change detection. This was before feeds really took off, Morbus Iff’s AmphetaDesk was probably the leading news reader at that time.
The company built custom scrapers for any Web site we monitored, and our strategy was to seek out deals with content sites to scrape their sites and generate news alerts for them. Let me be blunt: this was a stupid strategy, and I knew it. RSS was starting to take off, and any company with a real CMS can keep track of the new stuff that’s being published without any help from a third party. Even so, we had a number of large content sites as customers for these keyword-based alerts.
I was hired to work on the consumer-facing site, and my idea was to do the sort of thing Google is launching now — automatically generate feeds and news alerts for any site, not just ones that were our partners. Unfortunately we didn’t really have the resources to pursue that strategy, and after a failed acquisition by LifeMinders, things steadily went downhill until everybody got laid off.
It’s funny to see Google doing now what I thought would have been a good idea a decade ago.
The argument against private methods
A few days ago I ran into Kent Spillern’s post, Private Methods are a Code Smell. Here’s the meat of it:
This post hit really close to home for me because I’m a heavy user of private utility methods. Splitting code up into lots of methods is a form of self-documentation that I advocate. He talks about one misuse of private methods that I don’t indulge in:
I write private methods for the reasons described in the first sentence, but I very rarely do what’s described in the second sentence — write private methods that modify the member variables in a class. Recently, though, I’ve started moving away from private methods. I don’t mind classes with lots of methods, but when you’re writing tests, it’s easiest to deal with small bits of code with known inputs and outputs.
I’ve also gotten used to frameworks like Rails and Kohana that both support the concept of helpers, which are a sort of thowback to procedural programming. I like helpers because they’re easy to test, and because you can use them in any situation you like. The more object-oriented alternative to writing helper or “util” classes is to use superclasses. Classes that share functionality extend the same superclass that contains the methods with shared functionality. This is the approach that the Spring Framework takes.
Even though I’d thought about moving away from private and protected methods, I had never really thought of them as something to be deliberately avoided, but I’m halfway along the path to being convinced.