Finding the Best Answer

Finding the Best Answer

... For You.

If you're anything like me, you spend almost as much time on Stack Overflow (SO) as you do on Google. If you're just reading the accepted answer on SO, though, you may be missing out.

On Your Mark. Set. Go!

Sometimes it really feels as though fortune and fame favor the quick and the bold. Before a well-thought-out response that addresses the query point-by-point can be crafted, an answer has already been selected and the netizens have moved on to the next big game. Accuracy and completeness may be relegated to the back seat in this fast-paced environment.

Q&A

In a sense, this is by design. As the asker, you want something that works, and you want it yesterday. You're not going to revisit your answered question in a day or a week to see if something better has been suggested. Your problem has been solved. And you probably have five new problems to solve now.

A Concrete Example

Enough hypothetical. I'll share a concrete example, with my solution that wasn't selected. (Sour grapes anyone?)

In a nutshell, the asker is looking for field validation that will:

  • Ensure Password and Confirm Password match, when populated.
  • Allow Password and Confirm Password to both be blank.
  • Ensure Password and Confirm Password match a given regular expression, when populated.

Responsewhenattempttosignupwithdifferentpasswordandconfirmpasswordinputs.png

Some respondents suggested marking the fields as required. Some suggested custom validation logic. None of the solutions fully addressed the asker's requirements. By the time I arrived on the scene, an answer had been selected and the crew had moved on to fry bigger fish.

I won't replicate my answer here. You can read it in full via the my solution link above. I was able to help others who later came along with similar needs. At least, those that read past the accepted answer.

Don't Settle

In a nutshell, don't settle. If a solution doesn't meet your specific needs, keep looking. In the world of programming, nothing is impossible. It may be cost or time prohibitive, but not impossible.

-- Joe