Prefix coding (sending the size of the message first) makes the code simpler, but has a problem when it comes to recovering due to communication errors. Once sync is lost it likely won't recover. SLIP can help with this. It automatically resynchronizes producing bad but segmented frames. Adding error detection can filter out the bad packets.