Write first or play/sing first is in discussion, but MORE important
IMHO is 'proofread' what you wrote, again and again.
Often you didn't listen it right at the first time.
(where you thought 'rest', there may be anaccented lower tone and
player may be playing arrpeggio, or You didn't take care to the
vibrate on particular note which was essencial in the phrasing, etc.
I often found such cases while just 'proofreading with doublespeed
tapes'.
muchan