I must confess that for a moment you got me there. https://www.gnu.org/fun/jokes/unix-hoax.html
The truth about C and Unix history
11–20 of 78 posts
Re: The truth about C and Unix history
#12This particular April Fool's joke goes back at least 30 years. I remember getting a chuckle out of it a long time ago. For context for younger readers, it might be worth pointing out that there was for a while a sort of rivalry between C and Pascal adherents. C was the more "modern" and "professional" language, while Pascal was a "teaching" language (or so some of the arguments went). Windows was coded in C, while Ma…
#define begin {
#define end }
Re: The truth about C and Unix history
#13This particular April Fool's joke goes back at least 30 years. I remember getting a chuckle out of it a long time ago. For context for younger readers, it might be worth pointing out that there was for a while a sort of rivalry between C and Pascal adherents. C was the more "modern" and "professional" language, while Pascal was a "teaching" language (or so some of the arguments went). Windows was coded in C, while Ma…
You could have called me a "Pascal devotee" back then, but I had eventually come to realize verbosity kills creativity and dumped Pascal for good. This { int a[10]; ... } wins over this begin var A: array[0..9] of Integer; ... end; quite simply because the latter takes longer to both read and write. The proof being that none of the more or less serious languages created in the past few decades dared to adopt e.g. beg…
Re: The truth about C and Unix history
#14This particular April Fool's joke goes back at least 30 years. I remember getting a chuckle out of it a long time ago. For context for younger readers, it might be worth pointing out that there was for a while a sort of rivalry between C and Pascal adherents. C was the more "modern" and "professional" language, while Pascal was a "teaching" language (or so some of the arguments went). Windows was coded in C, while Ma…
All the Pascal fanboys did this (and worse) before they gave in and finally converted :) #define begin { #define end }
#define new(x) (malloc(sizeof(x)))
#define dispose(x) { if((x) != NULL) { free(x); } }
C was so primitive already when compared against Turbo Pascal 6.0Re: The truth about C and Unix history
#15This particular April Fool's joke goes back at least 30 years. I remember getting a chuckle out of it a long time ago. For context for younger readers, it might be worth pointing out that there was for a while a sort of rivalry between C and Pascal adherents. C was the more "modern" and "professional" language, while Pascal was a "teaching" language (or so some of the arguments went). Windows was coded in C, while Ma…
All the Pascal fanboys did this (and worse) before they gave in and finally converted :) #define begin { #define end }
(What that FAQ doesn't mention is the real reason the Bourne shell deserved to be in the IOCCC: The way it allocated memory. It trapped SIGSEGV (the signal the kernel sends you when you've provoked a segmentation violation or segfault by trying to access memory you don't own) so it would know when to request more RAM from the OS. This later became a problem for people looking to port the Bourne shell, for example to the Motorola 68000 CPUs which powered the first generation of Unix workstations.
Re: The truth about C and Unix history
#16Earlier quoted context omitted.
All the Pascal fanboys did this (and worse) before they gave in and finally converted :) #define begin { #define end }
By worse do you mean? #define new(x) (malloc(sizeof(x))) #define dispose(x) { if((x) != NULL) { free(x); } } C was so primitive already when compared against Turbo Pascal 6.0
Re: The truth about C and Unix history
#17Earlier quoted context omitted.
By worse do you mean? #define new(x) (malloc(sizeof(x))) #define dispose(x) { if((x) != NULL) { free(x); } } C was so primitive already when compared against Turbo Pascal 6.0
Totally worse. free(NULL) preforms no action so there is no requirement for the if statement. ;)
Have you ever bothered to read ANSI C specification?
EDIT: Well it appears my recollections of ANSI C have faded away and free(NULL) was actually defined in ANSI C89.
Re: The truth about C and Unix history
#18This particular April Fool's joke goes back at least 30 years. I remember getting a chuckle out of it a long time ago. For context for younger readers, it might be worth pointing out that there was for a while a sort of rivalry between C and Pascal adherents. C was the more "modern" and "professional" language, while Pascal was a "teaching" language (or so some of the arguments went). Windows was coded in C, while Ma…
You could have called me a "Pascal devotee" back then, but I had eventually come to realize verbosity kills creativity and dumped Pascal for good. This { int a[10]; ... } wins over this begin var A: array[0..9] of Integer; ... end; quite simply because the latter takes longer to both read and write. The proof being that none of the more or less serious languages created in the past few decades dared to adopt e.g. beg…
Re: The truth about C and Unix history
#19Earlier quoted context omitted.
Totally worse. free(NULL) preforms no action so there is no requirement for the if statement. ;)
Except free(NULL) behavior is undefined. Have you ever bothered to read ANSI C specification? EDIT: Well it appears my recollections of ANSI C have faded away and free(NULL) was actually defined in ANSI C89.
You didn't say which version of the ANSI C specification.
Re: The truth about C and Unix history
#20Earlier quoted context omitted.
Totally worse. free(NULL) preforms no action so there is no requirement for the if statement. ;)
Except free(NULL) behavior is undefined. Have you ever bothered to read ANSI C specification? EDIT: Well it appears my recollections of ANSI C have faded away and free(NULL) was actually defined in ANSI C89.
> Have you ever bothered to read ANSI C specification?
You mean the one that states
> The free function causes the space pointed to by ptr to be deallocated, that is, made available for further allocation. If ptr is a null pointer, no action occurs.
?