Archive

Archive for September, 2009

Coding Practices at Large Companies

September 30th, 2009

I just had an interesting email exchange with one of my newer staff, a friend from university who worked for [insert name of company] for a number of years. Aforementioned anonymized company being a Fortune 500 company that is in the IT industry. I’ve got stuff with their logo on it in my office.

The conversation began when he asked if he could use a goto statement (in PHP code!) for error handling.

Bearing in mind that this is somebody who is extremely familiar with both Object Oriented and good coding practises, I realized that there must be an interesting story underlying this.

His response to my query for more info is informative:

Tease all you want — I’ll lean on the weight of nine years of experience at [big company name], where (gasp) gotos were ubiquitous (almost exclusively in error handling code, but still).

To clarify further: I actually wasn’t aware that PHP had a goto statement (see: php.net/goto – they have the nice xkcd cartoon in the comments). I’ve been coding in PHP for a long time.

There’s two methods that I usually use to handle errors in PHP code, in case you’re wondering:

1. Make sure that code that can crash is encapsulated in a nice neat function. Check return values of function calls inside the function. If necessary, stick an “@” before function calls that tend to crash in a messy manner. Then return useful info about the final state from the function itself, and check things out higher up in the stack.

2. Stick try/catch code around code that can crash. If necessary, subclass error classes and put in nice handlers for them.

In both cases, make sure that the error level for reporting is appropriate, and that we don’t output actual error messages back to the end user. Where useful, put in logging, and possibly put in code to email error reports back to admin.

Reblog this post [with Zemanta]

If you like this article, please share it with others:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • LinkedIn
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati
  • MySpace

Google Wave Releasing Beta

September 30th, 2009

Google Wave is releasing in Beta to about 100,000 people today. I have at least one staff member who is excited about this.

If you like this article, please share it with others:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • LinkedIn
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati
  • MySpace
Author: Jeremy Lichtman Categories: Uncategorized Tags:

When GPS Gets You Lost

September 24th, 2009

I’ve been hearing stories for years about excessively literal-minded people getting themselves in terrible trouble by paying too much attention to their GPS units.

I also once worked with somebody who would regularly call into the office with the complaint that their GPS had succeeded in making them lose their way.

The story reported on Yahoo’s tech blog here (http://bit.ly/lEXUH) is a pretty good one though.

Almost as good as the guy that went off the autobahn, across a field, and smashed his 7-series BMW into a porta-potty.

If you like this article, please share it with others:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • LinkedIn
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati
  • MySpace
Author: Jeremy Lichtman Categories: Learning Tags:

Office Update

September 17th, 2009

Our office is starting to look a little bit more business-like and comfortable. The other day we actually had a water-cooler conversation. The reception desk is courtesy of Erez at MIT Consulting, who didn’t need it any more. Moving it required a bit of “sweat equity”.

[Sorry - due to a server move, the photo gallery is temporarily broken]

If you like this article, please share it with others:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • LinkedIn
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati
  • MySpace
Author: Jeremy Lichtman Categories: Uncategorized Tags:

Services

  • Software Development
  • Web Development
  • Social Media
  • Search Engine Optimization

Partner Companies

Follow Us of Twitter