Music teacher with degree here, the Stack Overflow answers are correct as far as modern usage goes, with respect to common-practise tonal harmony at the very least. Your second reason is just an alternative way of phrasing all of the answers that cite F major as an example.
Yes, in non-equal temperaments they can be different pitches, but I highly doubt that someone asking the difference between sharps and flats is concerned with niche subsets of early music and contemporary classical.