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

Welcome to the C standard library, the application of mutable global state to literally everything in it has to be the most consistent and predictable feature of the language standard.


I used to think this was bad too. But when C was designed an entire single threaded program was considered the unit of encapsulation for functionality. Now it’s mostly libraries.

The former allows you to design a coherent system. a lot of design questions which are annoying (“how do I access config data consistently, etc) become very clear.

It also makes C more productive. If global vars and static locals are unbanned, features like closures become less important.


I mean, I'm sure it was an okay solution on PDP-11.




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

Search: