ext_120619 ([identity profile] deliberateblank.livejournal.com) wrote in [personal profile] simont 2013-06-20 03:22 am (UTC)

Ah, I see someone has been reading TDWTF. (YIK pretty much everyone has read that article.)

The article in question is perhaps more locally exemplified by:

#include <stdio.h>

#define FOO() \
printf("A\n"); \
// printf("B\n"); \
printf("C\n"); \
printf("D\n")


int main(int argc, char *argv[])
{
printf("1\n");
// foo \
printf("2\n");
printf("3\n");

printf("\n");

FOO();

return 0;
}

Which does two thing which one might not expect, one more so than the other.

I think your rules fix both of them, but do enable constructs where the start of the line splice is divorced by many comment lines from what it is spliced to, which might not be ideal. (If that makes a semantic difference, then perhaps one could consider that another argument against python...) Perhaps a requirement that all ignored comment line *must* also be splicing lines? Dunno.

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting