3 ms·
> the coding style used seems to lend strongly towards not thinking an error is possible So does every tutorial which doesn't check the return from printf or
by civility 7y ago
> the coding style used seems to lend strongly towards not thinking an error is possible
So does every tutorial which doesn't check the return from printf or check for errors from cout. Did you notice that the parent and child are both writing to the same file descriptor? Maybe the writer should add some words and tests in his code about the inherent race condition there. A true pedant would push this even further and teach their audience how to eliminate this problem with cross process mutexes or semaphores. Better be sure to check the error codes on those calls too.
I know arguing with a pedant is like wrestling with a pig, but honestly I'm more offended by the "#define N 2" than by the lack of error checking.