Re:Show HN: Space Invaders in C
by jacquesm on Friday December 06, 2019 @04:09PM
(#21726007)
Those all work because in all cases single deleted lines will generate an error message.
[ Parent
| on HN ]
Why are you still going on about this bizarre single line deletion phenomenon?
The only way a single line deletion that contains curly braces will still compile is if it contains balanced curly braces:
if (cond)
{ foo }
stmt;
All styles which avoid this do not have an issue with the deletion of random single line that contains a curly brace.Regardless of bracing style, we can easily find lines in a program which can be deleted without causing a compile error, just not ones which open a syntax without closing it and vice versa.
Try not to randomly delete lines from your program, and inspect your "git diff" or what have you should such a thing happen.