Category 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).

 

 

 

 

 

 

How to make difficult decisions

When you run a business (even a small business like mine) you have to make a lot of decisions. Many of these decisions are complicated and have to be taken with incomplete information. But you can’t take too long over them, or you will never get anything done. Here are 3 techniques I use to help with difficult decisions.

Break it down

This is a very simple method for breaking a difficult decision down into smaller parts using a spreadsheet.

  • Decide the criteria that are important for the decision. Add a row for each.
  • Add a weighting column. Assign each criteria a weighting in the range 1 to 10, depending on its relative importance to you.
  • Add a column for each option you are considering.
  • Set each criterion/option cell a value in the range 0 to 10, depending on the extent to which the choice for that column fulfils the criteria for that row.
  • Calculate the weighted sum for each column.
  • Choose the outcome with the highest weighted sum.

Here is an example for choosing between 3 different types of hosting:

making difficult decisions

It’s not particularly scientific, but it does force you to systematically break down the problem into smaller parts and justify your decision.

Take the long view

It sometimes helps to stand back and look at the bigger picture. I can think of no better way to do that than to ask a hypothetical (hopefully elderly) future me, lying on my deathbed, which option they approve of. For example, given the choice between adding an innovative new feature to my product or improving the conversion funnel by a few percent, I think future me would be happier that I chose to add the innovative new feature. It is also a useful reminder that many decisions probably aren’t all that important in the grand scheme of things.

Flip a coin

Sometimes you need to make a decision, but you don’t have enough information or the time taken to get that information is going to cost you more than making the wrong decision. In that case, don’t agonise over it. Just roll a dice or flip a coin and move on.

My new product : Hyper Plan

scrum kanbanI have just launched a new product. First some back story. A few years ago, my wife and I were renovating the house we live in now. Trying to schedule and track all the different tasks, tradesmen and quotes was a real pain. We stuck Post-it® notes onto a whiteboard to try to keep on top of it all. The Post-it notes represented the various jobs that need doing. We placed them in columns (representing what stage they were at: needs quote, accepted quote, scheduled, doing, done) and rows (representing the various trades: plumbing, roofing, electrical etc). It worked, but it was far from ideal:

  • I wanted to see status vs trade, status vs room and room vs trade. But changing the layout was a pain, so I had to pick one layout and stick with it.
  • Colours were useful for extra information. But we were limited to just the few colours that Post-it notes come in.
  • There was only limited space to write on the note.
  • My wife couldn’t read my handwriting.
  • We had to use a separate spreadsheet to track the budget.
  • Post-it notes would fall off and get lost after being moved a few times.
  • I ran out of Post-it notes.

That is when the idea of Hyper Plan first occurred to me. It has been burning a hole in my brain for the last 5 years. Now I have finally got around to implementing it.

Hyper Plan is Post-it note style planning, implemented in software. In software you are no-longer limited by the number of Post-it notes you can afford, the amount of wall space you have or the number of colours Post-it notes come in. You can even change the layout and colours with a mouse click. All with animation and easing curve loveliness.

The sorts of planning you can use it for include:

  • project planning
  • planning what is going into your next software release
  • event planning
  • Kanban / Scrum / Agile
  • planning a holiday
  • to do list (I know!)

Anything where you have discrete tasks that you want to be able to categorize (e.g. by person, status or type), schedule or track in a visual form.

Here is a 2:42 minute overview in video form (with audio):

Hyper Plan videoCan’t see the video? Try this mp4 version (10.7 MB).

Hyper Plan is quite different to anything else I have seen. That could be a good thing or bad thing. I am putting out an early beta to try to find out.

Hyper Plan is not currently for sale. I don’t want to take the time to set up all the payment processing and licensing until I am confident someone might actually buy it. The current beta version will run completely unrestricted until 17-Jan-2015. There are Windows and Mac versions. Hopefully a commercial version will be available for sale by the time the beta expires. If not, I will release another free version.

Currently it is very much an MVP (minimum viable product).

  • The UI is a bit rough around the edges.
  • The logo was done in 5 minutes in Word.
  • The documentation is just a quick start guide.
  • Some important features are not implemented yet (e.g. printing, exporting and undo).

But I have tried to follow my own advice and resist foul urges to spend months polishing it (which is hard!). What is there is pretty robust though, and I think it demonstrates the concepts. Hopefully I will know in a few weeks whether it is worth taking the time to polish it to commercial levels.

