Refactoring, Rails, and "Coding Ruby Correctly" 7

Posted by Kurt Schrader Thu, 26 Jul 2007 07:59:00 GMT

Yesterday's blog post certainly generated a boat load of feedback, which I'm going to group into a few different tongue-in-cheek categories:

  • Refactoring isn't a problem, just refactor everything yourself by hand, or write a refactoring tool yourself.

If I had the time, I would. Refactoring by hand is what I'm doing now on a daily basis, because I don't really have any other choice. Thus the request for better tools.

Which brings up a tangentially related point. Why is it that whenever someone asks for better tools it's because they're lazy? I think that we can all agree that it sucks to use an axe to chop down trees when you've used a chainsaw before. From now on, comments of the form "just use grep to do it" will only be accepted from those of you who program on mainframes and walk everywhere, simply because you remember the good old days before we had these fancy cars and trains to move us around.

  • You must be coding Ruby incorrectly.

When making this comment, please point out the web page that shows how to write Ruby correctly. I have multiple Ruby webapps in production, I worked at Thoughtworks and I'm currently working with Pivotal Labs, two of the foremost Ruby consultancies, and no one has told me or my team that we're writing things incorrectly. However, I have an open mind and I'm willing to learn more about this topic.

  • You can't just throw together Ruby code without tests, that's why you're running into problems.

Aren't you going to have this problem with any language? Where did I imply that this was something that we were doing? Anyway, 'rake stats' says:

Code to Test Ratio: 1:2.8

So I don't think that's the problem.

Seriously though, It's all a bit academic. If you asked me what framework I would use if I was going to start building a new webapp tomorrow (and told me that I couldn't use Seaside) I would still choose Rails. It's still the best tool for lots of jobs out there. Pointing out some of it's deficiencies doesn't make that any less true, despite what some people seem to think.

Trackbacks

Use the following link to trackback from your own site:
http://kurt.karmalab.org/trackbacks?article_id=refactoring-rails-and-coding-ruby-correctly&day=26&month=07&year=2007

Comments

Leave a comment

  1. Avatar
    Java Developer about 4 hours later:

    Man, you are brave, I do believe most people no matter where they come from (either from Static Type Land or from the Dynamic Type Land), they all face this problem at some point, but people just never admit it, it's like "the king with shining new cloth". they just don't want to face that, instead they just blame the one who stand up.

  2. Avatar
    Shadowfiend about 5 hours later:

    It's funny how all of those points were made in one or two comments :)

  3. Avatar
    Jason Carreira about 7 hours later:

    The problem you're running into is that the Ruby people commenting have likely never worked on really big systems. Large codebases have problems all their own and require good tools to have half a chance of keeping them maintainable. Java has those tools thanks to Intellij (and the people who have copied them). RoR doesn't have those tools, and the dynamic nature of Ruby is at least partly to blame.

  4. Avatar
    anjan bacchu about 8 hours later:

    hi there,

    This would be a good time for someone like Kent Beck or Ward Cunningham to get into the picture with a new Refactoring tool for Ruby/Python.

    A good percentage of developers understand refactoring and the market seems to want it.

    BR, ~A

  5. Avatar
    Stephan Schmidt about 10 hours later:

    @Shadowfiend:

    Not in mine! :-)

    @Jason:

    Java has those tools with IntelliJ, Findbugs, CheckStyle, PMD, JDepend and several others which help you dealing with complexity.

    Peace -stephan

  6. Avatar
    Stephan Schmidt about 10 hours later:

    @Jason:

    Forgot "Excactly, ..."

    Peace -stephan

  7. Avatar
    Shadowfiend about 12 hours later:

    @Stephan: Indeed, it was a couple of the other ones :) The ones that proved your point ;)

Comments