3 ms·
I wrote kernel-level code for quite a few years. There, barebones C makes a lot of sense. (I can make a case for a subset of C++ that avoids many C++ issues, in
by kabdib 14y ago
I wrote kernel-level code for quite a few years. There, barebones C makes a lot of sense. (I can make a case for a subset of C++ that avoids many C++ issues, including use of RAII and similar things that get you into trouble in environments where /nothing/ is free, and you have to think carefully about the teardown strategy of every single allocation).
Don't confuse "easy" with "simple". That's my latest mantra.
- huhtenberg 14y ago> a case for a subset of C++ Do elaborate. I come from the same background and I've been contemplating forking C for several years now. What you said sounds all too familiar to my own reasoning, so I'd be very curious to know what you have in mind. In broad strokes.
- jitl 14y agoTake a look at the C++ coding standards adopted for high-reliability areas. For example, the coding standards for the Joint Strike Fighter: http://www.stroustrup.com/JSF-AV-rules.pdf http://www.stroustrup.com/JSF-AV-rules.pdf
- kabdib 14y agoThose were mostly good (a little bit of crazy, but not much). The Google guidelines are okay for non-kernel work. I've worked on three teams that have independently converged on very similar guidelines (at Apple, a start-up, and a group in Microsoft). I find that convergence quite interesting.
- vvhn 14y agoa restricted subset of c++ (embedded c++) is exactly what is used to write drivers for Mac OS X. http://en.wikipedia.org/wiki/I/O_Kit http://en.wikipedia.org/wiki/I/O_Kit The kernel itself is in C though.
- alinajaf 14y agoCould be a coincidence, but I've been chanting that mantra at everyone who will listen after watching this talk by Rich Hickey: http://www.infoq.com/presentations/Simple-Made-Easy http://www.infoq.com/presentations/Simple-Made-Easy
- kabdib 14y agoNo coincidence, that's exactly where I got it. It's a great talk. I think that if it doesn't make you (a) depressed, then (b) mad, that you didn't listen carefully enough. :-)
- mbreese 14y agoI've taken to telling others that when I say 'easy', I really mean straight forward. Often I'll think of a solution that's "easy", yet it may take a good two weeks to get done.