Skip to main content
Topic: The best funny code - new contest (Read 7791 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

The best funny code - new contest

I found this few minutes ago:
Code: [Select]
isset($txt['calendar_month']) ? $txt['calendar_month'] : $txt['calendar_month']
Bugs creator.
Features destroyer.
Template killer.

Re: The best funny code - new contest

Reply #1

Nice one !

Re: The best funny code - new contest

Reply #2

Well it's not code, but a comment in the code. At work I found this a few days ago.

Quote// this commented out line probably doesn't need to be in here, but leaving it in until I get confirmation on Monday, if you find this in the code, please make fun of me – JHB

That comment along with it's commented out line of code had been in the code for almost 5 years. lol
Success is not the result of spontaneous combustion, you must set yourself on fire!

Re: The best funny code - new contest

Reply #3

AHAHAH!!
Bugs creator.
Features destroyer.
Template killer.

Re: The best funny code - new contest

Reply #4

http://sourceforge.net/projects/yabbse/
It's really funny if you check the code, once a modern forum but ten years later ..
Soooo many docs, it's eman-friendly  ;)
This
Code: [Select]
		$Cookie_Length = 525600;   // about 1 year
and this
Code: [Select]
	// Write log
is the full documentation in LogInOut.php
Thorsten "TE" Eurich
------------------------

Re: The best funny code - new contest

Reply #5

That's because you can't write wrong code in Perl!!! 8)
Bugs creator.
Features destroyer.
Template killer.

Re: The best funny code - new contest

Reply #6

That was fun to go though some of that old code, sparse on the comments, but it made up for it with the awesome collection of globals, a sample from post2
Code: [Select]
	global $name, $email, $username, $subject, $message, $icon, $ns, $threadid, $txt, $notify, $MaxMessLen, $db_prefix;
global $settings, $board, $mreplies, $maxmessagedisplay, $enable_guestposting, $waction, $ID_MEMBER, $ubbcjspath;
global $REMOTE_ADDR, $cgi, $yySetLocation, $color, $sourcedir, $realname, $lock, $settings, $moderators, $doLimitOne;
global $attachment, $attachment_size, $attachment_name, $HTTP_POST_FILES, $modSettings, $isAnnouncement;
global $linkcalendar, $month, $day, $year, $evtitle, $span, $timeoffset;

Re: The best funny code - new contest

Reply #7

Not much for funny code, but I have a large collection of real comments found within code. Some of my PG13 favorites are:

Quote//
// Dear maintainer:
//
// Once you are done trying to 'optimize' this routine,
// and have realized what a terrible mistake that was,
// please increment the following counter as a warning
// to the next guy:
//
// total_hours_wasted_here = 42
//

Quote// somedev1 -  6/7/02 Adding temporary tracking of Login screen
// somedev2 -  5/22/07 Temporary my booty

Quote/*
  You may think you know what the following code does.
 
But you dont. Trust me.
  Fiddle with it, and youll spend many a sleepless
 
night cursing the moment you thought youd be clever
  enough to "optimize" the code below.
 
Now close this file and go play with something else.
 */

Quotevirgin = 0;     /* you're not a virgin anymore, sweety */

Quote// TODO: Fix this.  Fix what?

Quote/***************************************************************************/
/*  deep wizardry. do not touch.                                           /
/
                                                                         /
/
  no seriously.  XXXXXX I'm looking at you. If you screw with this again /
/
  I will kill you with my swingline stapler.                             /
/
                                                                         /
/
... 

Quote/*
after hours of consulting the tome of google
i have discovered that by the will of unknown forces
without the below line, IE7 believes that 6px = 12px
*/
font-size: 0px;

Re: The best funny code - new contest

Reply #8

Ever read SMF's code? :P
Bugs creator.
Features destroyer.
Template killer.

Re: The best funny code - new contest

Reply #9

Quote from: Xarcell –
Quote/*
  You may think you know what the following code does.
 
But you dont. Trust me.
  Fiddle with it, and youll spend many a sleepless
 
night cursing the moment you thought youd be clever
  enough to "optimize" the code below.
 
Now close this file and go play with something else.
 */
parse_bbc()

Re: The best funny code - new contest

Reply #10

A bit different, but terribly funny!

I asked Spuds (since he is the expert :P) to enable some more scrutinizer checks on the development branch (the "master" branch doesn't have many in order to avoid the "background noise"...if we can call it that way LOL), and then I did a run on a branch I'm working on:
https://scrutinizer-ci.com/g/emanuele45/Dialogo/inspections/941c1d54-b0f4-4fca-8c41-e68e9a8c633a
reading through the output I found this:
QuoteThis operation has 47177306806500000000000000000 execution paths which exceeds the configured maximum of 200.
I don't even know how to pronounce that number!! ROFL!

 emanuele wonders what would happen pushing SMF... O:-)

ETA: forgot to say, the number refers to the function loadProfileFields in Profile.subs.php.

ETA2: okay, never mind, the previous one was a joke:
QuoteThis operation has 4255093860041717266473879976983304236537327064154287104 execution paths which exceeds the configured maximum of 200.
Guess where this comes from?

Spoiler (click to show/hide)
Last Edit: March 28, 2014, 11:33:30 am by emanuele
Bugs creator.
Features destroyer.
Template killer.

Re: The best funny code - new contest

Reply #11

Damn, we have only gone through 1,555,093,860,041,716,266,473,879,976,683,304,236,537,327,034,154,287,129 of those paths so far, I can't believe we still have 3 septendecillion to check  ... we will never be done  :'(

Re: The best funny code - new contest

Reply #12

Code: [Select]
		// Default to 10.
if (empty($_REQUEST['viewscount']) || !is_numeric($_REQUEST['viewscount']))
$_REQUEST['viewscount'] = 10;
Present in the code since the 1st SVN import... and does nothing at all?
Bugs creator.
Features destroyer.
Template killer.