Actually, there is a way to calculate the length of the transaction
before sending it:
10 + (148 * I) + (34 * O) + I
Where I is the number of inputs, O is the number of outputs in the transaction. This assumes that all inputs are spending normal "pay to address" outputs, and all the outputs are normal "pay to address" outputs as well.