My code works and I have no idea why

When Greg sent us that funny little photo saying, “My code doesn’t work and I have no idea why. My code works and I have no idea why,” I had to laugh. I had just spent an hour trying to decode the JavaScript we’d hurriedly written in class enough to add captions with divs. I changed around some tags and parentheses for a while, and all of a sudden, after several iterations that made the photos all disappear, all appear, or refuse to flip, it finally worked. And I had no idea why. I couldn’t even remember what I’d changed that time – it didn’t seem more significant or profound than everything I’d tried before. It was almost more frustrating to see it work for a reason I couldn’t explain than to see it fail.

 

2 thoughts on “My code works and I have no idea why

  1. Rob Snyder

    That’s hilarious, and spot on. It’s killing me not to know why my code didn’t work one way and yet worked another way (that was seemingly exactly the same way as the first). It makes me wish I had more time to compare the two. There are actually text comparison “thingermabobs” you can find online (http://www.diffnow.com/), if you get the time to save your iterations as you reiterate! 😉

    Reply
  2. Isa Thompson

    Your so lucky. My code totally does not work and I truly do not know why!!! My new blog name will soon change to pulling my hair out.

    Reply

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.