Friday, January 26, 2007

why php coders suck: part II

in previous post i wrote about how php coders handle time values.

now i gonna tell you how they handle some other values.

ok, here we go.

we have another <select> box in html, which allows a customer to select type of order.
and guess what? sucker uses idx=orderTypeBox.selectedIndex for indexing his javascript arrays!

so if i want to add NEW order type to this dropdown, in between of 2 older types - it's a dead end! only appending to the end is possible. that, or inserting new type parameters in the middle of 20-something javascript arrays, trying to not screw-up everything

and i know boss gonna want exactly that - i.e. she would like new types in the middle.

oh crap.

and that's not all.

php coders love to make traps for people who will work with their code.

there's some <select>s in html templates which get overwritten on init by javascript so that they contain completely different values.

e.g.

written in original html:

<option value="24 hours">24 hours</option>

written by javascript on init:
<option value="24">24 hours</option>


so when you trying to figure out what values you're expecting - you're in trouble and grep is your best friend.

10 minutes tasks transform into longtime blockers.

0 comments: