Diamond in the Rough

Posted by Michael Leung
on Apr 07, 08

Every individual should use whatever framework/language/operating system they as a person, find the most enjoyment with. If coding statistical graphing applications in Cobol is more fun for you than having sex, then that’s your prerogative (although I think you might be doing it wrong, but that’s beyond the scope of this article). I’m not here to tell anyone what they should use. I am here however, to write about my thoughts and feelings related to my personal experience.

For me, Ruby is really where it’s at. Rails as a framework essentially served as a gateway drug to the Ruby language, which is what really has me metaphorically strung out like a meth addict, looking to score his next tweak. Without Ruby, Rails and Merb wouldn’t be able to shine quite as brilliantly. That’s not to say similar functionality can’t be emulated in other frameworks. It absolutely can, and in fact has, in droves; just not with the same beauty and elegance that Ruby brings to the table. I guess that’s all relative though. As the saying goes, beauty is in the eye of the beholder.

I’ve alluded to elegance and beauty so far, which I’ve deemed subjective, but I haven’t really provided any substantial details as to why I choose to embrace the open source culture of Ruby, and stopped blindly slurping down the corporate Koolaid. It is a well known fact that I began my career on the other side of the tracks, so to speak. Much of what will follow next, are the root causes that led me to Ruby. Some of it will be perceived as an attempt to start yet another holy flame war, but that is not my intention. These are just my personal experiences. I’m not attempting to sway anyone, just expressing my own opinions. This is, after all, my blog.

In all honestly, I never particularly cared for web development prior to my serendipitous meeting with Rails. Doing .NET web development always felt clunky and hacky to me. Like the authors of ASP .NET saw what the WinForms team was doing, and by some outrageous notion, thought it would work well on the web. I’m not trying to say that ASP .NET sites don’t work. There are thousands of high traffic sites being powered by ASP .NET as you sit and read this. It works really well. In fact, I’d even go as far as to say it’s more scaleable than Rails under certain conditions. I’m also not saying that there’s any site that can only be built in Rails or Merb, and can’t possibly be coded in .NET, or Perl, or Django, or whatever. What I am saying is working with .NET brought little happiness to my days, and isn’t that what it’s all about? Finding what you’re passionate about. Something that motivates, and drives you to excel, opposed to spending hour after colorless hour, trudging on, laboriously writing the same low-level plumbing code you wrote so many times before.

The vast amount of freedom .NET gives the developer as well, is like having just enough rope to hang yourself with. Applications can be structured elegantly, but effectively designing a highly cohesive, beautiful system takes much effort. And once you’ve gone through all the trouble of designing all the subsystems in a nice clean manner, the framework pulls the carpet out from under you with concepts like PostBacks,ViewState, and obfuscated DOM ids.

Frameworks such as Rails and Merb conversely, have a structured, uniform design methodology built into every single application, saving precious developer cycles for important aspects like, oh I don’t know… business logic, instead of glue code, and months of intensive framework design. I really appreciated the fact that Rails was structured around familiar design patterns. I certainly read Martin Fowlers industry Classic: Patterns of Enterprise Architecture, prior to making the leap, and in fact was implementing many of the patterns illustrated in the book in my .NET code. Definitely not an impossible task, but takes infinitely too much effort. Rails comes with all that baked in, and MVC to boot. When I was entrenched in the .NET world, MVC in ASP .NET was damn near impossible to implement. You could do MVP (model/view/presenter), but I never cared for that pattern. Of course this has all changed with the advent of ASP .NET’s MVC, which I quite like actually, but that’s mostly because of the fact they nicked many concepts from Rails and Django. That my friends, is definitely the subject of another post.

On the other side of the coin, anyone could argue that there will still be bad Rails code. I’ve seen my fair share, so I can definitely validate that. That’s not what this article is about though. Every single language or framework out there will be subject to bad developers writing really hideous code. That’s a constant. This is more about my perceived happiness working with particular technologies.

There’s really so much more I have to say about this, but I’m going to have to save that for a part deuce. In attempt to bring this thing home, I’ll sum up with the following recap:

  • Ruby code is beautiful and Elegant to me. .NET code, not so much.
  • ASP .NET development feels like a hack
  • The .NET framework provides too much architectural freedom, which some people see as a good thing, and in many cases is a good thing. When you want to get stuff coded up as fast as possible though, worrying about the typical mundane implementation details is too consuming. It’s super easy to get lost in the minutia.
  • Ruby frameworks provide a structure based on industry design patterns like ActiveRecord, and MVC. Implementing some of those patterns in .NET isn’t trivial

Here’s what I plan to talk about in the next part:

  • Types of work for .NET developers vs Ruby projects
  • The speed at which things are changing in .NET, and all the new stuff one must keep up with
  • Side by side comparison of Ruby syntax vs .NET (e.g. what makes it beautiful to me)
  • Operating systems each camp uses
  • Tons more

Are you a Ruby developer, who’s come to it from another discipline? If so leave a comment with your experiences? Are you an ASP .NET developer who thinks Ruby is rubish? If so, save your comments. Just kidding, I’d love to hear it from your side as well.

Digg it! and DNZone it

Comments

Leave a response

  1. JamesApr 07 08 @ 03:47PM

    Nice article.

    It’s refreshing to read a blog from a Rails developer that is capable of extolling the greater virtues of developing with Rails while not completely bashing the .NET offering. However, I tend to fall on the side of options for development. Initially, the thing that disturbed me the most with Rails was its chant of "convention over configuration." So, already, we’re being told: More people do things this way, abide by our suggest practices and you’ll be fine. But what happens when you need to deviate from that path? Like Cartman mimicking simple bitches on Maury, I revel in knowing that "I do watta want!" To me, there’s nothing like the power of choice!

  2. Michael LeungApr 07 08 @ 04:11PM

    About time you commented. If you’re more about freedom of choice, than you may be more interested in Merb. It’s ORM agnostic so you can pick and choose the mapper you want to use, and it’s more configurable in general.

    It’s still young at this point though, so Rails is really where all the work is at.

    For me, I rather have less choice, which gives me more time to get it done rather than ponder the best way to do it for a few months writing reams of documentation that will be out of sync with the project after the first week of coding.

    But each their own.

  3. JamesApr 07 08 @ 04:34PM

    Yeh. I’ve hearing good things about Merb (from you know who). I’ll have to check that one out myself. It’d be great if it could be coded against some other language as well.

    And there are other framework additions (much like plug-ins and gems in Rails) that help generate and speed up development time for .NET. One such tool is from Rob Conery: SubSonic.

  4. AdamApr 10 08 @ 09:26AM

    Mike,

    sounds like rails is where it’s at. is there any resource you’d recommend to a novice programmer who’d like to learn ruby on rails?

  5. Michael LeungApr 10 08 @ 11:40AM

    Adam,

    I would say the best place to begin is with the, sort of, canonical Rails book: "Agile Web Development with Rails":http://www.amazon.com/Agile-Web-Development-Rails-2nd/dp/0977616630/ref=pd_bbs_sr_1?ie=UTF8&s=books&qid=1207841826&sr=8-1

    It’s a bit dated, but still provides the most solid base for new comers to Rails, in my opinion. Decided to take up programming as well as being a doctor, bro?

  6. Mark ThomasApr 10 08 @ 01:00PM

    @James: Convention over configuration means that if you follow certain conventions, you can avoid configuration, not that configuration isn’t possible. Another way of saying it: Rails has a good set of defaults for everything. What happens when you want to do things a different way? You have to use configuration. It’s not all-or-nothing. Use the defaults when you can; configure the parts you really need to customize.

  7. Michael LeungApr 10 08 @ 01:12PM

    Mark, I definitely, for the most part agree with you, however, there are certain things that aren’t that easy to configure in Rails. For me though, that’s fine. I’ve been using Rails professionally for two years, and haven’t really come across anything that was a show stopper for Rails. I definitely haven’t had to turn to another language or Framework because Rails couldn’t handle the situation.

    The nicest thing is Rails is open source. Doesn’t do what you want exactly? Change it.

  8. mike dApr 10 08 @ 08:57PM
    whats up!
Comment