Tag Archives: productivity

How much code can a coder code?

Lines of code (LOC) is a simple way to measure programmer productivity. Admittedly it is a flawed metric. As Bill Gates famously said “Measuring programming progress by lines of code is like measuring aircraft building progress by weight”. But it is at least easy to measure.

So how much code do programmers average per day?

  • Fred Brooks claimed in ‘The Mythical Man-Month’ that programmers working on the OS/360 operating system averaged around 10 LOC per day.
  • Capers Jones measured productivity of around 16 to 38 LOC per day across a range of projects.
  • McConnell measured productivity of 20 to 125 LOC per day for small projects (10,000 LOC) through to 1.5 to 25 LOC per day for large projects (10,000,000 LOC).

It doesn’t sound a lot, does it? I’m sure I’ve written hundreds of lines of code on some days. I wondered how my productivity compared. So I did some digging through my own code. In the last 12 years I have written somewhere between 90,000 and 150,000 C++ LOC (depending on how you measure LOC) for my products: PerfectTablePlan, Hyper Plan and Keyword Funnel. This is an average of round 50 lines of code per working day. Not so different from the data above.

I also looked at how PerfectTablePlan LOC increased over time. I was expecting it to show a marked downward trend in productivity as the code base got bigger, as predicted by McConnell’s data. I was surprised to see that this was not the case, with LOC per day remaining pretty constant as the code base increased in size from 25k to 125k.

loc

Some qualifications:

  • I give a range for LOC because ‘line of code’ isn’t very well defined. Do you count only executable statements, or any lines of source that aren’t blank?
  • My data is based on the current sizes of the code bases. It doesn’t include all the code I have written and then deleted in the last 12 years. I have just spent several months rewriting large parts of PerfectTablePlan to work with the latest version of Qt, which involved deleting large swathes of code.
  • It doesn’t include automatically generated code (e.g. code generated by the Qt framework for user interfaces and signals/slots code).
  • I only counted code in products shipped to the user. I didn’t count code I wrote for licence generation, testing etc.
  • All the code is cross-platform for Windows and Mac, which makes it more time consuming to write, test and document.
  • Programming is only one of the things I do. As a one-man-band I also do marketing, sales, QA, support, documentation, newsletters, admin and nearly everything else. I have also done some consulting and training not directly related to my products in the last 12 years.

Given that I probably spend less than half my time developing (I have never measured the ratio), my productivity seems fairly good. I think a lot of this may be the fact that, as a solo developer, I don’t have to waste time with meetings, corporate bullshit and trying to understand other people’s code. Also writing desktop Windows/Mac applications in C++ is a lot easier than writing an new operating system with 1970s tools.

50 lines of code per day doesn’t sound like a lot. But the evidence is that you are unlikely to do much better on a substantial project over an extended period. Bear that in mind next time you estimate how long something is going to take.

If you have data on LOC per day for sizeable projects worked on over an extended period, please post it in the comments. It will only take you a few minutes to get the stats using Source Monitor (which is free).

 

 

 

 

 

 

Buying a lean, mean, compiling machine

Nearly two years ago I wrote an article about speccing my ultimate development PC. Somehow there was always something more pressing to do. But I finally took delivery of my shiny new PC this week, partly spurred on by the fact that I wanted tried and trusted Windows 7 for the OS. Also my current development PC is getting increasingly crufty after 5 years of continual use.

I emailed my requirements to the top 3 custom PC companies in the UK as rated by PC Pro magazine : Chillblast, Cyberpower and CCL:

Hi,

I’m looking for a PC for developing software. Prime requirements in order of decreasing importance:

1. reliability
2. cpu + disk speed
3. quiet
4. value for money

Here is my wishlist of components:

-i5-3570K CPU
-an SSD (at least 128 GB) + 2 fast and reliable HDDs (7200 rpm, at least 1 TB each)
-ASUS, Gigabyte or EVGA motherboard supporting USB 3.0 and SATA/600.
-16 GB of fast RAM
-Windows 7 64 bit professional
-quiet is good, open to suggestions on sound insulation, fans and/or passive cooling
-AMD Radeon HD 6850 graphics card
-at least 2 USB ports on the front and 2 USB ports on the back (ideally more, ideally including USB 3.0)
-DVD drive
-Gigabit ethernet
-full size case
-kensington security slot, so I can lock it to the ground
-I don’t need a monitor, keyboard, mouse etc
-I don’t need WiFi
-It has to be *super reliable* – I want reliable SSD + HDDs, good quality motherboard, good quality branded power supply etc.
-target price, not more than 1,500 inc VAT, less is better obviously

