Monday, August 01, 2011

Experience report: Ruby

For a long time I've been curious about how the supposed benefits and liabilities of programming in a dynamically typed language1 actually play out in practice. I'm now getting a chance to find it out, since I'm involved in a largish project using Ruby (lots of Rails plus some Sinatra and a couple of random daemons). My professional background has largely been in Java, but I spend a good chunk of my free time learning about different programming languages (and some PL theory), mostly on the static side of the fence. Anyway, here are some notes:

The big question is whether dynamic typing allows for more bugs to pass trough. My answer to this has to be put in context: we are a medium-sized team (between half and a full dozen of devs), all experienced in, and practicing, TDD. As with the rest of this blog post, I don't have hard data to show, but my impression is that the unit tests do indeed catch all the bugs that the Java type system would help to catch; with the caveat that it's often harder to pinpoint the source of a regression. I don't have much real experience in languages whose type systems help to enforce strong guarantees2, but I would imagine they would catch a larger fraction of the bugs that are caught by the unit tests, while not really avoiding further bugs. The reason is twofold: firstly, in my experience, many of the bugs are found in the interaction of separate pieces of software (such as Javascript in the browser talking to the web server), secondly, even when the bug is located within process boundaries, it is most often related to a forgotten invariant than to breaking a established one. But that's all conjecture.

On the matter of productivity, the abstraction mechanisms offered by the Ruby language help to structure code and avoid repetition and that's certainly noticeable in comparison to Java (though, in my opinion, not in comparison to Scala, and probably also not in comparison to Smalltalk, ML, Haskell or Oz). That gain is offset to a point by the lack of refactoring tools. There are some who argue that those tools are made necessary by the verbosity of Java, and aren't needed in better languages. That's nonsense. If a language has an abstraction mechanism, that mechanism is used to define an abstraction and to use the defined abstraction elsewhere. If we then want to change the abstraction we must change code at the use sites as well, and that's where such tools can help. This is all so obvious that I find it almost silly to have to write it down.

Many of the abstraction gains in Ruby come from metaprogramming techniques. I'm not completely sold that they are necessary to achieve the level of abstraction attained, and I'm sure that they hinder readability. It's much easier to gain a footing in a library written with straighforward composition mechanisms (be it functions or classes and objects) than in a mess of Strings and calls to define_method and cousins.

While on the subject of abstraction, I have to comment on Rails. It's a mature web framework that does a masterful job of making the common cases easy. This is a much harder feat than it sounds, as we can glean from the failure of JSF, WebForms and similar unsuccessful attempts to abstract the web. The hidden cost of the bargain is when we get to the uncommon cases. It isn't so much the case that there are specific application features that are hard to code in Rails, though it happens, but that the structure of the code that Rails mandates sometimes isn't a good fit to the problem being solved.

I'm sounding a little negative, so let me balance it out by saying that I believe Ruby and Rails were as adequate choices for our project as any. The main reason is the availability of decent quality libraries and tools (refactoring and code navigation notwithstanding), specially in the often overlooked front of deployment and configuration management.

Apologies for an opinionated blog post.

1. Unittyped, for the pedantic.
2. Such as Agda or Coq, or some styles of programming in ML, Haskell or Scala.


Pedro Matiello said...

+1 to your third paragraph.

madin said...

Tips for buying a copy here. Top Quality Replica Rolex UK People spend a lot of time searching on the Internet,Perfect Replica rolex milgauss watches where there are many replicas of famous designer brands on sale, and we can be sure that they are of high quality and quality.

madin said...

De winkel heeft problemen voor mij opgelost, de service is zeer geduldig, dit is een perfecte winkelervaring. Goedkope UGG schoenen kopen Toen ik de laarzen ontving, vond ik het een goede kopie van de laarzen.kopen dames ugg classic Ik vind deze online winkel leuk, deze laarzen zijn eenvoudig en genereus. Zeer tevreden met deze aankoop.

sandeep saxena said...

I read like this type of article only. You mentioned more important points in this article. Thankyou for interesting article.
C C++ Training in Chennai
C and C++ institute
c c++ course
c c++ training
C C++ Training in Tambaram
C C++ Training in Velachery
JMeter Training in Chennai
javascript training in chennai

priya rajesh said...

Great collection and thanks for sharing this info with us. Waiting for more like this.
Data Science Training Institute in Chennai
Data Science Classes in Chennai
Data Science course in Chennai
R Programming Training in Chennai
Data Analytics Training in Chennai
Machine Learning course in Chennai
Machine Learning Training in Velachery
Data Science course in Anna Nagar

Nathan William said...

One of the most prominent issues the students have to deal with while writing assignments is plagiarism. Hence, they extensively use plagiarism checker to check if there are any copied content in the paper.Choose
Another major reason for using plagiarism checkers is that universities do not accept plagiarized content. Plagiarism is a serious offence. Hence, if found, the students are suspended or might even lose the grades.
Due to these limitations, it is evident that the plagiarism checking & wordcounter tool are not at all effective to check plagiarism. The term plagiarism is actually very broad. It is merely not coping with words. But these tools, unfortunately, detect words but not ideas. Hence, the chances of plagiarized papers remain.