I would love to know what you think. Particularly how useful you find it for ‘real’ planning tasks. Even responses of the form “I wouldn’t use this because…” are helpful. Please also email a link to anyone else you think might be interested. Particularly if you have ever seen them sticking Post-it notes to a wall or swearing at Microsoft Project! My contact details are here.

buttonFAQ

Q: Why is it desktop, rather than SaaS/mobile?

A. I think stories of the death of desktop software are exaggerated. Also:

  • I can build a minimum viable product much quicker for desktop.
  • Differentiation. Some people prefer desktop apps, e.g. because they don’t have reliable Internet or don’t want to store their data on third party servers.
  • Less competition. Everyone else seems to be doing SaaS/mobile.

I might add SaaS and/or mobile versions later, if there is enough demand. Note that DropBox (or the Google, Microsoft or Apple equivalents) allow you to easily sync a Hyper Plan file across multiple computers.

Q: So it’s Trello for desktop?

A. Not really. I had the basic idea before I ever saw Trello. And I’m not stupid enough to compete with a free tool from the great Joel Spolsky! Trello is great at what it does. But Hyper Plan is different in quite a few ways. In Trello the emphasis is on collaboration and workflow. In Hyper Plan the emphasis is on visualization and planning. Hyper Plan allows you to present your information in lots of different ways with a few mouse clicks. It also has a built in ‘pivot table’ type feature that is much easier to use than Excel pivot tables. This is really useful for totalling effort and expenditure by different categories.

Post-it is a registered trademark of 3M.

The scrum photo is licensed under creative common by Logan Ingalls.

80 useful tools and services for software businesses

tools and servicesSome of the most useful nuggets of information I come across in blogs and podcasts are mentions of tools and services used by other people to better run their software businesses. So I have put together my own list of useful tools and services to run a software business.

Feel free to recommend your own favourites in the comments below. Please include your relationship to the tool/service (e.g. customer, user, employee or owner). You can also comment below about your experiences (positive or negative) with any of the tools and services listed. Anonymous comments will be treated with suspicion and may be deleted

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.

Pivot Tables demystified

pivot tablesOnline businesses generate a lot of data. Sales data, marketing data, traffic data etc. Pivot tables can be a useful tool for analysing and extracting useful information from this sea of data. A lot of people seem to have heard of Pivot Tables without understanding what they are or how to use them. Despite the slightly cryptic name they are really just a way of summarizing tables of data. Nothing to be intimidated by. I’m going to try to demystify them here with a simple example.

Let’s imagine you have got an Excel spreadsheet with a month of (fictitious) sales transaction. It looks like this:

sales spreadsheet

You want to find out:

  1. The total value of sales of each product
  2. The number of sales of each product
  3. The total value of sales of each product by country
  4. The total value of sales of each product by day of the week

How would you do it? You can crunch the numbers using a calculator, but that is very tedious and error prone. If you are a programmer you can export the data to a .csv file and write a small program in your favourite language to read it in, crunch the data and write the results out. You probably think you can do it in 10 minutes, but I bet it will take you at least an hour to get it working and debugged. I did all the above in 1 minute and 20 seconds using Excel pivot tables.

Here is how you can do it (screenshots from Excel 2007). You can download the spreadsheet if you want to try it yourself.

Select all the data, including the header (A1 to D222).

Click on Insert in the Excel Ribbon bar.

Click on PivotTable.

pivot table 1

The Create Pivot Table window will appear. Click OK.

pivot table 2

The PivotTable Field List will appear. We want to find the number of sales for each product. Drag the product field to Column labels and the value field to Values. This gives us the total value of sales by product.

pivot table 3

To change this to the number of sales pull down the Sum of value drop-down list and select Value Field Settings….

pivot table 4

Change Summarize value field by from Sum to Count and click OK.

pivot table 5

The number of sales of each product are now shown.

pivot table 6

Now drag the country field to Row labels. Then click on Count of value, select Value Field Settings…, change it back to Sum and click OK. The total value of sales of each product by country is now displayed.

pivot table 7

We now need to add a day of the week column. Click on Sheet 1 and add a new column as shown.

pivot table 8

Now select all the data from A1 to E222 and insert a new pivot table, as before.

pivot table 9

Drag the fields as shown to get the total value of sales of each product by day of the week.

pivot table 10

(We’ll quietly ignore the fact that the number of days aren’t divisible by 7 in the data.)

We can even display by product, day of the week and country with one more drag.

pivot table 11

Excel also supports pivot charts if you prefer your results in graphical form.

pivot chart

Obviously this is a very simple example, but pivot tables can be used to quickly analyse much larger and more complex data sets. Next time you have got some data to analyse consider whether you would be better using pivot tables or pivot charts.

*** UPDATE ***

You can also use my Hyper Plan software to create pivot tables. It is a lot simpler than the above! There is a free trial.

Is it possible to run a successful software business with a 4 hour work week?

Tim Ferriss’ ‘Four Hour Work Week’ is a thought provoking, but controversial, book. One of the central ideas he promotes is that you should be able to use outsourcing to create a money making business (‘muse’) that you can run in only a few hours per week. Leaving you with enough free time and income to travel the world, learn to tango or otherwise amuse yourself. But I am highly sceptical that anyone can sustain, let alone grow, a software business long term, working only 4 hours per week. I have run my own business working less than 10 hours week for a month or two at a time while travelling or doing house renovations. But it only gave me enough time to keep things ticking over. I wasn’t able to improve my product or marketing. I am sure my business would decline in the face of technological changes and hungrier competitors if I kept this up for too long. I have spoken to other owners of small software businesses and they were of a similar opinion.

So I was interested to see a case study on the Four Hour Work Week blog from someone running a software business. Brandon Pearce owns musicsteachershelper.com, a slick-looking web based app for music teachers.

He says that after 5 years he is making $25k in sales per month with $10-12k in expenses per month[1] and no employees[2]. So that is a net profit of around $168k per year. That’s not too shabby, especially when you consider that he lives in Costa Rica and says he works just 5 hours per week. That’s nearly $650 per hour!

But he doesn’t say how many hours per week he worked to build the business. He also says in the case study:

With a complex web application, you can’t write it once and be done; you need to continue making enhancements and listen to user feedback in order to have a successful product.

I couldn’t see how this squared with working only 5 hours per week. Even if you are outsourcing everything you still need to manage the outsourcing, which can be time consuming in itself. I emailed him for some clarification and he was kind enough to give some more details:

It’s hard to give an average time worked over the past five years, since it’s changed so much. The first two years I was also working full-time as a programmer, but spent most of my free time working on the site – probably 10-20 hours per week. Once I quit my job (years 3-4) I worked probably 40 hours per week on the site. The past year or two, it varies from week to week. Some weeks I’ll only work 2 hours on it, some I’ll work more like 15, if I’m preparing for a new feature, special offer, or doing a big launch of some kind. But these days I’m averaging about 5 hours per week, and it’s been that way for well over a year.

Yes, I can definitely sustain and improve profit levels at this number of hours. The business is a well-oiled machine, and I have teams that are working to help continue to improve and grow the business in various ways, largely without my constant supervision. The business continues to grow every month, regardless of how much I work.

What do I spend these 5 hours doing? Mainly reviewing the new features or bug fixes the programmers have been working on, the requests from customers that the support team has submitted, and determining which items I want the programmers working on next. I also spend a little time handling some of the more difficult support or billing issues, paying my workers, managing a few PPC campaigns, answering e-mails, and checking stats. Recently, I’ve also been writing the scripts for some new video tutorials, and finding people to help produce the videos, too.

So, pretty much everything I do at this point could also be outsourced, allowing me to work even less, but at this point, I still enjoy this work, and it allows me to keep some important aspect of control on the business. Some day I may decide to work even less, but I’m pretty happy with 5 hours at the moment. :)

So, unsurprisingly, it took a lot more than 5 hours per week to reach this point. And only time will tell whether he can continue to maintain (let alone grow) this business with such minimal input. It will be an impressive achievement if he can. But I think Brandon is the exception rather than the rule. Perhaps he is particularly talented or lucky. Very few of the successful software business owners I know work short hours for extended periods. Also I have no way to verify Brandon’s numbers. So I would recommend viewing Brandon’s case study as something to aspire to, rather than a likely outcome.

Brandon has a blog and is writing a book about his experiences creating MusicTeachersHelper.com “in the hopes that it will help others who want to do something similar”. It should be an interesting read. Given all the spare time he has it shouldn’t take him long to finish it!

Further reading:

http://brandonpearce.com/2009/02/i-lived-a-4-hour-work-week/

http://brandonpearce.com/2009/04/how-i-spend-my-time/

[1] He mentions the expenses in the comments.

[2] He does use several contractors, some of whom work full time.