The Original Hacker

Sadly, there is no incentive any more to write clean code.  So it was with a special, old-school thrill that I had a "hacker moment" earlier today.

Fun fact: hackers were originally good guys.  Back when computers were new, programs had to be very small.  Anyone who has ever had to "insert Disk 2" knows what I'm talking about.  A "hacker" was an expert programmer who could take 10 lines of code and reduce them to 4.  Code was clean, simple, and efficient.  Programming languages were praised for doing complicated tasks with simple commands.

Now, hardware is almost unlimited, and as things start to move into the "cloud," hardware will become "virtually" unlimited.  The result is that programmers have gotten lazy.  "Bloatware" is a piece of software that is larger and slower than it needs to be.  Sadly, there is no incentive any more to write clean code.  So it was with a special, old-school thrill that I had a "hacker moment" earlier today.

My mother's got a new book coming out and it's already receiving rave reviews.  I want to put these reviews on her website, but I know she'll be getting more and I don't want it to become unwieldy.  I'm already using the Drupal Content Management System, so it's easy to create new content and play with it.  My first thought was to create custom content types using the Content Construction Kit (CCK), and display them in custom-made lists using the Views module, and maybe even blend them in with existing pages using the Panels module.  Then I realized that none of that was necessary; it would only add to bloat, slow the site down, and distract me from more important tasks.  Turns out the entire task can be done using Drupal's built-in functions:

  1. Create a new content type called "Review"
  2. Create a new taxonomy called "Books"
  3. Create a new Book type called "Dust Devil" (the name of her new book)

Now, when she gets a new review, I go to the "Create Review" page, put in the reviewing agency, the book being reviewed, and the review itself.  Drupal keeps this content separate thanks to content types and taxonomy.  All I have to do is add a link to the taxonomy term and voila: all the Dust Devil reviews, lined up in a row.  And when I add a new one, it's automatically added to the list.

If I wanted to, I could still use Views and Panels to do all sorts of fancy things with the content.  The capability is there.  But I accomplished the task using fewer and simpler tools, and it works just as well (and faster).

Hooray for old school.

J<