I got stuck with a project yesterday. Really stuck. I was stuck all day long. I’d built a website in honor of my daughter’s Harry Potter themed birthday party. The website had two purposes: 1. To share pictures with friends and family. 2. To practice my code skills.
I’m a brand new web developer. I took my first programming class (Ruby) five months ago, wrote my first line of HTML two months ago and my first line of JQuery about a month ago. Everything is still very new to me. I’ve been feeling like I needed a deeper understanding of CSS and this seemed like a fun way to get it. So I opened up my text editor (which still feels very fancy and technical) and began putting in some HTML. Then I added some CSS and started to code a little pop-up modal just for fun. I wanted to get a sense for how it was starting to look. So I copied everything into JSBin and it looked fabulous. I decided to add a little more JQuery to finish up my pop-up modal, to spice it up a little. I also added some expandable sections on the page. My JQuery pieces came together like they never have before. My code ran correctly the first time, which I was not expecting at all. Usually I have at least one typo, if not a coding error or two.
So I turned to Google. All day long I poured over articles, Stackoverflow posts, the JSBin help section and even coding forums I’d never seen before. I’d walk away for awhile or work on my current Ruby project and then I’d come back for another look at my JS dilemma. I ran both my HTML and my CSS through the validator. I found and fixed a couple of HTML errors but my CSS was perfect (for the first time ever!). I added and removed various lines of code, trying to see if a plugin here or there was causing errors. None of those changes made a difference. I’d reached out to a few people online that I thought might be able to help, but hours had passed and I was no further in fixing my broken code. I was absolutely, solidly, stuck.
The second thing I love about broken code is that even when it’s entirely broken, I can know with confidence that there is a way to make it work. There is a “right answer.” If I work hard enough, it can be figured out. That’s something that just hasn’t really existed in my last two professions as mom and teacher. There is no one right way to parent a child that we can know with certainty will produce a desired result. There is also not a single right way to teach every child that will result in the same outcome each and every time. In contrast, I really appreciate the black and white nature of writing code. Either your code works or it doesn’t. And if it doesn’t work you can fix it so it does, provided you’re stubborn persistent enough, which I am.
Finally, the last thing I love about broken code is the freedom to fail. There’s almost an expectation of failure when you’re writing code. True, in the end your code needs to work well, but it’s highly unlikely that anyone’s code is perfect the first time they write it. Otherwise there wouldn’t be such a plethora of websites and articles devoted to debugging code. Code is buggy. Whether it’s because you have a real life moth in your mainframe, or have a missing semi-colon, it’s rare for code to start out perfect. The realization that virtually no one starts out perfect takes the pressure off and frees me to be more creative and relaxed when I am building with code.
I’m having fun writing code. I think Web Development is a particularly fun place to build because you can almost instantly see a physical representation of your efforts. It makes the abstract logic of programming much more concrete. So even though I know I can expect lots of broken code in the future, I’m still excited about programming. I’m excited because I know that even when my code is broken, I will be able to fix it, and that sense of accomplishment is empowering and motivating. It’s what keeps me going.