Ruby on Rails

The Reg sits down with David Heinemeier Hansson

Securing Web Applications Made Simple and Scalable

Ruby on Rails is an open-source application framework which has won praise for its elegance and high productivity. Its creator, David Heinemeier Hansson of 37signals, was in London for the Carson conference on the Future of Web Apps.

So what’s so good about Rails? David Heinemeier HanssonI’ve billed Rails in the past as PHP meets Java. You get the clean, structured approach from J2EE and Java, but at the same time you get the quick, short feedback loop, instant results from PHP. We have a lot of people coming from J2EE because it’s just too complex, they can’t get anything done. Then we have a ton of people coming from PHP because they’re realising, it's simply too unstructured. I can’t figure out my code after I’ve written it, I have decreasing productivity over time. Getting those two factions together is the big goal of what we’re doing with Rails.

And why Ruby?

Ruby is a language unlike any other I’ve tried. Matz, the Japanese creator of Ruby, wanted to create a programming language that was optimised for programmer happiness, instead of being optimised for machines. So instead of being a slave to the compiler you’re making the compiler a slave to you. I tried it out for a week and really liked it, and got something done, and within a month there was just no way I would ever go back to a language like PHP or Java.

A key feature of Ruby is its dynamic typing, in contrast to the static typing of C/C++ or Java. If you give up the safety of static typing, then is a rigorous testing methodology necessary in compensation?

That’s the wonderful thing that’s been working out so well for dynamic languages like Ruby and Python and the others. We’ve had this resurgence of programmer-driven tests. If you have no tests, then static typing gives you something. I don’t agree that it gives you very much, because it’s usually not compile errors but the logic of your program that is wrong. Unit testing and functional testing catch all types of errors, including logic errors. In a world where testing is considered a good, I think static typing is like a ball and a chain.

Ruby on Rails may be flavour of the year, but is it secure? Will it scale?

Security vulnerabilities are logic errors. You can have just as many security violations in a Java program or a Perl program or something else.

So would he recommend Rails for a highly secure application like online banking?

Definitely. But what gets used is not necessarily decided on technical excellence but more: ‘I wouldn’t get fired for using Java.’ It’s a political concern more than it’s a technical concern. As for scalability, we didn't try to solve that problem with Rails, because it is already solved. How is Yahoo scaling? They’re doing billions of page views a day, and they’re using PHP. The thing about PHP, Perl, Python and Ruby is that they can all be architected in the same manner, which is this notion of not having session state in the application layer. You push that down to the database, or you push it down to a shared memory store. That gives you the freedom of adding new application servers at will. You have load balancers, then you have web servers, then you have load balancers, then you have application servers. Rails is intensely scalable in that fashion.

Bridging the IT gap between rising business demands and ageing tools

More from The Register

next story
NO MORE ALL CAPS and other pleasures of Visual Studio 14
Unpicking a packed preview that breaks down ASP.NET
Cheer up, Nokia fans. It can start making mobes again in 18 months
The real winner of the Nokia sale is *drumroll* ... Nokia
Mozilla fixes CRITICAL security holes in Firefox, urges v31 upgrade
Misc memory hazards 'could be exploited' - and guess what, one's a Javascript vuln
Put down that Oracle database patch: It could cost $23,000 per CPU
On-by-default INMEMORY tech a boon for developers ... as long as they can afford it
Google shows off new Chrome OS look
Athena springs full-grown from Chromium project's head
Apple: We'll unleash OS X Yosemite beta on the MASSES on 24 July
Starting today, regular fanbois will be guinea pigs, it tells Reg
HIDDEN packet sniffer spy tech in MILLIONS of iPhones, iPads – expert
Don't panic though – Apple's backdoor is not wide open to all, guru tells us
prev story


Designing a Defense for Mobile Applications
Learn about the various considerations for defending mobile applications - from the application architecture itself to the myriad testing technologies.
Implementing global e-invoicing with guaranteed legal certainty
Explaining the role local tax compliance plays in successful supply chain management and e-business and how leading global brands are addressing this.
Top 8 considerations to enable and simplify mobility
In this whitepaper learn how to successfully add mobile capabilities simply and cost effectively.
Seven Steps to Software Security
Seven practical steps you can begin to take today to secure your applications and prevent the damages a successful cyber-attack can cause.
Boost IT visibility and business value
How building a great service catalog relieves pressure points and demonstrates the value of IT service management.