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

Well, the operating system you used to write that comment was probably written in C, so apparently it does in fact work in large projects. It has weaknesses to be sure, but I don't think lack of OO (I.e., structs with functions) is one of them.


Duh. "Done" and "easily done" are different things.

Structs with functions isn't the biggest deal, and namespaces can be simulated with a couple underscores. But I have a hard time with error handling if you don't have exceptions, any time I have a call stack more than 3-4 deep I find myself confused about how to treat certain errors. Then there's concurrency.


It's worth noting that the bulk of the code in the kernel comes from 900 different network drivers, each of which could be considered a small program in its own right.


Particularly given that you can write OO code in C, and can decorate structs with functions, it's just messier.


"Object oriented programming with ANSI-C":

https://ritdml.rit.edu/handle/1850/8544




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

Search: