Progamming languages that don’t do what you expect.

Try this:

$a1 = “0d2”;
$a2 = “0d3”;
$b1 = “0e2”;
$b2 = “0e3″;

if ($a1 == $a2) print ‘$a1 == $a2’.”n”;
if ($b1 == $b2) print ‘$b1 == $b2’.”n”;
// In fact
if (“0e2” == “0e3″) print ‘”0e2” == “0e3″‘.”n”;

// But
if ($a1 === $a2) print ‘$a1 === $a2’.”n”;
if ($b1 === $b2) print ‘$b1 === $b2’.”n”;
if (“0e2” === “0e3″) print ‘”0e2” === “0e3″‘.”n”;

// I can cope with this behaviour for ==, even though it is strange,
// as says:
// “If you compare two numerical strings, they are compared as integers.”

// However, says
// $a == $b Equal: TRUE if $a is equal to $b.
// $a === $b Identical: TRUE if $a is equal to $b,
// and they are of the same type.

// Demonstrably, whatever type php decides the first argument is,
// it should be the same as the second.
// So === should have the same behaviour as ==
// Agreed? 🙂
// The worry is that the temptation is to use ===,
// but I really think that strcmp is the only true way.
// There must be shedloads of programs out there
// which use == for strcmp on input,
// but would break if the input looked like a small double
// (in case you hadn’t worked out why yet!).
// I think I’ll change my name to “0e1″ 🙂

// And before you ask
if ($a1 != $a2) print ‘$a1 != $a2’.”n”;
if ($b1 != $b2) print ‘$b1 != $b2’.”n”;
if ($a1 !== $a2) print ‘$a1 !== $a2’.”n”;
if ($b1 !== $b2) print ‘$b1 !== $b2’.”n”;

// So at least it is consistent.

Which gives:
$b1 == $b2
“0e2” == “0e3”
$a1 != $a2
$a1 !== $a2
$b1 !== $b2

Flattr this!

The person who invented the blue LED.

And then everyone who decided to put them everywhere.
You try and look at your computer screen, but as soon as you switch it on the LED switches from orange to blue, and blinds you.
Then you look for a book, and your eye is blinded by the two LEDs the computer manufacturer has chosen to put on the front of his crappy box, to pretend it has some class.
At least it could be understood that the blue is so luminescent compared with the others, and toned down to reasonable levels.
And then you go outside and some tosser has ten on his car.

Flattr this!

Beds in modern hotels.

I mean, why do they bother putting the bed in at all?
They are so hard that I might as well be sleeping on the floor.
What is the point of having 12 inches of mattress and only using the top half inch?
And then when you go and complain about it they sometimes have the cheek to argue with you that it is good for your back – like they should be telling me what is good for my back?
Do they think they are doctors or something?
Hard beds really do my back in, if I manage to get any sleep at all.
Am I the only one who has ever complained about it?

Flattr this!

Staying in expensive hotels.

Because every time anything goes wrong, and things do, I get annoyed they can’t get it right.
If I am paying half the price then I expect things to be less than perfect, but when it is £100 a night, I don’t expect the automatic wake-up call to be 7 minutes late, and the call lift button not to work, and the toilet seat to be as sharp as a craft knife on my bum, and the toilet cover to bang down when I flush, and £5 an hour or £10 a day for internet is outrageous, and seven television channels is pathetic, they could at least have Freeview, and I expect enough white sugar for two cups of coffee, not just one and even some biscuits or shortbread would be reasonable, and there is a huge hum coming from the ventilation in the bathroom.
And that was just this morning.

Flattr this!