• Welcome to Smashboards, the world's largest Super Smash Brothers community! Over 250,000 Smash Bros. fans from around the world have come to discuss these great games in over 19 million posts!

    You are currently viewing our boards as a visitor. Click here to sign up right now and start on your path in the Smash community!

Code Humor

TheBuzzSaw

Young Link Extraordinaire
Moderator
BRoomer
Joined
Jul 21, 2005
Messages
10,478
Some other students and I were discussing some of our favorite computer science jokes.

This one has invalid syntax, but it's funny. :p
Code:
question = 2b || !2b;
My friend showed me this one:
Code:
// no comment
I really liked these ones:
Code:
String Cheese = "Yum!";
float RootBeer;
 

Fantasia

BRoomer
BRoomer
Joined
Dec 23, 2001
Messages
1,444
Location
nyc
Switch FC
SW-3476-8294-6601
I know it isn't a joke like the ones you guys are talking about, but I really think the implementation of LOLCODE is absolutely hilarious.

here's a "hello world" program in LOLCODE
Code:
HAI
CAN HAS STDIO?
VISIBLE "HAI WORLD!"
KTHXBYE
and here's just another example of LOLCODE
Code:
HAI
CAN HAS STDIO?
PLZ OPEN FILE "LOLCATS.TXT"?
	AWSUM THX
		VISIBLE FILE
	O NOES
		INVISIBLE "ERROR!"
KTHXBYE
 

TheBuzzSaw

Young Link Extraordinaire
Moderator
BRoomer
Joined
Jul 21, 2005
Messages
10,478
A LOLCODE compiler would be the hardest thing to write.
 

AltF4

BRoomer
BRoomer
Joined
Dec 13, 2005
Messages
5,042
Location
2.412 – 2.462 GHz
I dunno about that. It would only be hard to do if the LOLcode had to be executable. Otherwise I bet you could do it.

Much easier than a normal compiler, anyway. And I wrote one (quite rudimentary, admittedly) for a class project once.
 

SuSa

Banned via Administration
Joined
Jul 20, 2008
Messages
11,508
Location
planking while watching anime with Fino
On dA I made a //no comment avatar for nocommentplz. I thought it was funny enough to deserve its own plz.

I find this relevant enough:

There are 10 kinds of people in the world. Those with friends and those who understand Binary.
 

MagmarFire

Smash Journeyman
Joined
Jun 24, 2008
Messages
267
Location
Michigan
NNID
MagmarFire
3DS FC
3737-9549-8452
Is it something you know from experience, or...? XD

Anyway, here's one that you've all probably heard before, but eh, it's programming related.



There was this one guy who's sitting by himself, smoking a cigarette after another. A concerned lady went up to him and said, "Smoking's bad for you! Didn't you read the warnings on the pack?"

The man calmly replies, "I'm a computer programmer," to which the woman confusedly asks,

"So? What's that gotta do with anything?"

"We don't care about warnings; we care about errors."



ITHINKIT'SFUNNYLEAVEMEALONE DX
 

Sp133n

Smash Rookie
Joined
May 22, 2009
Messages
13
Location
Maryland
Teachers don't like when you leave comments all in 1337.

Seconded, my Java teacher wtf'd =P I still commented my name in 1337 half the time anyway =P Or used my gamertag =P

The entire class almost died when on a classes/objects practice test we got the statement:

Weenie oscarMayer = new Weenie();

The puns were insane xD

"My weenie object, it's initializing!"
"Stop or I'll initialize my weenie object all over you"

Or anytime our teacher referenced using his package. The class was over then =P
 

Sp133n

Smash Rookie
Joined
May 22, 2009
Messages
13
Location
Maryland
Compile Time Error:
"Unexpected parameter 'aLife', expected 'aMillionDollars'"
I'm 15, and it was a class full of immature, bored programmers. Really, expecting any better? =P

theBuzzSaw.loosenUp();

actually, better :p :

sudo loosen theBuzzSaw -u

=P
 

AltF4

BRoomer
BRoomer
Joined
Dec 13, 2005
Messages
5,042
Location
2.412 – 2.462 GHz
I feel kind of bad that I don't have any code jokes that haven't been said here already.But I do have some mildly funny coding stories.

Sometimes, I like to see if anyone ever reads code I write when I submit it to a teacher. So I'll throw in:

1) Silly Comments
2) Absurdly complicated solutions to easy problems

Every teacher likes to use factorial as an example of a problem that is elegantly solved by recursion. So sometimes I'll use some awful combination of precomputed hardcoded values for the first bunch of answers, and then some iterative process for the rest.

Of course I defend it by saying that it's "more efficient"... which it is.... but there's still something humorous about a 150 line solution that's more efficient than a 5 line solution. I guess elegance isn't everything. :)

Sometimes, I'll put in comments that just say:

// This comment line is necessary to keep the required 2:1 code-to-comments ratio

or

//The following function, fubar(), takes in some input, does a bunch of stuff, then returns an output
 

MagmarFire

Smash Journeyman
Joined
Jun 24, 2008
Messages
267
Location
Michigan
NNID
MagmarFire
3DS FC
3737-9549-8452
Seconded, my Java teacher wtf'd =P I still commented my name in 1337 half the time anyway =P Or used my gamertag =P

The entire class almost died when on a classes/objects practice test we got the statement:

Weenie oscarMayer = new Weenie();

The puns were insane xD

"My weenie object, it's initializing!"
"Stop or I'll initialize my weenie object all over you"

Or anytime our teacher referenced using his package. The class was over then =P
Oh, good gosh... XDD

Code:
long long long long long long long double size = sizeof(your_mom);
Well, that's probably the only other original thing I can come up with. :dizzy:
 

