On Tue, 23 Apr 2024 20:59:17 -0500, Physfitfreak wrote:
Could you post a sample?
>
===========================
From this (conventional):
===========================
// open to read file or stdin
if (argc > 2) {
if(!strcmp(argv[2],"-")) {
fd = stdin; ft=1;
} else {
fd = fopen(argv[2],"r");
if (NULL == fd) {
fprintf(stderr, "Unable to open '%s': %s\n", argv[1], strerror(errno));
exit(EXIT_FAILURE);
}
}
} else {
fd = stdin; ft=1;
}
===================
To this (mine):
===================
// open to read file or stdin
if (argc > 2) { //outer if
if(!strcmp(argv[2],"-")) { //inner if
fd = stdin; ft=1;
}
else { //inner else
fd = fopen(argv[2],"r");
if (NULL == fd) {
fprintf(stderr, "Unable to open '%s': %s\n", argv[1], strerror(errno));
exit(EXIT_FAILURE);
}
} //end inner else
} //end outer if
else { //outer else
fd = stdin; ft=1;
}
Comments could be better, and colorizing would be best.
Recall that the first written languages, like Chinese, went
up to down, i.e. vertically.
The human brain prefers a vertical orientation when grasping
sections.
When dealing with deeply nested structure, the horizontal indents
will literally start pushing code way off the page. In such
cases vertical indentation is almost mandatory.
Others will object and criticize, but then their brains are
not human.
Ha, ha, ha, ha, ha, ha, ha, ha, ha!