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.

57 comments:

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 Myassignmenthelp.com.
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.

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...

Need essay help? Look no further than Allessaywriter.com. 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.

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

Unknown said...

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

Unknown 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!… https://royalcbd.com/cbd-legal-status/

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. Myassignmenthelp.com 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.

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!

stellabrown said...

Hi, I am Stella brown I am reading your blog, It is an amazing blog thanks for the sharing the blog. Allassignmentservices.com 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

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

Satta King said...

In an economically depressed world, it's getting tougher and tougher for the people nowadays to simply get their ends met, pay the basic food and electricity bills and put a 2 time meal on the table for our families. That’s why more and more people are engaging and further smashingly taking part in the side-income gigs such as investing in the stock market, taking up a part time job and playing the online poker and black satta king online as a hobby. A lot of these online betting and gambling games are getting accepted and insanely popular among the millennials or say the current young generation in our country. While there is a certain risk and vulnerability involved in playing these games. However, “What sort of a life we are living without some risks and certain thrills involved in it ?”

Cristina Parker said...

Acadecraft has a team of highly skilled and experienced editors who are the best copy editing services providers and 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.
professional typesetting services

benrusso62060 said...

I really love the work the Matlab Homework Help experts did on my communications system task. However, they need to work on their assignment delivery. The work was sent to me just an hour before the deadline and I had to turn it in without reviewing it. I always love to go through any Matlab assignment I buy from an online Matlab Assignment Help platform before handing it in for marking to make sure everything is done to perfection. Please improve on this area

Hope James said...

Clients from different parts of the globe take advantage of our audit services companies. We are a reputed company which has been catering to the needs of the clients for a long time now. Moreover, clients from countries like Australia, the UK, the USA, Canada, UAE, etc. avail our audit services.

Unknown said...

Hello. I am looking for potential statistics homework help today. I have heard a lot about your services so I believe you will be able to help me right away. I am looking for affordable Eviews homework help as well for this year. So, please inform me how I can join the company and get my hands on your top-notch services. In case you are unable to help me, please recommend someone who can provide these services at cost-effective rates.

Hanna Bell said...

Hey there, I need an Statistics Homework Help expert to help me understand the topic of piecewise regression. In our lectures, the concept seemed very hard, and I could not understand it completely. I need someone who can explain to me in a simpler way that I can understand the topic. he/she should explain to me which is the best model, the best data before the model and how to fit the model using SPSS. If you can deliver quality work then you would be my official Statistics Assignment Help partner.

Ella james said...

VERY AMAZING CONTENT AND FULL OF EFFORT!
ELLA JAMES

Fajil Hura said...

There are plenty of travelers who want to seek blessings from Lord Rama and hence plan to visit his birthplace. Ayodhya tour packages welcome tourists from all over the world to attain unlimited blessings from the Lord. Some sincere devotees surely go for Varanasi tour packages after visiting Ayodhya to get a boost in their positive energy. The trips are pocket-friendly and flexible as well.

vé máy bay đi Canada said...

Mua vé máy bay tại Aivivu, tham khảo

vé máy bay đi Mỹ bao nhiêu tiền

vé máy bay đi sài gòn hôm nay

vé máy bay đi hà nội tháng 8

vé máy bay từ hà nội vào nha trang

giá vé máy bay hà nội đà lạt khứ hồi

taxi sân bay nội bài hà nội

mua combo vinpearl nha trang

Soraya Lee said...

Now that is what I call a smooth write up. Talking about smooth write-ups, if you want to maintain a smooth sail in your academic writing tasks as well you can get in touch with the deft Accounting Homework Help experts of the livewebtutors platform and receive flawless solutions for your daunting assignments in just a few clicks.

Devin mark said...
This comment has been removed by the author.
Diego white said...

I had a last-hour assignment that needed the quickest programmer. You responded to me with the best C++ Homework Help/ expert that worked on it within forty minutes while still managing to help me score a straight A. I'll live to remember the expert and your Programming Assignment Help. Cheers!

Henry Hudson said...

I need a few samples before I can use the Matlab Assignment Help service. I think that can help me evaluate their ability more accurately than just going by the reviews. It's my first time here, and I'm being cautious this way because I got conned on the previous website. If you're able to do so, kindly let me know so that I can place an order for them with Matlab Homework Help services ASAP.

Isabell Kiral said...

You chose very nice field because you will get success a lot and secure your future. This field has a big scope, and you can adjust in it easily. Dissertation writing services.

opbest said...


Wow, cool post. I'd like to write like this too - taking time and real hard work to make a great article...
but I put things off too much and never seem to get started. Thanks though.

Try to check my webpage :: 풀싸롱

(freaky)

onlineAssignmenthelp said...

