• ITVidya.com One Purpose...One Dream...One Vision..One Mision..Your Wealth Creation through Knowledge, Networking and Opportunity

How many lines of code do you produce per hour

Today I took an exercise. I tried to test how many lines of useful code can I produce per hour. Before going into the results, I will tell you about the strategy I adopted to take this exercise.

Test Problem:
Problem had to be something that I understood very well and could finish in one hour using the tools I best know. I decided on a  simple discussion list, which allows you to add a topic and reply to it. No user authentication and no fancy UI's. Seems doable in one hour.

Class and Database Design
Step one was to define the class design and database schema for our discussion list. I took an object oriented approach instead of writing standalone scripts. It took me arround 15-20 minutes to fully document the class and database design.
Two classes one for topic and other for comments are to be implemented, for features like new topic, edit topic, delete topic, new comment, edit comment and delete comment.

Start coding:
I took this test once using PHP and once using python. The results are below.

  1. PHP: I used plain PHP with native mysql libs and no PEAR or any other libs were used. Two classes, when finished, were arround 150 lines of code, without comments and took arround 55 minutes.
  2. Python: I used sqlite for database and and CGIHTTPServer available in standard library of python distribution. Design remained same and it was arround 100 lines of code and time roughly the same, 55 minutes.
  3. These 55 minutes do not include HTML design.
  4. Note that python normally requires less amount of code that other languages to get same thing done.


But this was just a toy problem and not a real world problem.  Well, I am doing this kind of study these days a lot. These day, I am maintaining an extensive log of time I spend on coding. So, far results don't seem very encouraging.

Alien Problems:
Problems about which I know nothing, those have seen them for first time:
12 lines of usefull code per hour :((, includes thinking on it :|

Some what, I know problems:
Problems, that I know about but have not solved before.
33 lines of usefull code per hour, including thinking

Ah, I have done that before:
63.5 lines of useful code per hour

powered by performancing firefox

mirnazim's picture
 

mirnazim's picture
Hi Ajay, Actually, I
Show / Hide Comment

Hi Ajay,

Actually, I normally blog from blogging tool called Performancing(http://performancing.com/). It is generally faster and relaible. But, It does not support appending Signature to it or including tags. If you know of some tool that supports such operations do let me know.

Moreover, very very thanks for encouraging comments.

Mir Nazim
http://www.xensoftlabs.com
http://mirnazim.wordpress.com