Saturday, March 24, 2012

Results of .Net Developer’s 5 weeks with Ruby (RoR) and SaaS


Several things happened in a short period of time to influence my decision to take a Ruby/SaaS class. I’m a lifer on .Net or more specifically Asp.Net and it’s precursor, Asp. First, the MVC .Net book I was reading at the time said programmers either use .Net or Ruby for MVC development but not both. Second, an online UC Berkeley class was free and gave me both a new language (Ruby) and backfilled any software-as-a-service (SaaS) holes in my knowledge. Third, the class used the Agile methodology which I had bits and pieces of. I wanted to see someone else’s interpretation put into practice.


Ruby on Rails (RoR)/MVC

I knew MVC, web protocols, and web development so the learning curve was all Ruby. The class had a quick pace where I knew how to do it in .Net but not Ruby. Ruby, fortunately, is a very easy language to pick up. It feels very much like a script kiddie toy but  more powerful.


Interpreted versus Compiled

Ruby is interpreted while .Net is compiled. Ruby is a conglomeration of files in specific locations while .Net is a single executable with the possibility of additional library classes in dlls. I like the separation of concerns between the libraries and the final executable code. But I also like the Ruby instant gratification of interpreted code. I would like to be able to intermix the interpreted and the compiled. Ruby for the front-end web development with Behavior Driven Development – basically string parsing and regular expression matching, then .Net compiled dll libraries with traditional unit tests for the heavy lifting. 


Yes, I know .Net has BDD but Ruby’s options are more mature with a larger audience. This gives me many more choices to implement as well as wider community support via StackOverflow.  Definitely points to the Ruby community here.


Yes, I know Ruby has TDD but since it is all string parsing anyway, it feels more like a great place to introduce more bugs instead of find ones already there. I think .Net exposes/fixes that better than Ruby does. Also as a single file (version number, date compiled, etc), and not many files and configurations, it is easier to know I have the correct object to test in the first place. And if the entry points are class method calls, a string-based language is the wrong hammer for that nail.


Language Constructs

C# is  a growth of C++ which came from C. Ruby is inspired by Perl, Smalltalk, and Lisp but also has oop features. I’ve compared languages intensely in the last five weeks. Ruby does some great oop things. Method naming, inheritance, poetry mode and method missing are, so far, my favorites.   Method missing is the only one I absolutely want to see in C# but probably won’t get because it is compiled. 


Method missing is a class-level catch-all for any method called in that class that isn’t actually defined for that class. Assume the Foo class only has method bar as in “” With a “method_missing” defined in Foo , I could easily call Foo.Bake, Foo.Grill, and Foo.Reheat and the “method_missing” method would be called and I have access to the method name “Bake”, “Grill”, or “Reheat” so the method can either use that information or pass it on.


While I understand mix-ins (duck-typing) is awesome, apples to oranges, C#/.Net has this covered well enough for me in class extension methods.


As for reability of Ruby, such as the following code:

    a.should be >= 7

C# can’t reproduce this entirely but, with some naming conventions, the C# code could be just a readable.



Linux versus Windows is quickly becoming a non-issue with platform expansion and cloud hosting. At this point, for me, the choice comes down to upfront cost alone. Performance, documentation, support, and the other usual metrics are either head-to-head equal or an apples to oranges comparison resulting in no clear winner.


Sometimes it was nice to have text configuration files in Ruby, sometimes it is nicer to have an IDE for configuration.


Free versus Not-free

So what about the money? Microsoft products aren’t free and that is a big hurdle for boot-strapping a Startup company. And once you are down the road a ways with your free development tools, why use .Net at all since you have to pay for it? That’s a question Microsoft gets to answer. With the new influx of developers coming from countries where the cost of Visual Studio is seriously out of reach, Microsoft needs to provide that free product. I don’t know if the Express versions of Visual Studio meet that need.


A Free Microsoft Interpreted Language

I would love to see Asp (or some interpreted equivalent) come back and take Ruby on as a free, interpreted language.


Final Results

Until then, I will try to marry Ruby and C#/.Net for myself with Ruby handling the html front-end and C# handling middle-ware and backend. This may be some hack of IronRuby and C# or it may be Linux/Ruby calling into a .Net REST service. Either way, I think both languages bring something to address the entire web space in a better way than either does alone.


  1. Even I think that both languages together does a great job and if any feature is missing in the first one, it is covered by the second one.

  2. Both languages are good when we use them logically.