Hacker News new | past | comments | ask | show | jobs | submit login

>> What's wrong with C?

The biggest problem with C is that it lets you do anything to include things you don't want to do and should not do.

"The programmer knows best" means you can easily write to arbitrary memory addresses, smash the call stack, allocate memory and never free it, etc. and as long as the syntax is correct, your program will compile.

Sometimes, in interesting low-level code, embedded code, or similar, this unrestricted behavior is needed: you write seemingly arbitrary values to a memory address because it is memory-mapped hardware and that is where the control register receives instructions. But in most application-level code, it is bad behavior and just causes segment violations.

"The programmer knows best" is the primary cause of security flaws in C (and C++ because of its heavy compatibility with C) since even experienced C programmers make mistakes or find their code being used in unanticipated ways.




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

Search: