Hacker News new | ask | show | jobs
by twoz 6232 days ago
So instead of using the unsafe strcpy function, you now use the safe strcpy_s.

Joel had some thoughts on this a while ago (2005); prepending s for safe and us for unsafe to variables.

http://www.joelonsoftware.com/articles/Wrong.html

3 comments

The link doesn't seem to be working but (if you're talking about what I think you're talking about) that isn't Joel's idea. It's Apps Hungarian notation which was invented in the 70s at PARC.

Although, IMHO, it's just a poor attempt to compensate for a weak type system (Type Synonyms, etc. are a much better fix, since then your compiler can guarantee that you are doing the right thing).

Worth noting that strcpy_s actually is safer than strcpy.
Heh, I like that article...the description of "i=j*5" in C++ should probably be on the first slide of any C++ programming class. :)