Can you build something to meet this spec or get close? Please send me the spec and your price (including UK delivery).

Both Chillblast and Cyberpower sent me quotes for a system fairly close to what I wanted within 1 working day. I then spoke to their sales people and went online to tweak their suggested systems using their web based system ‘configurators’. In the end I chose Chillblast over Cyberpower due to:

  • higher rating from PC Pro readers
  • cheaper for a comparable system
  • better warranty
  • better online configurator (I found the number of choices on the Cyberpower online configurator a bit overwhelming)

However there really wasn’t a lot in it. CCL took nearly 2 whole working days to respond to my initial email,  so I discounted them as insufficiently responsive.

Following some suggestions made by the sales people I spoke to, this is the spec I ended up with:

  • Chillblast Fusion Longbow
  • Windows 7 Professional 64 bit
  • Onboard High Definition Audio
  • Corsair CX 750W 80 PLUS Bronze Certified PSU
  • Sony 24x DVD-RW Drive
  • Seagate Barrcuda 2TB 7200RPM Hard Disk
  • AMD Radeon HD 6850 1024MB Graphics Card
  • Intel 120GB 520 Series Solid State Drive
  • 16GB Corsair PC3-12800 1600MHz DDR3 Memory
  • Asus P8Z77-V LX Motherboard
  • Akasa Venom Voodoo Ultra Quiet CPU Cooler
  • Intel Core i5 3570K Processor 3.40 GHz (No Overclocking)
  • Fractal Design Define R3 Low Noise Case – Black Pearl – USB 3.0 Edition
  • Total price: £1089.80 + VAT (inc MSOffice Home Edition)

I take security fairly seriously. I have a motorbike style ground anchor in my office and I want my shiny new box physically locked to it. But I was told that almost no PC tower cases have a Kensington lock slot. This seems crazy to me. My current Dell tower has one and the cost of one tiny little extra slot in the chassis must be pennies. So I had to buy a lock adaptor kit. It’s not the most elegant solution, but it works fine.

I ordered the system on 02-Oct and it arrived on 22-Oct. Here are a couple of photos of the new system with the side panels off.

The PC took a few days longer than the originally advertised time to arrive. This wasn’t a big issue in my case. But I only found out it was going to be late when I emailed them after the expected completion date. It would have been a lot better if they had been more pro-active and emailed me first. Other than that I am fairly satisified with the service from Chillblast so far.

There are a few issues with the case, which aren’t really Chillblast’s fault. It looks rather lovely in its big, black, minimalist sort of way, a bit like an obelisk from ‘2001 a space Odyssey’. But the case scratches rather easily if you lay it down to change a component on my laminate floor. The side panels are also a bit fiddly to get on and off (my old Dell PC is better in this regard). Worst of all, it has rubber grommets (is that the right word?) that fall out into the case (and potentially into the fan or heat sink) if you even look at them funny. This means lying the case down to retrieve them, struggling with the side panels and more scratches. I have had to do this at least 4 times so far. It seems that they have made them of rubber that is far too soft for the job. Grrr.

How fast is the new PC? It certainly feels very snappy. I benchmarked it against my old Dell development PC (Dual Core 2.13 Ghz, 4GB RAM) building my event table planner software from scratch. This is 83k executable lines of C++ according to SourceMonitor:

Build time Old PC New PC
Debug build 6 minutes 56 seconds 1 minute 32 seconds
Release build 6 minutes 23 seconds 1 minute 28 seconds

So it is more than 4 times faster than the old PC at its key task – building software. Admittedly it isn’t a ‘fair’ comparison of the hardware. The older machine has a different version of Visual Studio, a different OS and probably some unnecessary services running in the background. But it is the best I can do in the circumstances and I doubt a ‘fair’ test would be much different. Despite the fact that I only went for a mid-range graphics card, the new PC can also handle playing Half-Life 2 on full 1920 x 1200 resolution without any noticeable issues. Hopefully the faster build times will give a significant boost to my productivity (as long as I don’t play too much Half-Life 2).

The new PC is also eerily quiet. I would guess more than 4 times quieter than my old PC. Even when it is doing a build, all you can hear is the faint whir of a fan.

Only time will tell how reliable it is.