I have been once taught (by my former programming teacher; he worked for big software companies in Germany and Japan) the most essential truth about software development ever:
You cannot estimate how long a programming task will take; period!
I know that there are Mio of people who disagree, but I think this is absolutely true. Let me add some more quote
Programming is not like building a house over and over again. If you build your first house, you have no idea how long it will take to build a wall, make the roof or creating one square meter of floor. Once you did all this, you know how long it took and when you build your second house, you know that it will take about as long as it did the first time, if not faster, since you are getting better at a task the more often you are doing it.
Every piece of code you write is a new piece of code, you are never repeating the same task again. Why would you repeat the same task? If you ever need the same code again, you copypaste it; that will take you about 5 seconds. If you ever need the same application again, you just copy the one you wrote last time.
A software developer faces the problem that he needs to write new code every day, as there is no point in writing old code again. So every time the task is a new task for you. It’s like you are building a house today, a car tomorrow, and creating a lovely garden the day after tomorrow; and you are always doing it for the first time. How can you estimate in advance how long you will need for it?
This so very true! After years of development I can assure you, I’m doing something new every day. I’ll continue to quote:
Thinking you can estimate a task you have never done is just an illusion. You can make a vague guess, sometimes it’s good, sometimes it’s horrible. Sometimes you need twice the time and sometimes only half the time you estimated.
Actually all my time estimations are, well, I just make up these numbers. I have no basis for them. I could role a dice and the numbers would be as accurate as they are today. Quoting again:
Programming is like art. Ask an artist how long his next painting will take. Do you guess you can get a reliably estimation? His picture is done, when he considers it done. He can’t say in advance how long it will take. He might be 99% done and then consider some things need to be repainted and within a couple of minutes the state falls back from 99% to below 80%.
There will be the day where software developing companies are going to realize that. That’s why OpenSource software is often better in aspects like performance or security; it’s not time based. It’s done when it’s done. The developers themselves decide when it is called 1.0, not some marketing department or some supervisor. If they consider something a nasty hack, they’ll fix it, even if this means it takes another 3 weeks for the software to be done.
As odd as this might sound, but I personally would prefer if the time frame is set from above. I can surely make a list of all tasks to be done and show them to my supervisor every day; but I can’t say how long each of these tasks will take.
It’s a different situation if my supervisor says Okay, for that, you have one day; for this one, it’s very important, you may take up to three days; and for this tiny one, investing more than half a day won’t pay off. If I know that I have only one day for this task and I start in the morning, I know it needs to be done before I call it a day. That means at the end of the day it’s done. Whether it’s good or not, whether I would consider it done or not, doesn’t matter. It’s done, because the time frame says it has to be done and if it’s far from perfect, far from good, far from reliable… it’s not my problem. The time frame dictates me when it has to be done.
If my supervisor then looks at the result and says I’m not happy with it. This is too unstable, too slow, looks too much like a hack, I will reply Well, you only gave me one day, that’s the best I can come up with in one day. Give me more time and I will make it better. Then it’s up to him to give me another day or maybe two days, to make it really good; or maybe not and it will stay as it is right now.