I'm contracting with an awesome company that gives me challenging work and is very supportive. Occasionally I can't figure out why my code isn't working. Classic programming, but I feel bad billing the time spent troubleshooting. (Sometimes I'm stuck for hours.) Do you charge for this kind of "work"?

  • 3
    This sounds like a prefect question for the Freelancing site. Commented Jul 28, 2018 at 14:51
  • do you mean diagnosing a problem, like a surgeon who encounters something unexpected?
    – dandavis
    Commented Jul 30, 2018 at 16:58
  • 1
    As you get more experienced your rate goes up. This is not because you type faster; its because you get more skilled and generate less bugs and therefore spend less time debugging and more time generating useful code. Commented Jul 30, 2018 at 22:22

5 Answers 5


Are you debugging your code during those hours you are "stuck", or are you walking your dogs? That time is not billable if you are walking your dogs. If, on the other hand, you are debugging the code you have written, that is a core part of the programming process. So is determining what you think you are supposed to do prior to writing the very first line of code. The time spent writing lines upon lines of deliverable code should represent a small fraction of ones time while programming.

Except for toy problems, nobody writes code that is perfect from the very start. Once you get past that initial testing stage, there likely remain ten to fifty bugs for every thousand lines of code you have written. Getting that defect rate below one bug per thousand lines of code is one of the key reasons why concepts such as agile and test-driven development have been developed.

  • I wouldn't be so sure some times getting away form the screen and walking the dogs whilst thinking about the problem is a useful way to get round a block Commented Jul 29, 2018 at 10:41
  • @Neuromancer - I use that technique frequently. While it oftentimes does help me solve the problem on which I am working, I do not bill for that time. Commented Jul 29, 2018 at 11:55
  • @Neuromancer if I were working at an office, I would not expect to get paid if I went on a walk for an hour to just clear my head. While it certainly is a helpful idea, it shouldn't be billable time, even if you are thinking about work. Commented Jul 31, 2018 at 20:15
  • @lukebeast887 developers are salaried professionals you don't normally get paid by the hour. Commented Jul 31, 2018 at 20:52
  • @Neuromancer Perhaps I should clarify, what I meant was that I wouldn't count that as part of my 8hr (or however many hours you usually have per day) workday. Commented Aug 1, 2018 at 13:13

If you where employed by the company there would be no question about getting paid for the time. As a contractor you should bill for that time also and having that knowledge gained from that work is sure to help down the road.


Developing software consists of three steps: Design, coding, fixing problems. No software works after the "coding" step. Since you are paid to develop working software (I assume), the customer needs to pay for all three steps and you are fine to bill for all three steps.

If you think your skills finding and fixing problems are too low, then there are other sites to ask questions about this.


Do you charge for a full eight hours if you solve the problem in 2? If not, then you shouldn't discount the hours you spend figuring things out.

Programming is thinking, not typing. It's all part of the process of getting things done.

  • If your agreement with the customer is that you are paid by the hour, then yes. Your customer buys you "as a package" with your things where you are fast (since you already know how not to get stuck) and the thing where you are slow (e.g. get stuck when you don't know the solution already).

  • See if the quality of the code is right - and not too high. If you get stuck on things which could have been easy, but you took the hard way, consider if that was needed. (e.g. not using an n log n algorithm instead of an n^2 algorithm is not always the end of the world.)

  • If you or your customer feel very uneasy about this, consider changing to a more well defined way of defining work packages and not being paid by the hour.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .