Database

The server requested authentication method unknown to the client [mysql_old_password]

I updated my server this morning, moving from Zend Server PHP 5.3 to 5.6 but when I did I got a really weird error. The server requested authentication method unknown to the client [mysql_old_password] I spent way too much time debugging it but it turns out that this is an incompatibility between MySQLnd and MySQLContinue Reading “The server requested authentication method unknown to the client [mysql_old_password]”

PHP

I’m actually really excited about Hack and HHVM

When you get to be my age you start thinking about the future.  You start wondering if some of the choices you made when you were younger.  You wonder if those choices are going to come back and haunt you.  If you don’t have such thoughts you are either an idiot, or a young personContinue Reading “I’m actually really excited about Hack and HHVM”

Opinion Wordpress

Migrated the blog… to WordPress

… to WordPress? Yep.  I had written my blog from scratch, partially because I wanted to use it as a testing ground for various ideas and such.  However, part of the problem of maintaining your own blog software is maintaining your own blog software.  I think that I’ve pretty much milked the code for allContinue Reading “Migrated the blog… to WordPress”

Opinion

I hate config files

I hate config files. There, I said it. Made a change to your configuration? Database? Temp location? Gotta redeploy your application. Even if you have an awesome deployment mechanism it just seems somehow wrong to have to redeploy your app to make a configuration change. From a security standpoint, I don’t particularly like having passwords and such being stored in a source repository. Or making it part of your build process. Or manually editing files in production.

Random

Objections to dynamic typing

I am about to head out to Magento Imagine to speak on queuing and scalability. So what is today’s blog post about? Dynamic typing; which has absolutely nothing to do with scalability.
Every once in a while I inject my opinions into places where they are not welcome. I have heard from people in the staticly-typed realm of how amateur dynamic typing is. Some people are interested in understanding how to use dynamic typing, others, not so much. So what I would like to do is talk about some of the arguements made against dynamic typing. Clearly PHP will be my reference point, but many of my points will be salient across many dynamically typed languages.
The biggest misconception about PHP is that it is a strictly dynamicly typed language. In other words that cannot have typed variables. Where you are using the OOP mechanisms in PHP, you have the opportunity to strictly type your variables.class Test {}
class ExecuteTest
{
public function exec(Test $test)
{
doSomethingWithTest($test);
}
}
$et = new ExecuteTest();
$et->exec(new Test());
What happens when this code gets compiled?Catchable fatal error: Argument 1 passed to ExecuteTest::exec() must be an instance of Test, instance of Test2 given, called in test.php on line 17 and defined in test.php on line 9
Fatal error. This is because the type of object passed in was incorrect. So data types do exist in PHP and many other languages. The only downside is that you need to actually run the code on your web server or in a unit test to compile it. Some would (and have argued extensively) that this is a significant drawback. There’s truth to that, but on a very limited scope. Is it a drawback? Yes. Is it signficant? Not by a long shot. Whether it’s PHP, Java, C, Perl, Ruby, VB, C#, JavaScript, etc. etc, if you deploy code that you haven’t tested then you deserve every error and every sleepless night you get. It’s called being responsible for your code. And don’t think that having your code pre-compiled is much better. I have a lot of compiled applications running on my computer. Cakewalk SONAR, Firefox, Apache, PHP (the binaries), MySQL, Tweetdeck, Java, etc., etc. And you know what? Shit still happens with compiled code! Sometimes even type-related errors! Compiling your code ahead of time as you do with C, Java, and the like does not protect you from type-based errors. Can you catch some fat-fingered errors? Sure. Are you safe? No.
For example, take this Java codeSystem.out.print(
Integer.MAX_VALUE
);
Running it provides an output of2147483647
What about this code?System.out.print(
Integer.MAX_VALUE + 1
);

Random

Building better PHP programmers, part 2

I have no “findings”, no “conclusions”, but I have some thoughts on my continuing goal to help bad/nominal PHP programmers become better PHP programmers.

The first question I asked is “Is there really a shortage of good PHP developers?” While I didn’t get a specific answer the general jist of it is that yes, there is a problem with finding good PHP developers. Now, some of that may that the people responding ARE the above-average PHP developers and so there can often frustrations in figuring out how to work with developers who don’t yet have the chops that they do.

Random

This week’s book giveaway

This Friday I will be giving away the second (technically 4th and 5th) copies of my book “You want to do WHAT with PHP?” The rules still apply; if you win I will ask you to cover shipping costs. See one of my previous posts on what that looks like.

So, to win

Tweet this posting. I will change it up a little and say that it needs to contain the bit.ly link for this page. I will make the drawing based off of who bit.ly says has tweeted it. The ywtdwwphp hashtag was a little wierd.

Become a fan of my Facebook page and Like this posting. The Like will be how you will be entered. But remember, the winner will be asked to cover shipping costs.