News for hackers. Stuff that matters.
Re:Ways to get screwed by C by wladimir on Friday December 10, 2010 @08:42AM (#1991579)
Yes, the points he makes are typical beginner mistakes, or at least things that 20 years of programmer conventions have found a way around. Not really big problems of the language.

My biggest gripe with C is string handling. Although the extremely insecure functions have been slowly phased out (such as gets), zero-terminated strings are an attack on sanity.

Re:Ways to get screwed by C by gnosis on Friday December 10, 2010 @09:02AM (#1991633)
"My biggest gripe with C is string handling. Although the extremely insecure functions have been slowly phased out (such as gets), zero-terminated strings are an attack on sanity."

There are some nice safe string libraries out there, like this one:

http://bstring.sourceforge.net/

Re:Ways to get screwed by C by wladimir on Friday December 10, 2010 @09:09AM (#1991651)
Agreed, it is pretty easy to avoid the issue by using a library or framework, and bstring looks nice.

Still, I wish something like that was simply built-in, as external string libraries can cause interoperability issues: Each framework defines its own string handling functions and format, making it neccesary to convert between them in an application, if you use them together.

(the worst thing is that this problem still exists with C++ as of today, even though it has a built-in string people insist on rolling their own)