We all know the dangers of
It is also on the way out in C11.
That makes me wonder: how did it ever get into the standard to begin with? Weren't the problems with it obvious at the time of standardization?
gets was invented at a time when there were no millions of malicious hackers trying to steal your financial data via the internet. There was no internet to speak of. People didn't put their entire personal lives on computers. Only highly paid specialists were ever supposed to have access to digital computers at all.
Briefly, the threat-countermeasure trade-off was totally different in 1972 - so different that what seems like an incredible oversight today was more like a hasty but ultimately inconsequential pragmatic choice of leaving out error checking.