From time to time, especially at first job - there were usually questions - how long will it take to do that, approximately.
Then there are too options - to say shorter time so they will be happy at that moment and then fail to complete in that time.
Another option - say what you really think will take - then they say - its so long, need to do quicker, or this is so simple, how can it take so long.
But from what I seen in experience - it every time takes long to do something.
And also I am not experienced in evaluations of time, because they dont ask me to this too often, at first job they asked bit more often, but how can I be correctly evaluating if I am kind of forced to say short time :D
I found there exists even a book on this thing, but since I rarely have to evaluate, I did not finish it, because I did not see that much value, I can invest my time into something else.
But I need to find something to say, or otherwise I feel bad, I think that they think that I try to say long time so I could be lazy at doing things or something.
Sometimes it is possible to do something quicker at the cost of quality of code, which in long term again might be not so good because it will be harder to change something, but the time you get extra is not so big when comparing quality and spaghetti code.
Also when you do something - its good to think more - if I could do something bit different from what I am used to do earlier - to learn and see if this is better in reality.
So the main question is - what to say, what to think and not feel bad when they say its too long?
If I am that bad quality, why they are giving me such salary. Maybe when they say its so long - they mean the big expense, because of hourly salary. THey could reduce the salary. But also they cannot because some other company is offering ok salary. So its kind of like I have enough quality to earn my current salary.
Update:
Also forget to mention - sometimes there is something that might take infinite time to complete - when its not possible or would need to use different technology which we dont even use. For example there is some app with HTML5 canvas and javascript. It turns out that on slow machines it is not looking good, lot of lag. We know that javascript is not as optimal as java lets say on android phones. Also the best would be to use C++ which has biggest performance, but then again - user need to download and install and I am not even sure if it is possible to write with c++ for androids and iphones. So kind of like you might try optimize javascript, but but how can you say when you finish, if you dont even know if you will reach the desired goal - the performance with not lag on slow machines. So we are just doing, if the boss says that its enought to try, lets remove this feature for this device and use some replacement which would not be that awesome but would require less power of the machine.
So sometimes it is kind of like - you do until the boss allows you to do it. Not until it is finished with desired result. So making estimation maybe should include thing - max hours for that feature, no matter if there is desired result.