Via Tim Bray’s blog I found zestyping’s “Why PHP should never be taught”. In it he provides some interesting PHP code that will be difficult for beginners to understand.
$a = 0; $b = "eggs"; $c = "spam";
yields:
a == b b != c a == c a == d b != d c != d
(Please note that d hasn’t been defined). In the comments, people freak out and tell him that this behaviour is defined in the documentation. I guess that makes it even worse.
Trying the same thing in Ruby:
a = 0 b = "eggs" c = "spam" a == b => false b == c => false a == c => false a == d NameError: undefined local variable or method 'd' for main:Object from (irb):7