Opinion – 1,000,000 lines of code

3500

Disclaimer: I’m no programmer; so I don’t have much more than a cursory understanding of the development behind software like Moodle.  But this isn’t so much of an opinion post as it is (I hope) a few thought provoking questions.

Post Pages - Post Inline - WIRIS

A quote from Sean Behan‘s recent review of “Moodle 1.9 Extension Development” struck me.

Moodle is nearly 1 million lines of source code! (source: http://www.ohloh.net/p/moodle) Plowing through this on your own is not an easy task, even for experienced developers.

Personally I’m a huge fan of WordPress (that’s what this site is), which is about 10% of the Moodle code base (albeit the core is much less complex).  That being said, when is too much code…too much?

I think that Sean raises an important idea: that the size of the Moodle code base may be prohibitive to programmers diving in and/or making changes.

  • What if Moodle’s code base were smaller?
  • What if the Moodle core was more narrowly focused?
  • Does it matter?
Previous articleGreat new #Moodle2pr videos from @ghenrick (2.0)
Next articleGoogle Forms into Moodle Classrooms video by @howen

7 COMMENTS

  1. Good point!
    I heard that the Sakai project is dumping a lot of their code base and relying on other open source projects to handle a lot of the nuts and bolts.
    I have also seen some folks who have taken a web CMS like Drupal and added LMS aspects.
    I think a lot can be said for standing on the shoulders of others.
    However, sometimes you just need to code a piece of software to do a particular job and you can lose time by trying to tweak other tools to do the job you want the LMS to do.
    Moodle has done a good job of attracting a lot of plugins so folks have figured it out in spite of the complexity.
    It does look like with Moodle 2.0 focus on API’s (repository, portfolio, web services) it will be well positioned for modding.

  2. To start with, I must say that much about the Moodle code is not ideal. I am not defending it, although it is getting better, and Moodle 2.0 is a big step in the right direction.

    The next point is that Moodle has always cared far more about what teachers think than what developers think. I think this is one of the reasons why a lot of teachers like the way Moodle works, and a lot of developers are horrified. As a developer, I would much rather work an a lean beautiful code-base, but I have come to appreciate over the years that I don’t matter. I just have to put up with it and get on with my job. It is the teacher that matter. Actually, I blogged about that: http://tjhunt.blogspot.com/2009/06/geeks-dont-really-matter.html

    You also need to note that Moodle does stand on a lot of other shoulders. There are a lot of third-party libraries in the lib folder. A quick wc shows that they add up to more than half a million lines. We just include them in the codebase to make it easy for people to install with a single cvs checkout or download.

    Then you have to remember that core wordpress is just a blogging tool out of the box. Moodle is a blogging tool, a forum, a wiki, a quiz system, … That is, it ships with a lot of standard modules included. However, these plugins are completely independent. They comprise, of necessity, that is a lot of code. But, thanks to Moodle’s modular architecture, you do not have to “Plowing through [all] this”. Most of the time, it is easy to ignore most of it. You are just thinking about one particular plugin, and the moodle core platform. I cannot thing of an easy way to get a line-count for Moodle core right now, it is still quite big, but a small fraction of a million lines.

  3. some great points @tim. i agree that the needs of teachers come before those of developers. without teachers there would be no reason to hack on the software.

    but developers do matter! i don’t think the needs of developers and teachers are at odds with each other. you can have a well designed software package for developers with features that please teachers. if developer needs are not weighted enough, teachers will lose out in the long run.

    i think the “just put up with it” attitude is revealing of the larger problem. it’s too difficult to be inspired by the code base!

    1,000,000 lines of code is 1,000,000 lines of code (~ 930,000 something lines of code 🙂 some single files have ~10,000 lines in them! if certain libs aren’t needed then they should be removed. dependencies count, regardless of who wrote them.

    wordpress isn’t just a blogging tool. it is a multi user/site CMS with access control, resource management, an advanced plugin and filtering system. it also has pretty urls!

    it is easy to extend and allows non developers (primarily designers) to hack any part of the platform w/out needing to mod the core.

    moodle has a nice plugin system, but it isn’t as flexible.

    wordpress was built to solve a differnt problem than moodle. but imo, their philosphy in design is more elegant. i believe this is reflected in the code base!

  4. Good point Joe.
    As a client tool developer i care more about the structure of the code than the count of lines. This must be also discussed, as it has been noted that moodle usese lots of open source libs and this is sometimes a disadvantage, because each lib has its own convention and may produce for example very distinct html output.
    This may sound a little bit radical but this complexity and weight produces some sort of economy surrounded by partners, dev book writers and mod devs. So moodle weight may be an intention rather than a consequence. It does not matter too much as far as the code base is mintained well, but i guess the time it takes to release moodle 2 for production is some negative indicator that moodle hq has hard times with maintaining the code base. Considering all these facts i still love to develop for moodle

  5. i’m not sure i agree @ali. i have no prob. w/ third party libs. they are nice to have. moodle can provide a wrapper to keep w/ convention.

    imo, i think any bloat in moodle is bc of legacy code due to software requirements (PHP <= 4) and adding too much functionality into the project over time.

    i think moodle would be better off if the wiki, quiz mod, forum… etc were removed from core. to me, an lms is a gradebook/reporting app focused around the concept of shared resources. quizzes, forums seem like perfect plugin candidates. i know that they are plugins, but shipped and maintained by moodle.

    if moodle core spent more time on the api (than the feature set) i think there would be more developers bc a cleaner code base is more attractive and lowers barrier to entry for beginners. this would have the positive consequence of increasing functionality as well!

    lastly, i think lines of code is an important metric. it's not the only metric though. but for a web based app it seems too high.

  6. Thanks for the awesome discourse about Moodle’s code base. As a Moodle user I would say that I yearn for simpler interfaces and a more easy to use product (but don’t we all?). Even the most cutting edge technology has its warts, Moodle is not exempt from these issues.

    It is clear however that the robust community of developers is working with Moodle’s best interest in mind (which is an assurance teachers far and wide should understand).

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.