5 Replies - 1488 Views - Last Post: 24 February 2012 - 12:23 AM Rate Topic: -----

#1 Duckington  Icon User is offline

  • D.I.C Addict

Reputation: 162
  • View blog
  • Posts: 588
  • 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: 164
  • View blog
  • Posts: 612
  • 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 offline

  • Saucy!
  • member icon

Reputation: 5666
  • View blog
  • Posts: 22,509
  • 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: 236
  • 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: 745
  • View blog
  • Posts: 1,521
  • 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
  • +
  • -

Page 1 of 1