I love React's dangerouslySetInnerHTML which replaces a lot of documentation and comments and forces the user to understand what's going on. If you don't know why it says "dangerous", you can look it up.
Much better than
//This is dangerous, read this post about XSS:setInnerHTML
Because the comment would never get ported across all the use cases (obviously, given it's a library).
But most code doesn't live up to the scrutiny of library code and comments, used properly, are a perfectly reasonable part of the toolbelt.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I thought to make this thread based on a conversation I was having in @aspittel 's great clean coding post.
I love React's
dangerouslySetInnerHTML
which replaces a lot of documentation and comments and forces the user to understand what's going on. If you don't know why it says "dangerous", you can look it up.Much better than
Because the comment would never get ported across all the use cases (obviously, given it's a library).
But most code doesn't live up to the scrutiny of library code and comments, used properly, are a perfectly reasonable part of the toolbelt.