Why I like Starbucks

I like going to Starbucks in the morning for three reasons:

1. They have reasonably priced coffee,
2. They give me wifi and a place to hack in peace,
3. They pack their counter with loads of impulse buy items.

That third one is important: at 6AM, the last thing I want to do is make eye contact with anyone, much less one of their employees. The stacks of CDs, coffee packets, and nuts give me something to look at instead of them.

So I will buy your CDs, if only to avoid the small talk.

How to create an alias in Linux

How to create an alias

What is an alias?
An alias is a command typed on your terminal command line which immediately runs a macro of shell commands.

Where do I add my alias?
In your .bash_alias file, which is located in your home directory. To see a list of all hidden files, type ls -a.

How do I create an alias?
1. In the .bash_alias file, type "alias='<enter your command here>'
2. Save the file
3. Type in source .bashrc to reload your .bashrc file (which adds the aliases to your environment)

The reason I left one development job


A few years back at a place I worked:, the CEO said, "I never hire anyone over 40"

He looked at me with his early 30-something wisdom and reasoned. "They just don't get it."

"You just unhired me," I told him. "Well, you're different," He said. "I know it's not a good rule. But I still try and follow it."

The thing is, he's not that different from anyone else. He just has the insight to acknowledge that he was blowing smoke out of his ass.

We all make arbitrary rules that we follow, even ones we openly admit are based on fairy tales. In this specific case, his rule was just as arbitrary as any other. It was just also really stupid.

But developers do this kind of thing without giving it a second thought. How many of us are staunch advocates of camelCase or putting brackets on their own line? How many of us refuse to use one or another framework because "it's lame"? How many of us refactor because it "eliminates duplicate code", regardless of whether or not it makes the application less readable and maintainable?

It's human nature. We have to do it. It's how we get through the day. If we didn't we would have to come up with some semblance of a reason why we do the million little things we do. We would be so busy trying to rationalise why, that we would never end up doing it in the first place.



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
                                       );

How to commit a file permission change in svn

After constantly losing my permissions on a file with every update and commit, I finally had to do some research to figure out how to get the new permissions committed to svn. It turned out to be quite simple:

# svn propset svn:executable path/to/my/script/my_script.cgi
# svn commit

For more: http://svnbook.red-bean.com/en/1.0/re23.html