Archive for June, 2007

Tagging in Rails and the confrontational rubyonrails irc channel

Tuesday, June 19th, 2007

Once upon a time, the Rails community was pretty open and friendly and one could easily visit the rubyonrails irc channel at freenode to get a ton of help. Its still possible to get help from the irc channel these days but you have to be ready to put up with people who aren’t too friendly. Its filled with geeks who automatically assume you’re an idiot and will treat you as such. I just spent a few minutes in the channel probing about why there’s no consistent taggable plugin. There is the acts_as_taggable gem, the acts_as_taggable plugin, the acts_as_taggable_on_steroids plugin, and even the has_many_polymorphs. The problem is that apparently the acts_as_taggable gem and plugin are deprecated but the other two don’t offer any useful functions. You have to make them all yourself. Neither are much use as a plugin as of this writing. Both require you to write a bunch of your own basic methods like related tags. Another problem is that neither has a friendly RDoc type api published anywhere. As it was so kindly pointed out to me on the rubyonrails irc channel, I am just being an idiot and could easily just read the source code to find out all the methods and what they do. The Rails community, at least in irc, has really degenerated over the past few years and from the looks of the current state of tagging in Rails, so has the code and documentation that is produced.

I’m still undecided on which direction I should head. I’ve already got a half-baked solution using the act_as_taggable plugin so I’m leaning towards just adding the few extra methods I need to it. Its either that or rewrite my tagging code another way which will be deprecated in a few months anyway. A decent tagging plugin for Rails is a void waiting to be filled. Any takers?

Beep Shot

Monday, June 11th, 2007

I’ve been working hard lately to get my latest creation off the ground and here it is: Beep Shot. You send picture messages from your cell phone to the Beep Shot number and they get posted on the site where people can comment and rate them. Try it out for yourself at http://beepshot.com and join in on all the fun.

Brian's slick Wordpress titles for pseudo-indented Google search results

Thursday, June 7th, 2007

There are plenty of people talking about how you can make your Wordpress blog titles more SEO friendly. No one I’ve found however has mentioned what I’ve stumbled upon by accident. Pseudo-indented listings in Google search results. What I’ve started doing on my blogs is making my title like this:


<title>
<?php if ( is_single() ) { ?> &raquo; <? } ?> <?php wp_title(''); ?> <?php if ( is_single() ) { ?> &raquo; < ? } ?> < ?php bloginfo('name'); ?>
</title>

This adds a » in front of your post title. The result is that when the search results show up in Google your links look like it stands out more because of the » in the title. It almost makes it look like your site is more official and Google is giving you a little arrow in front of your link to prove it. It won’t effect your rankings as far as I know. Its more of a psychological advantage than anything else but I have no scientific data to back up that claim. Take a look at the title of this post to see an example title.

Free spaghetti lunch

Thursday, June 7th, 2007

Everyone has seen spaghetti code and most programmers have written their fair share of it as well (though no one will openly admit that). Sloppy spaghetti code is bred from poor design and planning, poor coding practices, quick hacks, and band aides over bugs. What’s worse is that the nature of pasta code is such that when someone attempts to understand the mess they quickly become overwhelmed. As a result they want to hurry and get their mind out of the sloppy mess so they end up just doing more quick hacks and band aides so that they don’t have to rewrite the whole plate of spaghetti and make it make sense. Spaghetti is often filled with bugs which are nearly impossible to track down. As a result, band aides and quick hacks are applied instead of finding the root of the bugs and fixing them. It also makes writing any type of automated tests extremely difficult because the code isn’t structured in a very logical way. Writing tests along the way would help alleviate the spaghettiness because the structure would be more organized to facilitate the testing.

Now the question becomes what do you do when you have to work with spaghetti code? You add meat balls. You write more spaghetti when you have to. When you add new features, you can organize your code better to show how things should be done. Work on the spaghetti long enough and the whole code base will slowly start to unwind itself to you. Not because it was rewritten in a more readable and efficient way but more likely because you’ve gotten sloppy working with such sloppy code and you’ve learned how to make a mess yourself. The new code you produce can be beautiful but when you work in a messy environment you have little choice but to continue making a mess or rewrite the whole thing.