For fun, I ran "rake stats" on the edu 2.0 "Ruby on Rails" codebase to get some statistics.
Here's the outcome:
- 16,500 lines of code
- 309 classes (139 controllers, 142 models, 28 libraries)
- 1881 methods
- 6 methods per class on average
- 6 lines of code per method on average
One trend I noticed is towards making controllers responsible for a particular facet of a model. For example, we used to have a single controller that supported all the operations on a teacher's class, but now we have about 10 controllers, one which supports student attendance, another which supports the gradebook, and another which supports the teacher's view of the class forum, etc.
The codebase could be improved some more, but I think it's already pretty lean and mean. In another post, I'll contrast the edu 2.0 code base statistics against those from Moodle and Sakai.



Hi Mr. Glass,
The 16,500 lines of codes...is that all Ruby codes? I've been keeping up with your Edu 2.0 project and it's an inspiration. For future entrepeneur, where do you get your inspiration and ideas. Is there a good book that you could recommend for software development?
Posted by: Phillip | Feb 27, 2008 at 08:21 PM
Hi Phillip,
Thanks for your words of encouragement!
Yes, that's all Ruby code.
I get my inspiration from the desired to fundamentally improve various areas. For example, I went to a great school in the UK and would love to enable everyone to get a great education. But this requires a radical rethinking about what we teach and how we teach it IMHO.
I don't have a particular book to recommend; most of my own skills are a result of personally writing a huge amount of software and figuring out how to build systems efficiently.
Cheers,
Graham
Posted by: Graham Glass | Feb 29, 2008 at 11:43 PM
Thanks Graham.
So far, what's your experience with programming in Ruby like and your impression of Rails framework? Is RoR only good for "Web 2.0" apps or do you see it going mainstream?
Posted by: Phillip Ho | Mar 01, 2008 at 12:53 PM
Hi Phillip,
My impression is that Ruby on Rails is great for web-based applications and Ruby is a very good general purpose language.
Cheers,
Graham
Posted by: Graham Glass | Mar 03, 2008 at 02:04 AM
Thanks Graham. Without being bias, do you think that edu 2.0 is scalable with RoR?
Posted by: Phillip | Mar 03, 2008 at 05:03 PM
Hi Phillip,
Yes, of course I think it is scaleable, otherwise why would I have chosen RoR in the first place? ;-)
Cheers,
Graham
Posted by: Graham Glass | Mar 03, 2008 at 05:19 PM
Thought I asked. I was reading about Twitter having some issues with RoR not being scalable. But of course, that's debatable. It must have been the design or architecture that must have the founder question RoR being able to scale or not.
Posted by: Phillip | Mar 03, 2008 at 09:29 PM
Hi Phillip,
I think that was something to do with the way they were doing database pooling. Someone in the Rails community updated the database connection code to be a bit smarter and it was better within a day or so.
Cheers,
Graham
Posted by: Graham Glass | Mar 03, 2008 at 09:31 PM
Thanks Graham for the updates.
Posted by: Phillip | Mar 03, 2008 at 10:39 PM