You were too close though, if you weren't the. You wouldnt have hit him.
Why do you think braking distances are part of the UK driving theory test? It's to teach you how long, potentially, it can take you to stop. I used to question the reason for them not changing over the years, as the braking distances were calculated in the 60s or something like that, but given the amount of people that still don't allow appropriate braking distances I can see the reasons they haven't been updated.... As they aren't being adhered to anyway.
You were unlucky in a way to be fair. People drive too close to the person in front all the time, I moan at my wife constantly for it. In this particular case you didnt take the necessary precautions and it bit you on the bum. On another day you would have been lucky.
As I said at the beginning, take it with you and learn from it. This time it was a fender bender, consider yourself lucky in that instance