1000 Lines Of Code

written by Scott Watermasysk on Wednesday, November 14 2007

I have a new theory on development, if you cannot build an interesting working version of an application in less than 1000 lines of code, you are likely over complicating things.

What has now become Graffiti is actually attempt number three at building CMS type application that was both functional and interesting. The first two attempts were not bad. The code was good and and the ideas/concepts had merit, but in the end we scrapped them because they just did not feel right. We knew this was a market we wanted to be in, we just did not have the right idea yet.

I was in Zurich, Switzerland in June visiting family I started jotting down some ideas about what I thought I would like to see in a CMS and challenged myself do something interesting with idea in less than 1000 lines of code. The number 1000 is arbitrary, but it kept me super focused on the goal and it is something I will very likely continue to use in the future.

This might seem limiting. But with the number of open source libraries and code floating around you can usually find reusable pieces that will at least get you up and running quickly. Graffiti itself leverages NVelocity, Lucene.Net, RssToolKit, and Prototype. There were others we used, like SubSonic [1] and Script.aculo.us which we used to get us up and running, but later replaced with something that fit the project's goals better.

Graffiti has since surpassed the 1000 lines of code mark and there have been contributions from many other people, but I think the spirit of focusing only on what is absolutely vital still lives on.

[1] I still *love* SubSonic. Without a doubt, SubSonic was extremely instrumental with getting the initial version up and running. The reason we removed it was our desire to support an xcopy database in addition to SQL Server and it just proved to be easier to write our own custom generator than to make this happen under our timeline.

Similar Posts

  1. Unfuddle == BaseCamp For Developers
  2. Graffiti v. Wordpress - Part II
  3. X-Copy Database Options

Comments

  • Jon Sagara on on 11.15.2007 at 11:00 AM

    Jon Sagara avatar

    Scott,

    Will GraffitiCMS be shared-sourced like CS?

    Thanks,

    Jon

  • Jon Galloway on on 11.15.2007 at 6:38 PM

    Jon Galloway avatar

    Scott, I'm guessing your footnote disclaimer was aimed at me, and rightly so. ;-)

    But I can't help asking - just from a curiosity point of view - if you tried SubSonic's SQLite provider? I'm guessing it was overkill for what you're doing, or potentially not available when you needed it, or something. I'm not at all trying to armchair quarterback your data access, I'd just like to know if there's something sucky about SubSonic / SQLite that I don't know about.

  • Scott Watermasysk on on 11.15.2007 at 7:26 PM

    Scott Watermasysk avatar

    Hi Jon S.,

    No, as of now, we will not be releasing the source code.

    Thanks,

    Scott

  • Scott Watermasysk on on 11.15.2007 at 7:30 PM

    Scott Watermasysk avatar

    Hi Jon G,

    It was mostly aimed at Mr. Conery. I have been chatting with him about SubSonic since around the time the project started.

    I tried to use the SQLite provider, but it just was not working for me. I also attempted to write a provider for Access, but query OleDb was a mess.

    What I did was simple write a little API that looks strikingly similar to SubSonic but generates itself off of an XML schema file instead.

    What I would like to see in the future if it would be possible to generate the SubSonic code based on SQLServer, but ultimately write to one or more other data providers.

    Thanks,

    Scott

  • Keith Rull on on 11.15.2007 at 8:01 PM

    Keith Rull avatar

    I agree with what you said Scott. There are alot of libraries ready for the taking that with shorten a developers time of developing software. I too am building a small cms and i'm currently using SubSonic as my code generator and it has served me well.

  • Hank Lynch on on 12.14.2007 at 3:19 PM

    Hank Lynch avatar

    1000 lines of code is awesome. I worked for a company once that had the worst case of code bloat I had ever seen. To prove it, I set out to re-write about as much of their core functionality in less than 1000 lines of code, and in under one calendar month of eves and wknds. Did a damned fine job of it, and the fact that it was under 1000 lines just drove the point home so much more. (We had code behinds with 2500+ lines of code)

Comments are closed