SmoothFriction.nl

posts - 39, comments - 20, trackbacks - 0

Why I hate developing in PHP

This is wrong at so many levels:

if($this->mail_protocol == "pop3")
{
	$port = "110";
}
else
{
	if($mods["imap"]["SSL Support"] == "enabled" && ($this->ssltype == "tls" || $this->ssltype == "ssl"))
	{
		$port = "993";
	}
	else
	{
		$port = "143";
	}
}

Whoever can name the most anti-patterns in this small snippet wins a honorable mention in the credits of this post.

Print | posted on Monday, April 20, 2009 6:38 PM |

Feedback

Gravatar

# 

@tehlike:<br />Agreed, but PHP makes it so painfully obvious that you can. There's a few reasons most PHP samples you find on the web are low quality (even the ones in the online manual are questionable).<br />One of those reasons is that PHP is very easy to get into, which is good in itself. However, people who are relatively new to programming think they're good at PHP, post samples like this and tell others to do it as well. Take a good look at a bunch of popular PHP projects, and weep.
5/11/2009 7:56 PM | Erik van Brakel
Gravatar

# 

This isn't the problem of PHP. you can do the very same thing in any other language
5/11/2009 7:56 PM | tehlike

Post Comment

Title  
Name  
Email
Url
Comment   
Please add 6 and 6 and type the answer here: