AJ Dyrbye

Web Developer and Digital Humanist

Tag: php

Github repository

Quick update: As of today, all code and other associated files I created for my Masters thesis are available on Github.

This includes not only the final thesis, but also the full code for the case study website I developed as the project portion of the thesis. As such, it provides an example of my work in XHTML, HTML5, CSS, CSS3, PHP and MySQL dating from 2012 and 2013.

JavaScript, PHP and Planning my First Solo Project

So JavaScript has been going well. I’ve been going through CodeAcademy’s modules at a satisfying pace.

In particular, it turns out that my background in PHP has been really helpful. The two languages are more similar than they are different:

PHP vs JavaScript

A comparison of basic PHP and JavaScript.

 

And so on. If/else is structured the same way, right down to the curly braces, and I won’t be surprised to find out loops are too.

The choose-your-own-adventure module was a disappointment, though – it was plunked in so early on that it didn’t convey any of what I’d hoped. Instead of the rough outline of a complex set of possible inputs and outcomes, it set up a yes/no scenario and completed. There’s a second one forthcoming that may be a bit more what I have in mind, but I’m not holding my breath at this point.

That said, I’m confident I’ll be ready to try out the more complicated version on my own in another day or so. I’m aiming for an experience similar to Zork, or, if I can get myself to the point of including static graphics, the early King’s Quest games. Here’s what I’m picturing:

An interface in which users are encouraged to type key words and phrases to proceed, based on the context provided.
Multiple outcomes, anticipating two to five possible user inputs, plus a set of fail messages (“I don’t understand ‘popsicle’”) which may include some easter egg type responses for some input.
Testing user responses will require string matching, with the strings run through a change to uppercase or lowercase function to ensure user input can be case insensitive.
Outcomes are loading into a variable when the user has made a valid choice, with one  other designating the encounter. Layered if/else or switch/case statements then pass the user to the appropriate next encounter.
I’d need at least two functions: One to allow users to quit/restart based on a preset keyword, and one to bring up play instructions.

I expect this would give me the complexity I want while being appropriate for my current skill level. As my skill level grows, I can use it as a framework to practice on. I’m aiming to include some HTML5 and CSS3, and an interface permits users to type directly into a field in the page rather than relying on a series of annoying on browser popups.

I’ll make the game in progress available through my University of Alberta homepage.

On CodeAcademy as a learning tool

So, today I finally got back to my CodeAcademy account. I’m pleased to be making progress again, as I’d stopped in the middle of one of the later PHP modules, but I completed two steps before it reminded me of why I ended up stalling last time.

I’ve been using the site as a refresher and alternate perspective. I completed their HTML and CSS modules in short order; while it taught me a few things, it ended up mostly being a reaffirmation that I’ve at least got the basics down. The PHP modules have been a slightly different experience. The introductory modules almost entirely tread familiar ground, but I began noticing that I was having a harder time identifying and correcting problems than I was used to.

Once I was a few modules deep, I realized what was going on: I could have the problem solved correctly, but still produce an error because I wasn’t writing a string or variable name or whatnot exactly as the module had been programmed to expect. Human teachers aren’t hung up on these things, as it’s consistency that matters more often than not, so it took me a bit to realize when I was being failed for writing $somevalue rather than $someValue.

This wasn’t a big deal during, say, the Arrays modules. However, once I started getting to material that was new to me, particularly the Object-Oriented Programming section, a few concepts became exercises in frustration. I would get stuck trying to figure out where I’d messed up my code when I’d actually just used a letter case in my variable they hadn’t expected, or substituted my own string for their suggested wording where they were string-matching to ensure I’d echoed the right text. It began to drive me a little nuts, as I was often naming the relevant variables and whatnot consistently. The code would work, but not according to the lesson. Once I’d slogged through a handful of lessons with these types of snags, I took a break, and the break became weeks while I shifted focus first to my impeding thesis defense and then to post-defense finalization.

But, I still want to learn this stuff. Now that I’m no longer funneling most of my energy toward the university, I’m better equipped to persevere. I’m getting enough out of the modules that they’re worthwhile despite the occasional maddening extra layer of troubleshooting to contend with. I aim to go through at least the JavaScript and Python modules before I’m done with the service.

That said, I’m glad that I’m not coming to programming as an entirely new set of concepts. Getting classroom and work experience first has made it easier to work with the site’s quirks and the odd instructions that lack clarity.

© 2014 - 2016 AJ Dyrbye

Up ↑