The centre of the joist lengthwise has the highest bending stress, the ends the highest shear stress, so it's sensible to avoid these places. Regs usually say between 0.25 and 0.4 of the length of the beam.