I've got two examples.
- Someone has made some example code where they are trying to
eval
user input, so that "users can customize the website freely". They seem to be completely oblivious to the fact that the approach is... ridiculous and are only asking about something like "how can I make it so it does x" or "why am I getting this error".
Let’s say that what they are trying to do is entirely possible and the problem is easy to fix as well. Should I only answer what was asked? Should I answer and warn that this is not the way? Should I not answer at all, or give an answer where I basically implement the whole thing correctly from scratch and show that this one doesn't have the issue?
- Someone is asking about how to sum and fill some values of every row on a table, to the last column of every row. They have some example code doing this by using jQuery to loop through all the cells of the last column and to get the value of every other column than the last one of each row. Their actual question is, however, "Why am I not getting the value of column n of row m".
Should I address that the method he is using is slow, prone to errors, outright weird (because why would you read values from the DOM and not have some dataset behind the table to begin with), and unnecessarily hard to implement too? Should I just answer with a better method saying that this is a great deal better way to do this whole thing?
### Heading
and---
hrule markdown are very useful for separating parts of an answer.)