When installing moldings—particularly baseboard, shoe, crown, and chair rail—it's always better to use a single length to span the room. Unfortunately, that's not always possible or practical.
When you do have to splice together molding pieces, use scarf joints, not butt joints. Scarf joints are much less conspicuous and, if the moldings should shrink — and they almost always do — a revealing gap won't appear, as it would with a butt joint.
To make a scarf joint, bevel-cut the molding ends to 45 degrees, smear them with a little carpenter's glue, then secure the joint with 1 ½-inch (4d) finishing nails.