Coding

I’m falling behind on projects because I’m stuck on something. I’m trying to design a new Mike and the Ninja website in time for Cape Comic Con, and I want to implement a PHP archiving system that will automatically attach the right comic, date, and blog entry to the page when a user clicks on a corresponding link. This eliminates the need to build an individual webpage for each individual Mike and the Ninja comic, which would be extremely inefficient. Instead, I build one page, and it pulls in the right comic and info.

However, it doesn’t work. My code looks good, and doesn’t produce any errors. Instead, it just produces a blank page. No comic, no title. Nothing. What is happening? What is the problem?! At the rate I’m going, it might take less time to build 305 separate web pages for each comic than to build this one page that it turns out I don’t actually know how to build.

Here’s the thing. I know a little about PHP, which is the worst position to be in. If I don’t know anything about a programming language, it’s an okay position to be in because if I look at code I don’t know, it doesn’t mean anything to me, and I can just ignore it. If I know a lot about a programming language, I can dive right in and do whatever I need to do, so that’s also a good position to be in.

But, if I know a little about a programming language, I’m in trouble. Knowing a little produces a false sense that I can write functional code, but that is not the case. I might as well be sitting over here banging rocks together trying to get this thing to work. By complete accident, I got the archive page—the page that lists all the comics—working just fine. But getting just one comic to show up (which I feel should be significantly less complicated) is impossible, even though I’ve seen a million other comic sites, news sites, and blogs do it. In fact, this blog is doing it right now, but I have WordPress to thank for setting it up for me. But WordPress is actually too complicated for the purposes of the comic site, so I don’t want to resort to that. Plus, this is something I need to learn to do myself. I’ve been talking about learning PHP since 2008, and it’s gotta happen sooner or later.

Frustrating as it is, this is a necessary step in how I learn to code. I’ve taken numerous online courses on javascript and php and several other languages, but the results have been unsatisfactory. They help me learn the syntax, but because the courses are all built on completing partial, example projects, they don’t help me learn to build my own projects. As soon as I am faced with creating something on my own, outside the confines of the lesson, I’m still too dumb to figure out where to start. From my experience, the best way to learn code is to give myself a project and muddle my way through it until it works. As I take on more and more projects in the same language, it gets easier each time, and soon enough, I get to a point where I know what I’m doing.

Since I started writing this blog, I did finally figure it out. One word somewhere in the code needed to be another word, and once I changed it, it worked. In an instant, utter frustration became jubilation, and my knowledge of PHP graduated from “total gibberish” to “almost total gibberish that sometimes makes things appear on the screen.” So, I think I might finally be getting somewhere.

Now begins the repetitive task of moving all of my old comic blog entries into the database. It’s going to be a lot of work, but once the new site is done, it’s going to be great.