A question is raised and two answers are posted:
- The first is a solution that adheres to best practice and industry convention
- The second uses a kludge to get the right result
How should voters act in this situation? Am I encouraged to vote up an answer simply because it answers the question? Should I be down-voting an answer that strays from best practice?
For example, someone may ask how to pull out an attribute from a specific line of XML:
- Answer 1 would demonstrate use of XPath
- Answer 2 uses a regex to extract the attribute.