March 26th, 2008

Logo

Sloppy programmers

I just spent the last few hours trying to figure out why, when I added the ShareThis Classic plugin to my web site everything went to hell.

Turns out that the problem is Amazon.com. I have Product Previews turned on for my site. It makes fancy pop-ups that show the price of books I'm reading. But it does something sloppy. Everything worked for a while.

ShareThis uses the Prototype javascript library, which makes modifications to the core array datatype. The Amazon code doesn't expect this, even though it should. Everything is malleable in javascript.

I made a passing attempt to hack ShareThis to not use Prototype, but wasn't successful. It doesn't look like ShareThis uses much from Prototype, but Alex King's code is pretty spaghetti, so I haven't been able to unwind where the dependencies are. I ran into a problem with his spaghetti code for another plugin as well. Too damn many wordpress "developers" can't write clean code to save their lives.