Re:Google C++ Style Guide
by joedavis512 on Sunday February 20, 2011 @01:19PM
(#2242580)
I laughed when I saw this: "If your function crashes upon error, you should append OrDie to the function name.", and then as an example: "OpenFileOrDie". Lol.
[ Parent
| on HN ]
Re:Google C++ Style Guide
by xentronium on Sunday February 20, 2011 @02:19PM
(#2242716)
I thought it was an old perl convention.
do_something or die "Somebody set up us the bomb"What if that was an actual semantic transformation in the language? Naming something XorDie would execute the body of X in a context within which all errors are caught, and if any is found, the call returns NIL or similar?
Easily doable with handler-case, unwind-protect and reader macros, but ugly as sin.