Having finished a fun time of the US elections, being slightly disappointed that Mr BHOmbastic won, and moving towards the end of the year (thus having done even less work than usual), I thought I would switch my blog reading focus from the conservative blogs to the tech blogs instead.
Now, obviously, part of it is simply the fact that just reading political blogs can lead to a bit of a burn out (not that it's a real excuse), but really I just happen to be a geek. One who is overweight, nay, even obese, sure, but a real geek nonetheless. So I find myself perusing Shark Tank and The Daily WTF (What The Fuck!). Sharky, unfortunately, updates once a day only, whereas Alex over at TDWTF updates more often - but more importantly, I haven't read all of Alex's blog, and I've read all of Shark Tank.
What can I say? The comments are funny beyond belief, especially if you grok code (even pseudocode), and there are some posts that cannot be believed. :) More to the point; even though I'm a lurker (by choice; most people there code in C, .Net or Java or other OOPs and I code mostly in Ada) there's a sense of connection to the whole software development community (Raymond Chen, for instance, hangs out there every now and then, aside from his own blog).
One of the best posts I came across was on the abuse of the C preprocessor. For those of you who may not know what is going on, the C programming environment includes a pre-processor, which takes your source code (plain ASCII text, mostly) and applies some pre-defined transformations to it. This, amongst other things, allows you to abstract some of C's rather terse syntax and operators. For example, you could do something like
#define TRUE 0
#define FALSE 1
#define FILE_NOT_FOUND -1
in your code, and when the pre-processor swept through your code, it would automatically replace every instance of TRUE, FALSE and FILE_NOT_FOUND with the integers they were defined as. Hence, you could say something like "return TRUE" and it would be the same as "return 0".
Now, it goes without saying that the preprocessor is a pretty powerful tool, and while C is not the only language to have it, it is one of the languages that often gets seriously wacky evil code written, where the evilness depended on the preprocessor.
Well, you can read all about it yourself, but suffice it to say that someone beat up on C badly enough to turn it into a variant of Pascal or Ada. The true punchline for me, though, was the comment on skinnable programming languages. Don't like a specific language? Don't use it! Find one that you like, and skin the old language to meet the new one.
Maybe you need to be a geek or a nerd to appreciate the humour. It nearly killed me laughing. The thought of someone beating up on C++ to turn it into Visual Basic (while still using the C++ compiler and other tools) was bad enough, but even worse was my remembering that the IOCCC once had a winning entry that used precisely this method; the best thing was, it was a perfectly compilable program on two languages, but it did something different depending on which language compiler you used.
I'll stop boring you lot now, but the whole idea of skinnable programming languages greatly appeals to me. Just one last thought; a compiler converts your source code (in human readable text, however complicated it can seem at first glance) to machine language (binary bits of 0s and 1s). Compilers for different languages convert different source code to the same machine language. Won't you call that the ultimate skinnable programming language?
Now, obviously, part of it is simply the fact that just reading political blogs can lead to a bit of a burn out (not that it's a real excuse), but really I just happen to be a geek. One who is overweight, nay, even obese, sure, but a real geek nonetheless. So I find myself perusing Shark Tank and The Daily WTF (What The Fuck!). Sharky, unfortunately, updates once a day only, whereas Alex over at TDWTF updates more often - but more importantly, I haven't read all of Alex's blog, and I've read all of Shark Tank.
What can I say? The comments are funny beyond belief, especially if you grok code (even pseudocode), and there are some posts that cannot be believed. :) More to the point; even though I'm a lurker (by choice; most people there code in C, .Net or Java or other OOPs and I code mostly in Ada) there's a sense of connection to the whole software development community (Raymond Chen, for instance, hangs out there every now and then, aside from his own blog).
One of the best posts I came across was on the abuse of the C preprocessor. For those of you who may not know what is going on, the C programming environment includes a pre-processor, which takes your source code (plain ASCII text, mostly) and applies some pre-defined transformations to it. This, amongst other things, allows you to abstract some of C's rather terse syntax and operators. For example, you could do something like
#define TRUE 0
#define FALSE 1
#define FILE_NOT_FOUND -1
in your code, and when the pre-processor swept through your code, it would automatically replace every instance of TRUE, FALSE and FILE_NOT_FOUND with the integers they were defined as. Hence, you could say something like "return TRUE" and it would be the same as "return 0".
Now, it goes without saying that the preprocessor is a pretty powerful tool, and while C is not the only language to have it, it is one of the languages that often gets seriously wacky evil code written, where the evilness depended on the preprocessor.
Well, you can read all about it yourself, but suffice it to say that someone beat up on C badly enough to turn it into a variant of Pascal or Ada. The true punchline for me, though, was the comment on skinnable programming languages. Don't like a specific language? Don't use it! Find one that you like, and skin the old language to meet the new one.
Maybe you need to be a geek or a nerd to appreciate the humour. It nearly killed me laughing. The thought of someone beating up on C++ to turn it into Visual Basic (while still using the C++ compiler and other tools) was bad enough, but even worse was my remembering that the IOCCC once had a winning entry that used precisely this method; the best thing was, it was a perfectly compilable program on two languages, but it did something different depending on which language compiler you used.
I'll stop boring you lot now, but the whole idea of skinnable programming languages greatly appeals to me. Just one last thought; a compiler converts your source code (in human readable text, however complicated it can seem at first glance) to machine language (binary bits of 0s and 1s). Compilers for different languages convert different source code to the same machine language. Won't you call that the ultimate skinnable programming language?
No comments:
Post a Comment