How do you determine how long something will take you to do?

Any tips on that? I recognise that the majority of the time, it has nothing to do with unclear expectations - it's code I wrote, that I thought would take about X time to fix, and about 25% I'm not quite correct. I'd say about 5% of the time I'm completely way off (4 hours vs 40 hours sort of way off). I'm open to any suggestions - is there a document I should be keeping that allows me to better see the relationships between structures I may have forgotten since I wrote it originally? Any tools that help me visualise my code process? You know what I mean?

I'm getting better at this for sure, but there are still times I'm off. I'd say at this point I'm more likely to think it'll take longer, and once I start working on it, realize it's a simple fix, rather than vice versa. But I'd still prefer to learn to get a good grasp on what's going on.

I guess one way is to debug until find the root of the issue, but even that sometimes takes longer than I can spare (say, I have 30 minutes before I have to say how long a fix would take, and I can't debug it in time, so I guess).

/r/cscareerquestions Thread Parent