?

Log in

No account? Create an account
entries friends calendar profile King Rat Previous Previous Next Next
Sloppy programmers - King Rat
Private Life
gkr
gkr
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.
4 comments or Leave a comment
Comments
(Deleted comment)
gkr From: gkr Date: March 26th, 2008 08:50 am (UTC) (Link)
Irony?
(Deleted comment)
gkr From: gkr Date: March 26th, 2008 08:56 am (UTC) (Link)
Eh, I've written worse. If I was a great coder anymore, I'd have written the plugin myself.
4 comments or Leave a comment