Too Much Reading

June 25th, 2005

My saturday mornings are being consumed by catching up on reading that I put off during the week and it's
starting to get out of hand.  I had the future in-laws, my mother and my little sister over for dinner last
night so completely ignored the incoming feeds - this morning there were over 200 new items to flick through and
another 20-30 had arrived before I got through them all.  The list of open tabs in NetNewsWire has overflown
into a drop down menu all week and after 3 hours of reading this morning I've only just gotten it to fit
again.  Plus I have a stack of downloads to play with and evaluate.

I think RSS is taking over my life….

Oh yeah, I forgot about the bunch of podcasts waiting for me to listen too as well.

Product Idea

June 25th, 2005

Hand warmer for geeks - a USB powered device that blows warm air across your keyboard.

The rest of me is quite warm, but I can't wear gloves and type at the same time.  If you know of one
that exists, my birthday is in a couple of weeks so you could just send one now….

Ruby On Rails - Not As Happy

June 22nd, 2005

So I've been getting into Ruby on Rails and things started out well, had the basis of an application up
pretty quickly and now I'm starting to get into the logic of the app rather than just pulling values out of
the database and displaying them.  Productivity is droping, very rapidly.

The problems all seem to come down to the lack of a good IDE.  Specifically:

  • I have no idea where the definition of methods etc are.  Are they inherited?  Are they dynamically
    generated by something?
  • I have no idea where the documentation for stuff is.  Is it at api.rubyonrails.com, is it on ruby-doc.org,
    is it buried somewhere in my gems installation?
  • Navigating files is just too slow.

It wouldn't take much of an IDE to fix those problems just display a nice list of files in the project down
the side with tabbed editors, then have the ability to select a method, variable, etc and jump to it's
definition or it's documentation.

Other than that the lack of documentation and/or the lack of organization to the documentation is really getting
annoying.  Often the documentation is out there, you just don't know how to find it.  Sometimes the
documentation is just not comprehensive enough, is too vague or ambiguous.

There's also a few weird things that come up from time to time and working out what went wrong is very
difficult.  For instance, I wanted to check over user input before saving it to the database to avoid rouge
HTML tags causing problems etc.  So in the appropriate controllers I wrote (among many other attempts):

    def before_save
        hash = Hash.new
        attributes.each_pair do | key, value |
            if !value.nil? and value.is_a? String
                hash[key] = filterHTMLTags(value)
            else
                hash[key] = value
            end
        end
        attributes = hash
    end

filterHTMLTags is defined and does what it sounds like.  You'd think this would filter any string
values before saving them to the database, but it's effectively a no-op.  The values are saved to the
database in their unsafe form.

If however you make the last line:

self.attributes = hash

It works.  I assume the first version made a local variable called "attributes", assigned hash to
it and dumped it when it went out of scope  (@attributes didn't help here either btw).
 self.attributes seemed to kick Ruby into method call mode and called attributes= with hash as an argument
so it stored correctly.  I could understand this behavior if I also had to say self.attributes to get the
value, but it's very odd to have the behavior differ.

Of course I'm clearly just misunderstanding things and these learning pains will reduce as I learn more
about Ruby and Rails (though the file navigation problem is only going to get worse) but it's worth noting
that this is definitely no panacea and there are still gotchas and time sinks hidden around the place.

Funnies

June 21st, 2005

It's really worth subscribing to "kazem's"
cartoon
feed for some quality geek laughs.  Occasionally he turns into a bit of a Sun shill (he does
work for Sun) but mostly it's just general laughs from a (software) bug's life.  Fortunately
there's now a happy little orange icon linking to the RSS feed - it took me ages to find it originally as it
was in no way linked (it's here for the record).

The New Technorati

June 21st, 2005

Ugo Cei commented on the new technorati
interface and while I think it's an improvement over their previous attempt, it still needs work.
 Searches work consistently now, but it's still way too hard to find the RSS feed for the search and
there appears to be a few bugs which prevent you from getting access to one at all for some searches.

Oh well, looks like I'll be using the Feedster integration with NetNewsWire
for a while longer.  I did send them some feedback which hopefully made sense, I'm not really sure how
to accurately describe the problems I was having with finding feeds.