Archive for July, 2009

Complaining Online

Monday, July 27th, 2009

I’ve done this and I’ve seen it a lot online: complaining about a client, your job, or other circumstances involving people around you. It’s so easy to get on Twitter or Facebook and just type something quick. What about the consequences though?

You are posting in a public forum and if you work online like I do, is your work life really separated from your personal life? I suggest that online, there is no separation. In the same place that your friends can find out info or read your updates, so can your clients and your boss. Bitching about your clients to a friend in a public forum is a great way to burn bridges and cause issues at work.

This is a bit of a privacy thing too, not just a reputation management exercise. I’m not suggesting that you be fake online and present a polished image, but rather do you really need to share all aspects of your life with all people? Maybe it is a good idea to keep some things to yourself.

This is just something I’m thinking through so I welcome comments and discussion.

HTML 5

Thursday, July 16th, 2009

I’m fascinated by the huge amount of discussion going on right now around HTML 5. Both John Allsop and Jeffrey Zeldman have written some interesting commentary in the last couple of days outlining what they believe is wrong with both the spec and the process involved in developing the spec. Most interesting to me is that a lot of the so called mess is a result from an open process. A lot of us who work with clients on a daily basis have had the experience of working with a client that makes design decisions by committee and the pain if it there isn’t a strong leader in place to guide the process. Sometimes even if you have a strong leader you can end producing a lower quality product or a partial solution.

The openness of the web has created an environment where anybody can make a website without having to go to university or accept a specific standard to follow. You can choose to follow a spec but you can also choose to make your website work only on specific browsers or to develop very very messy code that can still work. I think that this is good – it is an open medium to which anybody can potentially publish – and bad – it’s now impossible to start over developing a new one-standard-fits-all solution.

HTML 5 attempts to address the web as it is and I think that all of this discussion is great. Let’s get it out in the open and have thoughtful commentary from seasoned pros and from new developers. Let’s not forget though that there does need to be guidance and direction otherwise we will never see HTML 5 move beyond draft status.

Working With Legacy Code – magic_quotes_gpc

Tuesday, July 14th, 2009

Sometimes you have to work with legacy code and you don’t have the budget to refactor it to remove practices that are deprecated. magic_quotes_gpc was a setting that was turned on for a lot of PHP 4 installations but it is now no longer a best practice to have it on. If you aren’t sure what that is, it automatically adds slashes or quotes data that comes in to PHP via cookies or a GET or POST HTTP request.

The PHP website has a good method of stripping out those slashes if you are unable to turn off magic_quotes_gpc (http://ca3.php.net/manual/en/security.magicquotes.disabling.php). But what if you need it on to run your legacy code? Here is the inverse of the solution that is provided on the PHP website:

if (!get_magic_quotes_gpc()) {
	function addslashes_deep($value)
	{
		$value = is_array($value) ?
		array_map('addslashes_deep', $value) :
		addslashes($value);
		return $value;
	}

	$_POST = array_map('addslashes_deep', $_POST);
	$_GET = array_map('addslashes_deep', $_GET);
	$_COOKIE = array_map('addslashes_deep', $_COOKIE);
	$_REQUEST = array_map('addslashes_deep', $_REQUEST);
}

Put that at the beginning of your script and it will add all of the slashes back in. Not ideal, but if you have no other option it will get you going again.