21 Programming Codes Humor

funny-programming-codes

Funny Programming Code 1:

let true = false
let false = true
//paradoxes forever folks!

Funny Programming Code 2:

>>> from __future__ import braces
Traceback (most recent call last):
File "python", line 1
SyntaxError: not a chance

Funny Programming Code 3:

var Bomb = function(secondsUntilExplosion) {
this.blowUp = secondsUntilExplosion;
this.damage = 100000000000000000000000000000000000000000000000000;
}
Bomb.prototype.ignite = function() {
print(“uh-oh…”);
wait(this.blowUp);*
blowUpWorld(this.damage);*
}
var haha = new Bomb(3);
haha.ignite();

Funny Programming Code 4:

do
{
Hard Work;
}while(!(success)=try());
Success!!

Funny Programming Code 5:


Exception up = new Exception("Something is really wrong.");
throw up; //ha ha

Funny Programming Code 6:


stop(); // Hammertime!

Funny Programming Code 7:


// Autogenerated, do not edit. All changes will be undone.

Funny Programming Code 8:


{
protected abstract Pager Pager { get; }
public void BindCompany(int companyId) { }
public RichardIsAFuckingIdiotControl()
{
MakeSureNobodyAccidentallyGetsBittenByRichardsStupidity();
}
private void MakeSureNobodyAccidentallyGetsBittenByRichardsStupidity()
{
// Make sure nobody is actually using that fucking bindcompany method
MethodInfo m = this.GetType().GetMethod("BindCompany", BindingFlags.DeclaredOnly |
BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
if (m != null)
{
throw new RichardIsAFuckingIdiotException("No!! Don't use the fucking BindCompany method!!!");
}
// P.S. this method is a joke ... the rest of the class is fucking serious
}

Funny Programming Code 9:


///


/// This returns true if this control is supposed to be doing anything
/// at all for this request. Richard thought it was a good idea to load
/// the entire website during every request and have things turn themselves
/// off. He also thought bandanas and aviator sunglasses were "fuckin'
/// gnarly, dude."
///

protected bool IsThisTheRightPageImNotSureBecauseRichardIsDumb()
{
return Request.QueryString[“Section”] == this.MenuItemKey;
}
protected override void OnLoad(EventArgs e)
{
if (IsThisTheRightPageImNotSureBecauseRichardIsDumb())
{
Page.LoadComplete += new EventHandler(Page_LoadComplete);
Pager.RowCount = GetRowCountBecauseRichardIsDumb();
}
base.OnLoad(e);
}
protected abstract int GetRowCountBecauseRichardIsDumb();
protected abstract void BindDataBecauseRichardIsDumb();


void Page_LoadComplete(object sender, EventArgs e)
{
BindDataBecauseRichardIsDumb();
}

Funny Programming Code 10:


// the rest of his reduh-ndant interface members
public abstract string MenuItemName { get; set; }
public abstract string MenuItemKey { get; set; }
public abstract bool IsCapable(CapabilityCheck checker, int companyId);
public abstract bool ShowInMenu { get; }
public virtual Control CreateHeaderControl()
{
return null;
}
}
}

Funny Programming Code 11:


// drunk, fix later

Funny Programming Code 12:


return 1; # returns 1

Funny Programming Code 13:


// Replaces with spaces the braces in cases where braces in places cause stasis
$str = str_replace(array("\{","\}")," ",$str);

Funny Programming Code 14:


Catch (Exception e) {
//who cares?
}

Funny Programming Code 15:


/**
* Always returns true.
*/
public boolean isAvailable() {
return false;
}

Funny Programming Code 16:


try {
} finally { // should never happen }

Funny Programming Code 17:


double penetration; // ouch

Funny Programming Code 18:


doRun.run(); // ... "a doo run run".

Funny Programming Code 19:


options.BatchSize = 300; //Madness? THIS IS SPARTA!

Funny Programming Code 20:


__inline BOOL
SearchOneDirectory(
IN LPSTR Directory,
IN LPSTR FileToFind,
IN LPSTR SourceFullName,
IN LPSTR SourceFilePart,
OUT PBOOL FoundInTree
)
{
//
// This was way too slow. Just say we didn't find the file.
//
*FoundInTree = FALSE;
return(TRUE);
}

Funny Programming Code 21:


//When I wrote this, only God and I understood what I was doing
//Now, God only knows

Video Programming Joke