rc3.org

Strong opinions, weakly held

Month: May 2005 (page 2 of 6)

More on ads in RSS feeds

Nothing quite like of having every item in a feed marked as unread because ads have been inserted. I wonder if the fact that ads constantly change will mean that sites like Bloglines will have a harder time keeping track of what’s new and what isn’t. I hope not. I guess it depends on whether or not it’s done by diffing new content against the old or by timestamps.

Matt Haughey on ads in feeds

Matt Haughey has a good post on why running AdSense ads in your feeds doesn’t make sense.

The filibuster

Here’s the bottom line, as I see it, on the compromise that has forestalled the application of the “nuclear option,” which would change Senate rules permitting unlimited debate of judicial nominees. If less than 5 Republicans had broken ranks with their leadership, there would have been no compromise, the nuclear option would have been exercised, and every Bush judicial nominee would be confirmed unless the Senate changes hands in 2006. It’s hard not to see that as a victory for the Democrats, no?

Update: other people don’t seem to think the Democrats did well at all.

Scary things

Over the past week or so, a new New York Times series (part 2) detailing an investigation into Afghans who were killed while in US military custody has been much discussed in the blogosphere. Needless to say, the idea that US soldiers, believing they were acting according to the wishes of their superiors, beat their (sometimes innocent) prisoners to death in the course of interrogating them is terrifying and disturbing. But what’s more terrifying is the chorus of hatemongers, morons, and psychopaths who believe that this story is “old news” and that the New York Times was wrong to print it. And more disturbingly, believe that the publishing of the story is evidence of a conspiracy among major media outlets to cover for one another. For more, see Bruce Rolston, or John Cole. It’s at times like these that I have to remind myself that this country and human society have been plagued with people of this ilk for all time, and that we’ve managed to survive. I should also mention that I’ve been following Jeanne d’Arc and Jim Henley on this topic for some time. I don’t have particular posts to point out, just read everything they write.

Object-oriented PHP

In spite of my own fears and warnings from others about the limitations of using the object-oriented features in PHP 4, I plowed ahead this week. In the reporting system I’m working on, I finally got to a point where I needed more structure than include files and functions. Object-oriented systems have three characteristics, encapsulation, polymorphism, and inheritance. I won’t go into the boring details of what each of these characteristics involve, but suffice it to say that I’m only using the object-oriented features of PHP to take advantage of one of them — encapsulation.

At this point in my programming career, I find it nigh on impossible to deal with complexity without bringing encapsulation into the picture. A few weeks ago, I mentioned a problem I was having involving reports that include outer joins. Once I had solved the problem, I realized that I had a whole bunch of code that was used to convert the represenation of the data in the database to the representation used in the reports. Then I had a whole different bunch of code that’s used to create the where clauses for the queries that generate the reports. In the Java world, all of that stuff is hidden away in nice private methods so that they aren’t exposed to the rest of the application. Unless you start travelling down the path of object-oriented PHP, that same functionality pollutes the core namespace of your application. The functions are bad enough, but the real problems come into play when it comes to variables. You get into a situation where you pass ever increasing numbers of arguments around, you start using the global keyword everywhere, or you start abusing associative arrays really badly. In any case, you are liable to run into trouble.

There are two downsides to OO PHP. The first is that it’s obviously an add-on. My core logic isn’t object-oriented — it lives in a page. It just brings objects to the party as it needs them. The second is that the syntax is pure torture (at least in PHP 4). I still don’t fully understand all of the implications of using references to pass objects around by reference rather than by value, and the necessity of using $this everywhere within a class is painful. Finally there’s the matter of not getting compile-time checking when you reference a property in an object like $object->property. I still don’t know what that’s about. In fairness, I haven’t investigated PHP 5, which may address some or all of these problems.

In any case, in spite of the awkwardness of OO in PHP 4, I recommend its use if you want to stay sane.

Words to live by

Ruby on Rails creator David Heinemeier Hansson on problem solving:

If you can get those magical 80% of the solution for 20% of the effort, how about just finding a way to cope with the missing 20% of the solution? If you can, you get to solve five easy problems (with comparable value) instead of solving one hard.

Oftentimes this is the right answer. In terms of software development, the question is whether the remaining 20% gives your project or company a strategic advantage over everybody else.

Google supports Maps hacks

The O’Reilly Radar reports that there’s support within Google for the maps hacks that have been popping up everywhere.

Stereotype threat

A post from the Mind Hacks blog on stereotype threat is one of the most interesting and throught provoking things I’ve read in some time.

Chicago crime king

Adrian Holovaty has come out and admitted that he created chicagocrime.org, the Web site everyone is talking about.

Check it out

I love sites that make publicly accessible data more usable. In the spirit of They Work For You comes chicagocrime.org, which features a number of cool features, including RSS everywhere and heavy use of Google Maps. Here’s an example of a specific crime that was reported. One of the coolest features is a dynamic map of Chicago (provided by Google Maps), which, using AJAX, can be used to show where various types of crimes occurred between specific dates. (So, for example, you can display all of the crimes committed at ATM machines last week on one zoomable map.) I’m not particularly interested in crime in Chicago, but the site is a monument to the types of things you can build by leveraging data and services that are freely available.

Older posts Newer posts

© 2024 rc3.org

Theme by Anders NorenUp ↑