3 ms·
I tend to agree with the author, but there are times comments are the only way to help the next guy looking at the code. Like when you're using workarounds. E.
by herdcall 16y ago
I tend to agree with the author, but there are times comments are the only way to help the next guy looking at the code. Like when you're using workarounds.
E.g., I was recently writing for a JPA entity on Google App Engine where I tried using a @PrePersist function to update a field. Turned out that GAE won't call the @PrePersist unless a field is updated first...i.e., catch 22.
So, say as a workaround you add an artificial update to the field to null just so your @PrePersist is called, what are the odds that the next guy reading the code without a comment won't just delete that assignment thinking it's unnecessary?