Sp133n

Smash Rookie
Joined
May 22, 2009
Messages
13
Location
Maryland
Thanks Saw ^_^, i feel like a noob, (which I am xD), but thanks xD
Code:
Sp133n.level += 2;
Sp133n.thank(theBuzzSaw);
and AltF4, epic, sounds like the stuff I pull on my teacher xD i once turned recursion into a giant for loop using a global counter variable and passing the same value =P
 

Eriatarka

Smash Journeyman
Joined
Mar 28, 2008
Messages
229
Location
Dublin, Ireland
Code:
int main(){

        return main();

}
A while back I was talking to one of my friends about programming and stuff, and then we moved onto different methods of shoelace-tying. He was saying that he had the most practical way of tying his and I said 'Ah do you use four loops?'.
And it was all brilliant* and stuff.

*'you had to be there' disclaimer.
 

TheBuzzSaw

Young Link Extraordinaire
Moderator
BRoomer
Joined
Jul 21, 2005
Messages
10,478
The last week of finals here at school, there were all kinds of jokes on the whiteboard.
Code:
volatile unsigned int finals = rand();
while (finals > 0)
{
    happiness--;
    sanity--;

    try
    {
        study();
    }
    catch (IDoNotCareException e)
    {
        cry();
    }
}
 

Eriatarka

Smash Journeyman
Joined
Mar 28, 2008
Messages
229
Location
Dublin, Ireland
There was a thing going around recently, if you did a Google search for 'recursion', it came back with 'Did you mean: recursion'.
not happening now.. Was good while it lasted, though.
 

Bluebottel

Smash Cadet
Joined
Dec 13, 2006
Messages
61
Location
Sweden
You guys missed the oldest one in the book

Code:
man touch
Edit:

Heres something i find quite amusing.

Code:
#include <stdio.h>

char
*T="IeJKLMaYQCE]jbZRskc[SldU^V\\X\\|/_<[<:90!\"$434-./2>]s",
K[3][1000],*F,x,A,*M[2],*J,r[4],*g,N,Y,*Q,W,*k,q,D;X(){r  [r
[r[3]=M[1-(x&1)][*r=W,1],2]=*Q+2,1]=x+1+Y,*g++=((((x&     7)
-1)>>1)-1)?*r:r[x>>3],(++x<*r)&&X();}E(){A||X(x=0,g       =J
),x=7&(*T>>A*3),J[(x[F]-W-x)^A*7]=Q[x&3]^A*(*M)[2         +(
x&1)],g=J+((x[k]-W)^A*7)-A,g[1]=(*M)[*g=M[T+=A            ,1
][x&1],x&1],(A^=1)&&(E(),J+=W);}l(){E(--q&&l              ()
);}B(){*J&&B((D=*J,Q[2]<D&&D<k[1]&&(*g++=1                ),
!(D-W&&D-9&&D-10&&D-13)&&(!*r&&(*g++=0)                   ,*
r=1)||64<D&&D<91&&(*r=0,*g++=D-63)||D                     >=
97&&D<123&&(*r=0,*g++=D-95)||!(D-k[                       3]
)&&(*r=0,*g++=12)||D>k[3]&&D<=k[                          1]
-1&&(*r=0,*g++=D-47),J++));}j(                            ){
putchar(A);}b(){(j(A=(*K)[D*                              W+
r[2]*Y+x]),++x<Y)&&b();}t                                 ()
{(j((b(D=q[g],x=0),A=W)                                   ),
++q<(*(r+1)<Y?*(r+1):                                     Y)
)&&t();}R(){(A=(t(                                        q=
0),'\n'),j(),++r                                          [2
]<N)&&R();}O()                                            {(
j((r[2]=0,R(                                              ))
),r[1]-=q)                                                &&
O(g-=-q)                                                  ;}
C(){(                                                     J=
gets                                                      (K
[1]))&&C((B(g=K[2]),*r=!(!*r&&(*g++=0)),(*r)[r]=g-K[2],g=K[2
],r[
1]&&
O())
);;}
main
(){C
((l(
(J=(
A=0)
[K],
A[M]
=(F=
(k=(
M[!A
]=(Q
=T+(
q=(Y
=(W=
32)-
(N=4
))))
+N)+
2)+7
)+7)
),Y=
N<<(
*r=!
-A))
);;}
And its fully functional.
 

Terra~

Smash Journeyman
Joined
Nov 4, 2008
Messages
402
Not as much code humor but in my computer technology association a common joke you'll hear is that a teacher will ask the following question : "Prove the existance of God with only 3 HTML tags".

It seems so much less funny when written now xD
 

Handorin

Smash Hero
Joined
Dec 2, 2005
Messages
6,013
There was a thing going around recently, if you did a Google search for 'recursion', it came back with 'Did you mean: recursion'.
not happening now.. Was good while it lasted, though.
Still works. =)
 

TheBuzzSaw

Young Link Extraordinaire
Moderator
BRoomer
Joined
Jul 21, 2005
Messages
10,478
This is the best error I have ever received:
Code:
max.cpp:8: error: ‘long long long’ is too long for GCC
 

KrazyGlue

Smash Champion
Joined
Feb 23, 2009
Messages
2,302
Location
Northern Virginia
Ok, here's mine. It's kinda lame but whatever.

Code:
public enemy()
I actually had to use this line of code before for a project. :chuckle:
 

TheBuzzSaw

Young Link Extraordinaire
Moderator
BRoomer
Joined
Jul 21, 2005
Messages
10,478
Code:
cout << 'L';
while (1) cout << "OL";
 
Top Bottom