Social and Ethical Responsibilities

This morning I was attending Zeev Suraskis keynote at the International PHPConference in Mainz/Germany.

He spoke not so much about PHP or new technologies but what happens when technology fails. He gave us an insight into the things that happened around his last holiday in the south of Italy starting with a lost Internet-connection through a malfunctioning lens, a dead GPS-Display and his troubles getting mobile internet-access up to the dead fridge back home.

Besides the strange accumulation of bad luck it again showed me how much we depend on technology.
Continue reading Social and Ethical Responsibilities

What makes a good developer?

One Day comes the question, what differentiates the good developer from a really good developer.

At that stage the question is not any more whether you can code or even which language it is you code best. Of course you have a “preferred” language that you know very well, but it should only be a matter of weeks to learn a new language from scratch as the principles are more or less the same in all languages. The same design-patterns apply as well as the same control-structures.

So what makes the difference? Continue reading What makes a good developer?

Valid Syntax errors: Part 1

It took me about an hour to spot a strange behaviour in my PHP skript:

Have a look at this code:

$foo = array ( 'a', 'b', 'c' );
foreach ( $foo as $bar );
    echo $bar . "\n";
// Expected Output:
// a
// b
// c
// Actual Output: 
// c

What happened?

Would I have used phpcs it would have been obvious. I used a semicolon instead of a bracket after the foreach statement.

So instead of calling the echo command with each iteration the foreach silently iterated through $foo and assigned $bar on each iteration. That left $bar with the last value of the array that gave the strange output.

I can not actually remember whether there had been closing brackets but I did not get an Error regarding that.

phpcs would have detected the missing brackets — if that would be observed by the used sniff.

More on phpcs later.