Things coders do to appear inscrutable

We all have them: self-appointed guardians of the code base. They will rigorously go over your classes with an eagle eye. They will find the suspicious code and point it out. But they won't fix it. Here are some of the things they do that make you want to drive an ice pick into their monitor.

They yodafy their conditionals

If you've ever come across a conditional like the following,

if (3 == $flag_value){
        ...
   }

 then you've run across a yodagrammer and it is now your duty to find this person and slay them with a light saber. The only people who write code like this are the same people who carry on conversations in kermit-esque voices, saying things like, "Eat that muffin, you must," and then look at you like they think that you think  that they are the wittiest person since Groucho Marx hung a duck from a ceiling.

They Egyptifikill

You will hear their clarion call: "Everyone knows that brackets should be on their own lines. It makes it easier to read!"

If they come across:
if ( ... something ... ){
      ...
   }

They will change it to

if ( ... something ... )
   {
     ...
   }

and then they will let you know that they had a hell of a time getting through the code because the crazy brackets were so damned confusing. The best way to deal with these people is to agree with them wholeheartedly. Every time you come across one of their changes


if ( ... something ... )
   {
     ...
   }

Change it to


   if 
   ( 
        ... something ... 
   )
   {
     ...
   }



They point out 'bad' programming in comments


Whenever they come across questionable coding, they make sure everyone knows that they have come across questionable coding with indignant comments. But here's the kicker: they don't change it.

/**
    * OMIGOD please please PLEASE 
    * don't write code like this
    * magic numbers are HORRIBLE
    * and only sucktarts write code
    * like this
    **/
   if ( $some_condition == 1 )
   { 
      ...

They go crazy on indented embedded calls


Seeing a string of chained method calls drives them to reformat the code. In fact, they will spend an hour going over the code base to 'clean up' the code. This:

  $x = $this->getVal()->formatVal()->upendVal( $first_param, $second_param);

becomes

  $x = $this->getVal()
         ->formVal()
         ->upendVal(
             $first_param,
             $second_param
           );

In theory, this makes it more readable. In reality, there is no actual evidence of this. Rather this is just inscrutable gospel. In true reality, it makes it even less readable because the person that has rewritten this has his IDE set up with screwy tab values, and it renders like this to everyone else:
  $x = $this->getVal()
                               ->formVal()
                                ->upendVal(
                                             $first_param,
                                                       $second_param
                                       );

No comments:

Post a Comment