Programming is a creative task, it cannot be strictly estimated. Somebody mentioned Evidence-Based Scheduling, and it's the best way to estimate ("doing X is similar to Y, and it took Z hours, so it will be unspecified amount of time, but probably around Z hours"