Art of Electronics: Transistor switch
Janka's answer is a good one, but I wanted to focus in on the transistor current gain thing.  That entire chapter assumes a typical beta of 100. But the following chart from a common 3904's datasheet shows quite a large (normalised) variation of beta depending on temperature and collector current:-



In essence it can change. And if you thought that you might just measure it with a DMM on hFE setting, consider that it changes so that the Ic your meter uses might not be anywhere near your circuit's operating Ic. So you take a conservative estimate for Ic and therefore Ib.  Just to make sure it all works properly.