• Progress

    photo
    • allyn
    • May 28th, 2008
    • 04:21:19 PM

    Well, we’re halfway through another week of the Feisty Piranha Project. We’re not doing to bad. We have over a thousand lines of code between Bob and I, Subversion reports 56 commits, and Erin has made sweet progress on the interface. Also, our admin section has more then a few tabs, which any web developer can submit means the app is real. Once you have tabs, you win.

    Earlier I ran into a rails problem which I solved with a loop. This doesn’t sound too bad, but observe:

    (list.length-1).downto(1) do |x|
      item = (secrets)
        return false if not item or item.name.downcase != list[x-1]
      end
      return true
    end
    

    Those of you reading who know ruby will probably be able to point out the flaws in this code snippet. You’ll probably also be able to pinpoint where the tasty bits used to be, before I removed them to not give anything away. :) For those of you who don’t know ruby, I’ll summarize the flaws for you: it sucks. You can tell I learned Java first..Java loves those count controlled loops. In my defense, that is part of a fairly complex data structure, and I ran into many problems before I settled on this as a solution. The problems stemmed from the names being the wrong case, so that is why there’s a downcase call in there. I didn’t realize this at first, so my much more elegant one liner got turned into this, and I haven’t switched it back yet.

    Just goes to show you, never write ruby on rails without coffee. I better go fix it before Zink or Dusty laugh at me.

    Comments

    Feisty Piranha Project » Blog Archive » Another intern post!

    [...] have I been working on you ask? Well, unlike Allyn, I have not been fixing coffee for Zink (Kevin) and Dusty (Read the last paragraph in his post) despite how we were assured that this was not a coffee [...]