Large sites using Ruby on Rails
December 12, 2007
I read the newspaper Computer Sweden today, and there was an article about how Ruby on Rails is getting thumbs up from major projects. It was very interesting, since one of the main cons of the framework is how it doesn’t scale very well.
I already knew that Twitter was one of the largest Rails sites, but I didn’t know that LinkedIn was another one. Another surprise was that the Swedish real estate site Hemnet (which is really good) is also based on Rails, delivering approximately 13 000 000 pages per week and it’s growing 40-50 % per year. When my girlfriend heard that it was a Rails site, she said “oh, that’s why it’s so slow”. I found that amusing.
Apparently, Hemnet have been satisfied with Ruby on Rails so far, with short development cycles and easy maintenance being the main advantages according to the project leader. But you should also know that they don’t seem to rely heavily on ActiveRecord, instead they are using their own stored procedures in an Oracle database for performance reasons.
Does anyone know of other large sites using Rails?
Why I like NetBeans 6.0
December 10, 2007
Roughly a week ago, the NetBeans 6.0 IDE (originally created by Sun) was released. And boy is it amazing; it even downloaded and installed the new Ruby on Rails 2.0.1 for me when I opened it for the first time.
I’ve always felt that Visual Studio is superior to any other IDE, with Eclipse being a close runner-up. That has changed now, and the new NetBeans is my new favorite for coding in anything but .NET. Just look at the code completion for Ruby, which includes a documentation window that pops up when you highlight a class in the list.

Also the way you can start your Rails site and surf around is great, it’s just like how you do it in Visual Studio. Just press F6 and a WEBrick server fires up and a browser window opens with your site in it. So smooth it makes your favorite milkshake blush.
It is open source, free, cross-platform, provides awesome tutorials (which Eclipse does too by the way) and the installer for the Ruby version is only 19 megabytes. 19 megabytes of love. It’s so good it almost makes me want to choose Java over C#. Almost.
It’s not very fast though… but then again, neither is Ruby. And no, I’ve never understood the Ruby community hype around TextMate, or vi and Emacs for that matter. To steep a learning curve for me…
Which programming language is the fastest?
June 15, 2007
I recently came across The Computer Language Benchmarks Game that compares the speed of different programming languages on the Gentoo and Debian linux distributions. It’s interesting (although not super serious), but what does it say?
Firstly C and C++ are the winners on both the platforms. Then you have a whole bunch of languages listed, of which I’m mostly interested in Java, C# and Ruby. The latter two are about half as fast as C/C++ and Ruby is in the bottom of the list. Not so strange since Ruby is an interpreted scripting language. It would be interesting to know if the JIT-languages are tested when compiling for the first time, or when the code is cached in the memory for subsequent calls, since there can be a huge difference. Also, the C# code is run with Mono in the tests, and I don’t know if that has any performance implications as compared to the Microsoft .NET platform.
But my primary argument against this speed comparison is optimality. I’m sure that this argument has been made a thousand times by others, but still. The tests must have been performed on optimal code in all the languages, or else the comparisons wouldn’t have any validity at all. Then the question really is: how difficult is it to write optimal code in any of the programming languages in the test. There is a reason why there’s been an increase in high level languages and the usage of them, it’s because C/C++ makes it very easy to write bad code. How often do you have problems with memory leaks in C#? That’s right.
What I mean is that you probably don’t have to be a super programmer to write decent performing code in the higher level languages, you’d have more of a challenge doing it in C or Assembler. And apparently most developers weren’t good enough since there’s been such a shift in focus towards C#/Java. Think about Ruby on Rails for example, the active record wrapper makes it easy to quickly write some code that interacts with a database without getting horrible performance, whereas if you write the stored procedures/SQL yourself, stuff can get really messy if you’re not very good. Abstraction has good and bad sides.
I’m not being a sore loser here, I’m know that you can write really good performance code with C/C++. Just don’t accept the benchmarking tests you see without considering the circumstances.
Aptana and intellisense
June 6, 2007
Yesterday I installed the beta version of the Aptana IDE + Rails which is an “integrated development environment for the Ruby on Rails framework” as they put it themselves. It is similar to Eclipse and can even be downloaded as a plug-in to it.
It has some nice features, like refactoring, unit testing support, snippets, syntax highlighting and code completion. The code completion however, is no way near as nice as the IntelliSense in Microsoft’s Visual Studio, but it’s a lot better than typing it all in SciTE or notepad.
Anyway, I’ve given up on Ruby on Rails: Up and Running (which I previously recommended). It required too much understanding of Ruby for me to really get it, so I’ve switched to Rails Solutions: Ruby on Rails Made Easy by Justin Williams. It doesn’t require any Ruby knowledge, but you should have some experience of developing and/or designing web applications. Everything is explained a lot more thorough than in Up and Running and you get to see a lot of nice AJAX examples as well. Neat!
The future of web development
June 4, 2007
Okay, I won’t try to explore that topic on my own, but I have a recommendation for you if html and beyond is your cup of tea.
I regularly listen to different podcasts. However, the only two on software development that I’ve found worth my time are .NET Rocks! and Hanselminutes, the former being my absolute favorite. If you’ve got any other suggestions, please contact me.
However, the past weekend I listened twice to the Hanselminutes episode #65, “Scott talks to Martin Fowler and David Heinemeier Hansson”, which was very interesting. There’s talk about the future of the web, Ruby on Rails and if ASP.NET is a dying technology. They’re pretty much agreeing that HTML and CSS is good enough tools to make web pages, and that a lot of the new and hyped technologies, such as AJAX and Silverlight, are giving the developers too much of a “blank canvas”. The restrictions of HTML and CSS are, in their opinion, positive and give us enough to do most of the tasks at hand. To quote Hansson:
“When you give people the tools to make something purple and in Comic Sans, they will put it in purple and Comic Sans. I think MySpace is the perfect example of what happens when you give people all the flexibility in the world. [...] We’ve got to learn how to walk before we run and we are still crawling when it comes to HTML applications “
I must admit that I’m also caught up in the hype about the new and cool web technologies, and that’s why the show is really mindblowing.
Also, the interview was conducted at the RailsConf conference, a big Ruby on Rails (RoR) happening in the U.S. So Martin and David talk about how much they like how RoR enforces the MVC architectural pattern, and creates unit tests automatically and so on, only to further distance the developers from a blank canvas. Also, the company where Martin works, Thoughtworks, is seeing an sharp decrease in .NET interest. Java is still going strong, but 40 % of their new business this year is Ruby. Then again, Thoughtworks’ customers are probably a bit more cutting edge than the average.
Still, it was a very interesting podcast, and convinced me even more that learning Ruby on Rails is a good thing.
My first Ruby on Rails application
May 30, 2007
After the interesting keynote (aptly named “Dynamic languages for statically typed minds”) by Niclas Nilsson at the ReMIX event in Stockholm last week, I decided to give Ruby a try.
I’ve also been curious about the Ruby on Rails framework, so that’s where I started. I downloaded the Instant Rails solution, unzipped it and a few seconds later I had a full-blown apache/mysql/ruby runtime, without any installation needed. Great start!
After that, I opened up the 182-page book Ruby on Rails: Up and Running and started programming straight away. It’s so easy, although I haven’t made it past chapter 2 yet. But man it is nice not having to hit Ctrl-Shift-B every time I make a change to my code. I’ll keep you posted on my findings along the way.
Ps. One thing that I’m confused about is how you dynamically can make a class’ private methods public from another class just like that. Good for unit testing, sure… but it seems rather insecure, doesn’t it? I mean, coders make methods private for a reason. Ds.