Ten Absolutely Terrible Code Puns
7th
December 2017, 02:10
Due to the nature of reserved words being used in code, sometimes puns get worked in between the lines. I'm just going to explore ten of them today, coming from different languages.
Tags
See also
1. String
Many of these are type declarations. This is a prime example in C++.
string bikini = "Hello world";
2. Char
Again in C++. This pun has mostly regional flavor.
char kwayteow = '';
3. Double
This one is a particular favorite. Due to the NSFW nature of the second example, I'm only gonna illustrate the first example.
double Ds = 0.0;
double penetration = 0.0;
double penetration = 0.0;
4. Dim
This one is in QBasic.
DIM SUM = 0
5. Sub
Another QBasic example, rather convoluted.
SUB marine (torpedo)
'code here
END SUB
'code here
END SUB
6. Split
The JavaScript split() method!
var banana = "The Quick Brown Fox Jumps Over The Lazy Dog";
var arr = banana.split(" ");
var arr = banana.split(" ");
7. Throw
JavaScript again!
var up = "Error";
throw up;
throw up;
8. Catch
JavaScript yet again.
try
{
//code here
}
catch(cold)
{
//code here
}
{
//code here
}
catch(cold)
{
//code here
}
9. Die
PHP's die() function can be a source of unintended comedy as well...
$hard = "Program terminated.";
die($hard);
die($hard);
10. SQL
This almost should be a blogpost on its own!
SELECT COUNT(dracula) FROM transylvania;
Done cringing yet?
Pretty awful, eh? If they got any cheesier, we'd be making pizzas!
catch(youlater){}