javascript joke

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply

Is this joke...

Poll ended at Fri Dec 30, 2005 2:58 am

Funny
3
50%
Not funny
3
50%
 
Total votes: 6

User avatar
php3ch0
Forum Contributor
Posts: 212
Joined: Sun Nov 13, 2005 7:35 am
Location: Folkestone, Kent, UK

javascript joke

Post by php3ch0 »

just browsing the internet and came across this and thought id share it with you all.

Code: Select all

public class Developer {
   public void writeCode(AssignmentDetails details) {
      Document designDocument = details.getDesignDocument();

      // see if it was done already somewhere in the project
      if (details.isEnhancement()) {
         int myExperience = this.getExperience(Calendar.YEAR);
         if (myExperience <= 2) {
            // Can safely ignore the design requirements. If they are
            // so clever, why don't they write code anymore?
            designDocument.ignore();
            // Time to reinvent the wheel. Surely the guys before me
            // didn't know what they were doing (those "gurus"). It
            // will take me half the time with zero bugs
            details.setClosingDate(Calendar.getCurrent().add(Calendar.DAY, 2));
            // Like i need to see what's out there
            Internet.getDefaultBrowser().close();
            while (true) {
               try {
                  System.hang();
               }
               catch (InterruptedException exc) {
                  System.out.println("Will be ready in a few days");
               }
            }
         }
         else {
            if (myExperience <= 5) {
               // Time to copy-paste. If I change the existing function or
               // refactor it, I'll have to run tons of backwards-compatibility
               // tests. 
               Set<Method> methodsToCopy = details.getBase().getImplementation();
               Package newPackage = this.getProject().createNewPackage(
                   details.getBase().getPackage().getName() + ".issue" + details.getID());
               newPackage.create();
               for (Method method : methodsToCopy) {
                  method.update(details);
                  newPackage.getClass(method.getClass()).add(method);
               }
               // test
               for (TestCase case : designDocument.getTestCases()) {
                  boolean success = case.run();
                  if (!success) {
                     // damn!!
                     if (!designDocument.isReadOnly()) {
                        designDocument.getTestCases().remove(case);
                     }
                     else {
                        // damn!!!
                        designDocument.descope(case.getFunctionality());
                     }
                  }
               }
               // All tests passed successfully (woot)!
               return;
            }
            else {
               // I'm a guru. WTF? Don't they know that gurus' time is more important?
               List<Developer> devs = this.getProject().getDevelopers();
               Collections.sort(devs, new Comparator<Developer>() {
                  public int compare(Developer d1, Developer d2) {
                     return d1.getExperience(Calendar.YEAR) - d2.getExperience(Calendar.YEAR);
                  }
               });
               Developer junior = devs.get(0);
               // 0wned!!!
               return junior.writeCode(details);
            }
         }
      }
      
      // A new feature. Let's try the Internet first.
      Browser browser = Internet.getDefaultBrowser().open();
      browser.go("http://slashdot.org");
      browser.hangAround(Date.HOUR, 1);
      browser.go("http://javablogs.com");
      browser.hangAround(Date.MINUTE, 20);
      browser.search("BileBlog");
      browser.hangAround(Date.SECOND, 5);
      
      browser.go("http://www.google.com");
      browser.type(details.getShortDescription);
      browser.click(Key.ENTER);
      // No need to check that the code actually does what it's supposed
      // to. Google knows what it's doing.
      String contents = browser.getFirstLink().copy();
      
      Package package = this.getProject().getRootPackage();
      package.getClass(details.getShortDescription().trim()).write(contents);
      
      for (TestCase case : designDocument.getTestCases()) {
         boolean success = case.run();
            if (!success) {
               // Ignore - if the testers are smart enough to catch them,
               // hopefully this will be after I move to another project.
            }
         }
      }    
      
   }
}
d3ad1ysp0rk
Forum Donator
Posts: 1661
Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA

Post by d3ad1ysp0rk »

Too long to be really funny.
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Post by Jenk »

I got bored after reading "class", sorry.
User avatar
n00b Saibot
DevNet Resident
Posts: 1452
Joined: Fri Dec 24, 2004 2:59 am
Location: Lucknow, UP, India
Contact:

Post by n00b Saibot »

It is funny if you dig deep :wink: and BTW thats JAVA Code and not JS :roll:
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

Yeah, a bit too lengthy for me.
foobar
Forum Regular
Posts: 613
Joined: Wed Sep 28, 2005 10:08 am

Post by foobar »

Not funny. Anybody with half a brain could do that. This doesn't even get anywhere near The Daily WTF. :?
User avatar
php3ch0
Forum Contributor
Posts: 212
Joined: Sun Nov 13, 2005 7:35 am
Location: Folkestone, Kent, UK

Post by php3ch0 »

OK so it was not the funniest joke ever but it was the first one I have seen written like that. Having a look at the Daily WYF I see there are lots of better ones.

I apologise for my poor sense of humor.
Post Reply