Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The language doesn't really matter. Here are the problems that C introduces, and how other languages have solved them:

Buffer overflows. The solution is to not let the programmer (or attacker, when exploited) touch arbitrary memory. All the "managed" environments do this. ("But what if there's a bug in the implementation!?" Well, fix that, and you've fixed all existing software and all future software. Much better than checking every program for the same bug, for The Rest Of Eternity.)

Integer overflows. The solution is a better type system. Instead of overflowing, switch from the machine integer to a bigger integral type. (Yup, you lose performance after the switchover, but that's better than letting an attacker take over your machine. Optimize for speed after your program works correctly.)

Ignoring errors. Many C programmers forget to check for errors, and then the program state is silently corrupted, leading to security problems, strange behavior, etc. Exceptions solve this problem.

There are many other security problems, but these still keep cropping up even though we have tools that eliminate them. So they are most annoying to me. (Everyone has written "allow_login if !$password->valid", and I doubt new programming languages will fix that. But there is no excuse for buffer or integer overflows these days.)

Writing application software in C is the classic example of premature optimization and the evil it brings.



I agree with what you're saying about the problems that C has (or rather the problems people have with writing safe and secure C code), but I do think the language matters; just from the perspective of having any hopes of being adopted.

C is largely immune from all the language wars, because it's everyone's reference point. I think it will be very difficult to get enough people to sign off on another language for systems development. Everyone thinks they know what everyone else should use; and it makes for a very fractious environment with regards to what languages should get used... C# and Objective-C are good examples of that.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: