The blog of Tobin

Tobins nerd blog on .NET, Software, Tech and Nice Shiny Gadgets.

Saturday, July 23, 2005

Rails: Frameworks are the way forward!

A few days ago I recieved a chance phone call from a local company in Leeds. They wanted someone to quickly fix some problems in a Rails application whilst thier main developer was on holiday. Have you ever tried to get into someone elses meaty project in just 4 hours!?

This morning I jumped in the car, drove across town to their office, and within 1 hour was in the SCite editor fixing problems so they could get thier demo done. What struck me was just how easy it was to work with a brand-new code base that I've never even seen. It was like being at home inside one of my own projects. Because I know Rails, I instantly knew where to find thing - third party APIs, models, controllers, views, images etc. That's invaluable when it comes to hitting the ground running. The code was very tidy too - clear, concise, well commented which helps alot of course 8-)

I've often been exposed to new code-bases, and half the battle is finding things and getting an understanding of the key abstractions - the framework - that underpins the system. With Rails all this stuff was already known to me - Rails lays out a foundation that you become very familiar with. This meant that finding the appropriate files was a doddle, and I could quickly crack on with tackling the meat of the problems straight away.

I imagine that many frameworks offer such advantages, and it's not just a Rails thing. However, it was a very pleasant surprise to be able to settle in to a code base so easily. In contrast, I've been working on an ASP project for over a year, and even today it's just painful. This particular project is like a "paradigm-soup" where the developer played with scores of ideas in one single project . This isn't a stab at ASP - I've had some great fun with it. Also, I've made that "paradigm-soup" mistake myself (many times). However, I seriously think that it's much harder to screw up when working within the confines of a well thought-out framework. Rails doesn't leave too much room for such amateur blunders!

Anyway, enough Rails evangelism. Rails has tought me an important lesson in the value of frameworks, and I'll certainly be looking to use a framework in all future projects, whether it be based on ASP, .NET or Ruby.

1 Comments:

Anonymous Anonymous said...

Hello, Tobin

First of all - thank you much for putting up the page for Rails on Windows- it almost helped me to get my Ruby on Rails/FastCGI/Apache application setup running, but there are problems with FastCGI still

I have followed your page all the way - installed MySQL DB, Apache 2 server, Ruby one-click installer from the page: http://electricvisions.com/rails.html and updated httpd.conf file to load FastCGI module: ........ LoadModule fastcgi_module modules/mod_fastcgi.so #comment out loading of Windows DLL #LoadModule fastcgi_module #"C:/windows/system32/mod_fastcgi-2.4.2-AP20.dll" [IfModule mod_fastcgi.c]
AddHandler fastcgi-script .fcgi [/IfModule]

also I'm setting FastCGI environment at the end of httpd.conf file:
FastCgiConfig -maxClassProcesses 1 -maxProcesses 1 -minProcesses 1 -processSlack 1

and have my virtual host entry configured properly:
[ VirtualHost *:80]
ServerAdmin danfrompiter@gmail.com ServerName hungryforce_dz DocumentRoot "D:/Apache roup/Apache2/htdocs/HungryForce/public" [Directory "D:/Apache Group/Apache2/htdocs/HungryForce/public/"> Options ExecCGI FollowSymLinks AllowOverride all
Allow from all
Order allow,deny AddHandler cgi-script .cgi
AddHandler fastcgi-script .fcgi
[/Directory]
[/VirtualHost]

and I have modified the .htaccess file to have directive: RewriteRule ^(.*)$ dispatch.fcgi [QSA,L] Still when I start Apache and try to hit my virtusl host http://hungryforce_dz I get this error in Apache log: [Tue Oct 18 20:37:51 2005] [warn] FastCGI: (dynamic) server "D:/Apache Group/Apache2/htdocs/HungryForce/public/dispatch.fcgi" has failed to remain running for 30 seconds given 3 attempts, its restart interval has been backed off to 600 seconds many many times.

Can you please advice me what may be wrong in my setup - it is very important for me to figure that out. many thanks, Dan Zilberman

7:28 AM  

Post a Comment

<< Home