2
\$\begingroup\$

This question already has an answer here:

I remember seeing a question which caused me to ask myself: "Why even bother writing all that code if XYZ would reliably solve that problem in a few lines?"

Would it be a relevant answer if I proposed the XYZ-based approach?

In my mind, the answer to this question depends on many things:

  • If the question is a puzzle/contest problem/programming exercise, it is okay to provide an alternative within the context of that problem becase that's the whole point of the question. Say, commenting on a better way to select a pivot in quicksort question is fine. Proposing to use a mergesort in the same question is probably not a good idea.
  • If the question is in the realms of real project/production code AND the assessment criteria are NOT provided, proposing an alternative seems to be a nice things to do because this may lead to quality/cost effects that affect end-users in real life.

Am I thinking in the right direction?

\$\endgroup\$

marked as duplicate by 200_success discussion Oct 21 '17 at 18:26

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    \$\begingroup\$ Alternative solutions can make fine answers. You just have to justify why. \$\endgroup\$ – 200_success Oct 21 '17 at 18:27
  • \$\begingroup\$ @200_success Oh boy, I did search for the duplicates and missed that one already exists! \$\endgroup\$ – Igor Soloydenko Oct 21 '17 at 18:29

Browse other questions tagged .