@Husky said:
WTF points for using \n in PHP.
Yeah, real progammers never look at the HTML excreted by the PHP code so it can as well be all on one line.
@Husky said:
WTF points for using \n in PHP.
Yeah, real progammers never look at the HTML excreted by the PHP code so it can as well be all on one line.
@PJH said:
I'm failing to see the WTF - certainly within C.
If a function returns a status, 0 should mean success, with different non-zero numbers potentially giving an indication of the failure. cf EXIT_SUCCESS and EXIT_FAILURE
Conversely if a function returns a pointer, 0 generally does mean failure (with errno set to indicate the failure.)
There are various patterns for function return values. One is "zero for success, otherwise an error code". Another is "nonzero for success, zero for failure". Yet another is "pointer to something or NULL for failure / no such thing / not applicable / whatever". Which one "should" be used depends on what is natural for the occasion
The thing is, these people only use the return value for success/failure. And they also use function calls as predicates, which leads to interpreting "true" (in the C sense) function returns as failures.
I find it poetic justice that they #define SUCCESS 0, given the overall quality of the code. They truly are having zero success.
#define SUCCESS 0
And of course there is also
#define FAILURE 1
Not that I should complain, this client will keep me busy for a long time...
@Spectre said:
But why are the .C files executable? Aren't they also scripts, by any chance?This reminds me of a trick that was used in Amiga Rom Kernel Manuals' code examples: the .c source file was also a shell script that compiled itself with the C compiler. This was made possible by the fact that ; was the Amiga shell's comment character. Hence the source files would begin like
[code];/* screen34to37.c - Execute me to compile me with SAS 5.10
LC -b1 -cfistq -v -y -j73 screen34to37.c
blink FROM LIB:c.o screen34to37.o TO screen34to37 LIB LIB:lc.lib LIB:amiga.lib
quit
*/
#define ...
[/code]