You know how on a plane the flight attendant tells you to make sure your oxygen mask is on before helping others (in case of emergency)? I think of coding well and documentation the same way.
How can I help you without first helping myself?
This is what I tell our junior devs. I remind them that the "next developer" may well be themselves in a year's time.