rickypauls said...

Assignment Help is the best source of providing assistance to those who students who could not complete their due to any reasons. If do so, mark your presence on greatassignmenthelp for affordable services.
Assignment Help Online
Online Assignment Help
Assignment Help Online Services
Assignment Helper
Assignment Assistance
Assignment Help Experts
Online Assignment Help Services

darylharper said...

Check the Credit Card Statement by enter login details.

Bill Caster said...

The modes of written communication have evolved over the years and how! What began with emails replacing the old school pen and paper has now moved over to WhatsApp and Hangout messages. How to write a professional Email Barely know how to type in full forms.

Anonymous said...

The pressure of academic assignments can be quite a painful thing. So, if you are feeling wondering, “Who can help me in writing my papers?” then you can simply take the paper help from us at
We boast of a 5000+ strong team of paper writers who are highly qualified and have been providing paper writing help for the past ten years. They can help you submit well-written papers and score better grades. From elementary to high school, from college to university - we provide research paper writing service for all kinds of papers.

Anonymous said...

Need essay help? Look no further than With more than a dozen years of experience in providing university essay help for students, we are best suited to attend to your every need. Here’s why:
Our team of more than 1500+ essay writers guarantees that your essay will be 100% plagiarism-free.
They hail from the finest universities in Australia, so you know you’re getting your money’s worth.
Speaking of money, we offer the most affordable essay help service there is. It is suited to the student.
Not only that, we offer a 100% money-back guarantee in case you’re unsatisfied with our services.
We’ve all been students ourselves, dependent on pocket money or slaving away at part-time jobs. We know what it’s like. So we’ve made our rates impossible to beat.

Health Tips said...

Know How to Open vcf file to excel for view Contact details.

Academic Assignment Writing said...

What an incredible work! Not only was it informative but also nicely written. To the point. Would like to read more from this space. Thank you for sharing great information to us.
best assignment help online

Olivia Crew said...

I have got enough information from your blog and I appreciate your way of writing. If You are Looking For Assignment Help USA? Visit Our Website Livewebtutors.Com And Get The Best Assignment Writing Services Within Your Budget.

john amber said...

I suggest all members choose Finance Assignment Help Australia for the best guideline in your academia. The perfect and expert assistant your requirement and learning assignment project by the university.

Expo 2020 said...

I enjoy kinds very own post. It will be respectable to get a single narrative inside and outside of the core of this distinctive core specialized niche will likely be commonly knowledgeable.
expo 2020

James Wick said...

Scholars need to connect with effective online assignment writing for do my assignment query. For that, visit website of online service providers and check their reliability before placing your order for any subject. Well if you get time you must read more
do my assignment for me

Olivia Crew said...

Excellent information Providing by your Article, thank you for taking the time to share with us such a nice article. Amazing insight you have on this, it's nice to find a website that details so much information about different artists. Kindly visit livewebtutors website we providing best Assignment Help services in Malaysia.

Assignment Help Australia said...

Assignment Help provides excellent writing services to all students who find tough to finish their academic papers. Take the support of professional academic writer and lighten your stress.
Assignment Help Online
Online Assignment Help
Australia Assignment Help
Assignment Helper
Assignment Assistance
Assignment Help Experts
Online Assignment Help Services

belly boys said...

i-LEND is an online marketplace connecting borrowers and lenders for loans. Although i-LEND verifies credentials of registered users on the site, it does not guarantee any loan offers by lenders nor does it guarantee any repayments by borrowers. Users make offers/loan requests at their own discretion with the understanding of the risks involved in such transactions including loss of entire capital and/or no guarantee of recovery. Please read our Legal agreements to understand more

William Smith said...

Via reading, you got me engaged and guess what? I would like to learn more on that. This is what is considered an entertaining message. Read more- accounting assignment help

William Smith said...

Via reading, you got me engaged and guess what? I would like to learn more on that. This is what is considered an entertaining message. Read more- accounting assignment help

Kate said...

Dobry artykuł) Dzięki za twoje przemyślenia. Jestem tutaj, aby zaoferować program antyplagiatowy online na Upewnij się, że Twoje posty są unikalne)

Assignment Help Australia said...

Take assistance from professional Australian writers using Assignment Help services. Just follow some steps and get the best and productive assignment writing services within your budget in Australia.
My Assignment Help
Assignment Help Online
Online Assignment Help

Photo Tour said...

I discovered your blog site on yahoo and appearance many of your early posts. Keep the very good operate. I merely extra the Feed to my MSN News Reader. Seeking toward reading far more by you at a later date!…

Strena Muicar said...

Gift with high learned force isn't basic for everybody. Making the ceaseless practice on the specific topic engages you to be ace of pick subject. All present age people make the consistent practice to hone their coding expertise. Doing this training, they don't get the adequate time to finish their task. That is the reason you ought to need to experience the Java Assignment Helpgroup for accomplishing the high evaluation and imprints. Stop your further disclosure at our Java programming help all things considered sensible cost. The multifaceted nature of subject isn't significant worry for us. Law Assignment Help Finance Assignment Help

Nionica said...

Hi, this is a nice blog thanks for sharing the informative blog. provide the Nestle pestle analysis for an assist to student queries. Our writers conduct thorough research to provides you with a flawless Nestle pestle analysis. My Assignment help brings essay papers. Writing an elaborate essay papers is anything but easy and most students lack the tenacity to work on the details accurately. If you get more details Please visit the site through Link.

99solution said...

Second Innings Home is the first and only premium home & health care service in India. Second Innings Home proposed across the nation features a beautiful campus ideally located in a well-maintained gated community in the format of a Star Hotel with luxurious amenities. It’s convenient to enjoy the privacy and to be near the city and nearby facilities. And yet it retains a sense of community spirit and the warmth of a small community. Read more- Luxury retirement homes in Hyderabad

Satta king online said...

At the point when an individual successes the Satta, the person is titled as the Satta King. At the point when an individual turns into a Satta King, his/her interest becomes climbed which impacts him/her to play this game much of the time. Prior the term Satta Bazar was utilized as Satta Matka wherein various tickets having numbers placed in a pot and that individual got the title of Satta Matka who got his number once the ticket is drawn out. Satta King online or gali satta is an illicit demonstration in India wherein at least two individuals are required to play this game by picking some number in like manner their desire. Furthermore, when they chose number goes out, at that point a victor is pronounced in like manner and all the cash moves to him as it were. Read more- Satta King online

Max Willor said...

You have made quite an interesting article. It's nice shared information and it's quite helpful post. I like the layout and flow of the write-up, because it kept me involved this whole time. At My Assignment Help Au, We Offer Pocket-Friendly Services And Write Tailored Assignments. Students Trust Our Assignment Help in Australia. To Get Authentic Assignments Within Deadlines, Hire Us Today!

sattaking online said...

Sata Kings gaming sites are specially affecting world-class wagering players in light of the fact that these sites offer premium quality wagering games with great administrations and plans for online players. What are you hanging tight for the time being? Register your name today, and win effectively on the Black Satta Games more than ever.

Tech Crunch App said...

Tech Crunch App - We provide news from all over world. Our site keeps you updated on top trending news, Politics, US News, Travel and more.

Veronica Kate said...

Hi, I am Veronica Kate. I am working as a full-time academic consultant with Livewebtutors. We are providing Resume Builder and Dissertation Editing Service to university and college students across the globe. I have been successfully helping students, scholars and professionals in various services like I mentioned above for more than 5 syears and hold excellent writing, proofreading and editing skills. You would also find various academic tools on Livewebtutors like Word Counter, Plagiarism Checker and Harvard Referencing Generator & Paraphrasing tool.

Veronica Kate said...

The blog written is extremely impressive, with a great topic. However, a bit more research could have strengthened it even further. You can explore the services as offered by, a premium academic writing services platform offering the best of Proofreading Editing teamed with knowledge and experience.

stellabrown said...

Hi, I am Stella brown I am reading your blog, It is an amazing blog thanks for the sharing the blog. provide the Medical Science Assignment Help such as an information about education for students queries. Allassignmentservices also provide the Linux Assignment Help. Students from different walks of life can afford our assignment help services as we are affordable. Moreover, our team of academic writers is highly efficient at their work.

Cristina Parker said...

Nice post! Acadecraft is an expansion of one of the prime E-learning and content development service providers possessing a considerable amount of business knowledge and certification in the localization services. We have over a decade of experience, which has mastered our professional translators with the art of serving and satisfying in accordance with clients’ requirements delivering flawless services.
language translation services
Localization Services
subtitling companies

Amit said...

Stones International Real Estate offers real estate services in Dubai. It deals with residential properties in Dubai, commercial properties in Dubai, bulk purchases in Dubai, investment advisory for Dubai real estate, etc. If you want to buy property in Dubai, or rent property in Dubai, it will provide you all the necessary assistance. With Stones International, you can start your search for apartments for sale in Dubai, apartments for rent in Dubai, villa for sale in Dubai, villa for rent in Dubai, and many other services related to real estate in Dubai. It is among the Best Real Estate Company in Dubai. If end-users are looking to buy property in Dubai or investors want to invest in Dubai real estate, Stones International aims to provide the best services. Its other services include property management in Dubai, investment portfolio management, interior designing and holiday homes in Dubai.

Cristina Parker said...

Acadecraft has a team of highly skilled and experienced editors who understand the importance of their role in the process flow. They have an eye for details and are also able to detect errors in facts. Apart from having an excellent command over the language, our editors also have critical thinking skills.
copy editing services
student manual development Services
content quality checker online