Re:My takeaways from "Clean Code"
by cocoflunchy on Tuesday May 28, 2013 @11:45PM
(#5784469)
Can someone elaborate on this (I'm not sure what he means by 'flag argument') ?
[ Parent
| on HN ]
Take the Unix system call open(). It accepts multiple flags, to open the file read-only, write-only, read-write, append (only meaningful if writing), truncate (only meaningful on a write-only open), create (again, only really meaningful on a write-only open) along with about half a dozen other flags that can be looked up.
The sheer number of flags can lead to weird issues (what does it mean to open a file for read-only and truncate it? The man page I'm reading leads me to believe it does something other than return an error) and hard to test (I count fifteen flags, which gives 32,768 paths through the code).