"His health problems can be attributed to not eating well."
"His health problems can be attributed to him not eating well."
Are both these sentences grammatically correct? Is there any reason to use one over the other? Also, I understand using "...attributed to a poor diet," might be a better way to phrase things. But I specifically want to know if these two sentences are grammatically correct and if there's any reason to use one over the other as well as if there's a difference in what these sentences mean. Also, is the first sentence vague?