Thursday, September 3, 2009

Rails Style

I had this great conversions from 2 great people from Castle Rock Research yesterday. Very technically sound people and I had a great time talking to them. Some of the questions they asked were pertaining to Ruby on Rails. I jot some of the questions and the answers here.

Why Ruby on Rails ? Painless application development. Enjoy as you develop. Make changes to the core code even as per you liking and optimization. Clear cut Modal/View/Controller distinction and therefore less coupling. Great plugins which club with the application. Development of plugins made easy. No configurations at all. Scalability using extensive techniques like mongrel clustering, load balancing, sticky session management etc. Faster access by allowing local server routing, Memcached etc. Searching made easy with ferret. Instant messaging made easy with Juggernaut etc. Background processing using ap4r etc.

I started out with Java (by learning Java) and it has pros of its own. It is injustice to compare languages or technologies but their relevance is according to the business problem.

Add you own pluralization for the modals ? Action Support Inflector routines which let you add pluralizations easy.
ActiveSupport::Inflector.inflections
do |inflect| inflect.irregular 'criterion', 'criteria'; end


Difference between nil and false ? I pondered on this question for a some time. But all I could get is that nil and false are objects which will evaluate to a false inside an if condition. But they are of different classes. NilClass and FalseClass.

How would you show the tree structure (like the 1st level, 2nd level, 3rd level links between 2 members in linkedin) when queried. As in what type of an approach would you use? A tree structure could be attained by using the acts as tree plugin. Now to show it would require you to parse the tree in some fashion. A BFS (Breadth First Search0 and DFS (Depth First Search) were 2 things which came into my mind. BFS seemed to be the logical idea as the search was with respect to the level.

What kind of an approach would be be using for a 'list of updates of friends' table ? A queue which gives you the update (filtered on and ordered) with respect to the relation of the user and the updater. We could also stored this in a table separately and then use some kind of backgroudn process to give the results so that the main server would be clogged.

These were some of the thoughts shared.

1 comment:

Rohan Dey said...

This is first write up of yours which I actually enjoyed and it was informative too, though I read all your updates.