58
12
I don't want to make life hard for management. I really don't. They're nice enough guys, but every time I am assigned a new project or task and get asked "how long do you think it will take to do this" I end up sputtering off ridiculous timeframes; "between a day and three weeks".
I would like to believe that it's not entirely my fault: I am the company's sole programmer, I am relatively new to proper development (Was it only six months ago that I wrote my first unit test? sigh...), and I am working with a code base that at times is downright absurd.
So I would like some advice. Obviously, experience is the biggest thing I lack but anything that would make me better would be greatly appreciated. I am looking for reading material, methodologies, maybe even actual tools. Any way that I can give my boss more accurate information without having to sit down and design the darn thing first is appreciated.
Ok magic stackoverflow genie, what have you got for me?
EDIT:
@Vaibhav and others suggesting I take time to research and sketch out the system
I agree with you in principle, but how do you balance that with real-world constraints? When you're a one man show or even a part of a small team "I will need 2 days to build an estimate" is a real deterrent when you can fight 4 fires in the time it takes to get a simple estimate.

@gnat Possible duplicate, yes. But preceded that question by 2 years. – George Mauer – 2013-05-21T20:52:19.640
Two dice, 12 sided for month, 24 sided for day of month. When asked to guesstimate with insufficient information, I roll the dice. Next year if the date is too soon. – ChuckCottrill – 2013-10-09T05:56:23.197
Why should that be a deterrent? Do (building) architects take one day to make an estimate for putting up a skyscraper? I don't think so. – Jon Limjap – 2008-09-10T17:33:00.180
4No, but my boss thinks so.. Actually, I usually have to give an estimate there, right on the spot. – None – 2008-12-10T12:11:12.427
1+1 for boris. My boss also demands estimates on the spot. Even if I ask if I could get back to him in a few minutes, he always seems to squeeze some sort of bull** estimate out of me right there, as if giving me a few minutes is too much time to spend on an estimate. – None – 2009-08-17T15:08:58.393
5if It makes you feel any better its hard to estimate any development task that is non trivial. You can run into issues and if you have to deal with other development groups forget about it. Guess then reestimate and keep you management informed is about all you can do. – rerun – 2010-02-16T21:10:55.473
1I'd typically do some research up front to see what I'm getting into. Once I have a general feel for whats involved, I give my estimate in a [best case] - [worst case] amount of time, there is usually a pretty large span. You don't want to give an estimate on something you know nothing about. Do some research first. If you are put on the spot, ask for some time to do research and see what that task will take and then give a response later. – None – 2010-02-16T21:21:40.833
1Estimation with some managers is practically a negotiation. Also beware the question 'is this low risk, medium risk, or high risk?' especially in conjunction with the time estimate questions. When you get these wrong, and you will, managers will have leverage to "manage" you more to try to get more work out of you. Better to add some padding -- after all, they will suspect you of padding it some anyway. – None – 2010-02-16T22:16:39.890
Hofstadter's law : http://en.wikipedia.org/wiki/Hofstadter%27s_law
– None – 2010-02-18T14:53:05.0172Six to eight weeks. – Aaronaught – 2010-02-18T15:24:16.890