We provide online quiz help answers to school, high school, college and university students. Our experts are accustomed to using multiple quiz portal platforms such as blackboard, canvas and modal. We have hired experts from various fields of education. So that you can give us an online quiz support service on your required services. Experts know how to solve explanatory questions and objective type questions. They will finish your quiz or exam on time.

https://www.thetutorshelp.com/online-quiz-help.php

Online Quiz

ONCADAY -VY said...

I’ve been surfing online more than three hours today, yet I never
found any interesting article like yours. It is pretty
worth enough for me. In my view, if all web owners and
bloggers made good content as you did, the net will be a
lot more useful than ever before. 카지노


-VY

Unknown said...

Now you can secure the best grades in any online exams. All you have to do is request us for Online Exam Help services and we will be available immediately. Our MBA Online Exam Help is one of the most availed services. For any Chemistry Online Exam Help, please contact us by visiting our website.

Omsdelhi said...

The Avana Tablet 100mg is used for the purpose of treating erectile dysfunction and works miraculously. It makes your body ready for sexual activity. With Omsdelhi, the tablets are properly delivered to the required address.

Leo Oliver said...


Academics who want assistance with statistics assignments could seek instantly straightaway. Statistics Assignment Help is the most beneficial assistance that any student can have. For every statistics student, they establish the integrated solution. They will undoubtedly be satisfied once they have obtained their solution.

onlineAssignmenthelp said...

If you have really availed the services of premium services, you will get A class writing help with the highest experience and advanced knowledge within the specific field or branch. Of course, this applies to almost all assignments and subjects, not just to civil engineering assignments. You don't have to worry about copied material or plagiarism, because we provide the most unique and high quality content with the original idea. We also provide references and resources used during the completion of the Civil Engineering Assignment Assistance Assignment.
Level 5,121 Castlereagh Street Sydney, NSW 2000
+61-280062221
info@thetutorshelp.com
https://www.thetutorshelp.com/civil-engineering-assignment-help.php

civil engineering assignment

Unknow said...

Get Free Hard core XXX porn movies Watch high quality sex videos. Unlimited HD quality Xxx Videos, fresh porn tube, XXX SEX videos available at a very popular adult agency. To watch, click on them.

Unknown said...

Goa self drive car rental is a reliable mode of transport for the folks who cherish their freedom. It has become a sensation amongst youngsters and newly-wed couples. With Google Maps, the navigation becomes more fun than a hassle. Car rental in Goa can be booked on your mobile as soon as you land.

assignmentauthors said...

Research have shown that there are side effects of using this drug. These side effects ranges from hemorrhage, nausea, dizziness, strong uterine or abdominal cramping.
theology assignment help
assignment help
computer science assignment help
capstone project help online
article writer
content writer for hire
content writing services online
freelance writer for hire
ghost writer for hire online
write my assignments for me

Professional Course said...

Good blog and absolutely exceptional. You can do a lot better, but I still say it's perfect. Keep doing your best.

Data Scientist Training in Bangalore

Essien said...

You have really inspire me and I am glad I had access to this particular website.Wonderful! Inspiring effort and write-up. A million thanks for sharing. kasu diploma admission form

Go Rajasthan Travel said...

Dive into the romantic charm of the "City of Lakes" with our Udaipur Tour Packages. Explore the majestic City Palace, take a boat ride on Lake Pichola, and witness the mesmerizing sunset at the Lake Palace. Create everlasting memories with our packages available at Go Rajasthan Travel.

Tossround said...

First of all, thanks for sharing . very informative blog and always keep sharing.
Painting contractors may also take part in the bidding process and project management for a wide range of painting-related property maintenance tasks, including painting walls, ceilings, floors, and buildings. The Best Painting Contracting Services Dubai Professional offers on-site management, color previews, specification support, solution recommendations, and contractor recommendations.
Best Painting Contracting Services Dubai

harperpaul said...

We'll dive into the ecosystem surrounding Ruby, discussing popular frameworks like Ruby on Rails, Sinatra, and others, and how they streamline the development process. Additionally, we'll highlight the vibrant community, resources, and best practices that contribute to Ruby's success as a developer-friendly language.
attorney for bankruptcy near me

Lumiere Holidays said...

Indulge in the epitome of romantic getaways with our curated Kerala Honeymoon Tour Packages. Explore Kerala's serene backwaters, hill stations, and sun-kissed beaches hand in hand with your beloved. Tailored for lovebirds, create cherished moments amidst the scenic beauty of God's Own Country with Lumiere Holidays.

메이저사이트 said...

I really love the theme/design of your website.

gostopsite.com said...

I found so many interesting stuff in your blog especially its discussion.

sportstotomen.com said...

From the tons of comments on your articles, Thank you.

19guide03.com said...

So wonderful to discover somebody with some original thoughts on this topic.

slotplayground.com said...

These guys are hilarious.

edwardsrailcar.com said...

We actually installed a roof on one of their homes in Texas! Great guys.