Pushing Buttons

19 Jan 2021

Well, I’m still frustrated and feeling ultimately defeated. I do believe that i can learn this, but I also believe my efficiency sucks. I’m either slow at learning or get trapped and it takes me forever to get out.

I finally got cookies to work all the way through setting up the game. But now it won’t play. It really sucks when i feel like I’m soooo close, and then I do something and break it all and cannot remember what I did that broke it. Then i get trapped in just making it work—i regret to say that I abandon testing and test by writing and running and writing and running, until…all my tests break… {eye-roll}.

That happened a lot today. But by the end I had the game almost kind of running through set up. Then at the last possible minute, i had to leave to go get the boys. I picked them up, received an offer on the house, put them to bed, and then decided to write a test—it was going to be in trouble afterall, if i had a bunch of functioning code with no tests…

I wrote a test for the cookie-map—and now that I actually understand what my cookie looks like, I could write the test (hence the lack of tests to begin with). I wrote a test with the target that I wanted to achieve. Then i spent maybe ten—maybe even just five—minutes working on getting that to pass. It passed.

Hmmm…let’s try running the game. A couple things went wrong with some nils & nulls, but no big deal. Let’s work those out—added a null to my test, made it pass, & ran the game.

Hmm…it worked. Everything works through setup, now i just need to correctly pull the game out of MySQL as it should already be saving.

Why is it in our nature—or at least mine (although, I’ve heard it about most if not all programmers) to abandon tests because they are too hard or take too much time or because you’ve been come frantic because you only have 4 more hours until you must pick up the boys from school?!

I’ve also been told over and over whether in person or through video lessons that tests actually speed you up, and today was a prime example. Had I had another 4 hours to work, i probably would have gone at it exactly as I had been with the same lack of success. Only after I’d given up, had some time to think, and then went back to it—just to write the tests of course, did i actually seem some progress.

Why in the moment of crisis would I abandon a tool that would ultimately help me? I can tell you one reason—as I’m learning, I just don’t know what the tests are supposed to look like—like what does a cookie look like? What will the server do with the cookie—abandoning the entire knowledge that I, in fact, wrote the server and it will do with it as I tell it to.

Turns out, cookies are just little bits (maybe a byte or two) of data that can be manipulated or dare I say string-parsed (ugh!) to become useful. Nonetheless, I got frantic and felt like i was super behind because at 9AM this morning, I’d promised to ping Micah in the morning and still haven’t (it’s now 9PM). At 11am, i told myself, one more hour and then i have to ping him, but then i was on to it and soooo close, so i spent the next couple hours becoming more and more frustrated while practicing Einstein’s theory of insanity.

Once I was calm and no longer under-the-gun (because I’d given up), i figured it out…

I’ve learned this lesson already, yet still, when i become frantic, even with a little voice in my head telling me “write a test!”, I abandon my instincts and instead frantically push buttons hoping that something useful will come out of them even if just by chance.

I’m frustrated and feeling defeated, incapable, and like a disappointment.