8 Replies - 2456 Views - Last Post: 02 July 2013 - 10:43 AM Rate Topic: -----

#1 Duckington  Icon User is offline

  • D.I.C Addict

Reputation: 164
  • View blog
  • Posts: 599
  • Joined: 12-October 09

What is this, I don't even..

Posted 16 February 2012 - 02:19 AM

Came across this in our company code a while ago.

It's a small section of a large cron script which I was supposed to be going through and editing.

	
	        if ($s > 0)
	        {
	            mtrace ($s.' course(s) were skipped (duplicate ShortName)');
	        }
	        if ($p > 0)
	        {
	            mtrace ($p.' course(s) could not be fully created, due to errors. Though they make work, it is advisable to delete them and try again.');
	        }   
	        if (($e = $t - $n - $s - $p) > 0)
	        {
	            mtrace ($e.' course(s) failed due to errors');
	        }
	        
	        if ($cat_e > 0)
	        {
	            mtrace ($cat_e.' new category(ies) failed due to errors');
	        }
	            
	        if ($cat_c > 0) 
	        {
	            mtrace ($cat_c.' new category(ies) were created');
	            mtrace ('You may wish to manually Re-Sort the categories');
	            
	            // We don't automatically sort alphabetically, as the somewhat clunky category sorting
	            // method used by moodle could annoy the user
	        }




Yeah I didn't have a clue either. When I eventually found $s, $p, $n, $t, etc... the letters weren't even anything to do with what the variable stood for.

Gave up in the end and just re-wrote the entire thing my way, works much better now.

Is This A Good Question/Topic? 0
  • +

Replies To: What is this, I don't even..

#2 ragingben  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 170
  • View blog
  • Posts: 637
  • Joined: 07-October 08

Re: What is this, I don't even..

Posted 16 February 2012 - 02:42 AM

Yeah, crazy variable names do my head in. When I rewrote the software for one of the medical robots we make at work (I took over from my boss who was the only coder) I found a variable named nicePanini and a goto mmmBrieBaconBaguette. Made converting it way more confusing than it needed to be
Was This Post Helpful? 0
  • +
  • -

#3 JackOfAllTrades  Icon User is online

  • Saucy!
  • member icon

Reputation: 5951
  • View blog
  • Posts: 23,214
  • Joined: 23-August 08

Re: What is this, I don't even..

Posted 16 February 2012 - 05:13 AM

I would warn anyone who worked for me and used nonsensical variable names ONCE. If it continued, they would be soon to join the unemployment line.
Was This Post Helpful? 1
  • +
  • -

#4 nelsonhoover  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 03-July 10

Re: What is this, I don't even..

Posted 16 February 2012 - 10:33 AM

View Postragingben, on 16 February 2012 - 03:42 AM, said:

the software for one of the medical robots we make at work (I took over from my boss who was the only coder)


Wow, Hopefully it's not some heart surgery robot or something. Sure wouldn't feel comfortable having a robot work on me that had all sorts of cute variable names, etc, in the code.
Was This Post Helpful? 0
  • +
  • -

#5 Braber01  Icon User is offline

  • D.I.C Head

Reputation: 5
  • View blog
  • Posts: 243
  • Joined: 29-November 08

Re: What is this, I don't even..

Posted 23 February 2012 - 08:19 PM

Isn't there an Exception for Python Coders?
Was This Post Helpful? 0
  • +
  • -

#6 e_i_pi  Icon User is offline

  • = -1
  • member icon

Reputation: 782
  • View blog
  • Posts: 1,663
  • Joined: 30-January 09

Re: What is this, I don't even..

Posted 24 February 2012 - 12:23 AM

*
POPULAR

We had a guy at our work who used silly variable names. Had...

This post has been edited by e_i_pi: 24 February 2012 - 12:23 AM

Was This Post Helpful? 5
  • +
  • -

#7 Orthoducks  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 27-June 13

Re: What is this, I don't even..

Posted 29 June 2013 - 02:58 PM

At my second job out of college (I posted a story from there a couple of days ago) we had a senior programmer who was a joker. His sense of humor ran to things like funny variable names.

This was an assembly language shop, so program statements looked like this:

MAIN    STM   R15,R12,SAVEREGS    START OF MAIN ROUTINE


(MAIN was a label. STM meant "store multiple." It stored registers 15, 0, 1, 2,... 12 in the area beginning at the label SAVEREGS. The rest was a comment.)

I remember encountering this when I was assigned to maintain one of his programs early on:

BACK     STM    R15,R12,SAVEREGS


BACK? I thought? Why BACK? I couldn't think of a plausible reason for labeling the start of the main routine BACK.

The mystery was solved when I got to the end of the program:

.        B      BACK              TO THE START AND DO IT ALL AGAIN!


"Branch BACK to the start and do it all again!" Ooooh... Jim was so clever...
Was This Post Helpful? 0
  • +
  • -

#8 depricated  Icon User is online

  • Behind Seven Proxies!

Reputation: 410
  • View blog
  • Posts: 1,423
  • Joined: 13-September 08

Re: What is this, I don't even..

Posted 02 July 2013 - 07:25 AM

My favorite was the java exception named "baby" so at the end of the lien it would "throw baby;"
Was This Post Helpful? 0
  • +
  • -

#9 Orthoducks  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 27-June 13

Re: What is this, I don't even..

Posted 02 July 2013 - 10:43 AM

I once saw a Cobol program that told the story of Goldilocks and the Three Bears. For example

IF BEARS ARE IN HOUSE THEN MOVE GOLDILOCKS TO WOODS.


But this is in the domain of "genuine" humor rather than coding nightmare.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1