The Montoya Herald, a weblog about Blueprint, jQuery, design, music and life, publishing on the web since September 2005. Written by Christian Montoya: developer, designer and entrepreneur.

The Montoya Herald — ChristianMontoya.com

Search

I Recommend

Genesis Rocket

Like What I Do?

My Amazon.com Wish List

On this domain

Elsewhere

Teaching Web Design, part 6

Posted on October 19, 2006.

It's been a while since my last update on this "teaching web design" series, partly because I didn't teach two weeks ago due to Fall Break, and partly because I spent all of last weekend and this week on two very difficult projects. In all that time I've come up with quite a lot to talk about…

We had our first exam right before Fall Break, which was ideal for the students since we were able to grade the exams and report those grades the night before the deadline for dropping classes at Cornell. I was able to contribute to the exam while it was being written (it was a team effort) and I helped grade it as well. It was, in my opinion, a challenging exam for anyone who hasn't been doing this type of stuff for more than half a semester (which applies to the majority of the class). In that respect, it was typical Cornell. Questions involved finding errors in an XHTML document, writing XHTML to produce a sample page, writing specific CSS to produce a sample layout fragment, drawing a tree for an XHTML file, critiquing an ugly webpage based on usability and C.R.A.P., and describing how to improve a design with C.R.A.P.. Sound good?

The distribution of grades was somewhat large (again, typical Cornell), and we did have some students drop the course the next day (though not that many, thankfully). You could say it was a good way to allow students to decide whether or not they were doing well enough in the course to keep going, which was very important considering that last year (when I was taking the course), there were a lot of students that made it all the way to the final exam without being capable of writing a PHP or CSS file to save their lives. No exaggeration, seriously.

I also got my midterm evaluations from my students during that week, but in the interest of confidentiality, I'll keep those to myself. They were very helpful :)

After we came back from Fall Break (last week), we started PHP. Keep in mind that at least half the class has no experience with programming whatsoever, so we are currently faced with the task of introducing basic concepts of programming to students who might not have even known what PHP was before we started. It's not easy.

Last Friday I was covering variables and strings. To a techie, variables are easy as cake. We often take for granted how alien the concept of a variable truly is to those not acquainted with programming. I've actually been a little frustrated with some of my fellow TA's lately (there's six of us in teaching and at least 10 in grading). Some of them think these basic concepts are easy and don't see why students would find the stuff difficult. One of my fellow TA's said that he introduced the concept of variables to his students with something like, "if you've done algebra you've already seen variables, they are like X's and Y's in math equations." Maybe it has something to do with the fact that I learned programming just 3 years ago, or that I actually get out of the bubble on occasion and talk to people who aren't techies, but I think I know what's going through the heads of students, and it's not always "ah, how trivial." Comparing variables in PHP to variables in Algebra just doesn't sound like it covers the whole story very well. It also assumes that all students are mathematically inclined, which just isn't true. Some people had a lot of trouble with Algebra in middle school, (and failed every derivative thereof in high school and college), and telling them that this new concept is similar to something mathematical isn't helping them much. It's kind of like how I could tell you that Verilog is kind of like C, but without any understanding of what C is, you won't know what I'm talking about. And even if you did know C, I could use that statement, but it still wouldn't be entirely true. The way I see it, you have to put yourself into the shoes of your students, and stop assuming the knowledge that you think they know. The best way to explain any concept, that is, the one that will work with the most people, is to explain them as if you are talking to a 6 year old… no assumed knowledge other than that your audience understands the words coming out of your mouth. When I taught the concept of variables to my students, I used something very similar to the way I was taught: I explained that a variable is like a bucket that holds whatever you put in it. When you say:

$var1 = "hi";

you are putting the string "hi" into this bucket. When you say:

print "$var1";

you are telling PHP to get the content of this bucket and put that on the page. I know it seems like a really basic and maybe even painful explanation to have to listen to, but I want all my students to understand this stuff well, even if it bores the techies in the room. After all, this whole idea of variables is kind of important.

On a side note, last section was the first section on the topic of PHP, and I made it very clear to my students that those without programming experience would find this stuff to be very difficult. I also explained that PHP is a terrible programming language. It is easy, and that's a good thing (when I write C, I miss PHP), but it's also part of the problem. I explained to them that one of the annoying things about PHP is that:

print "Hi $name";
print "Hi" . $name; 
print ("Hi $name"); 
print ("Hi" . $name); 
echo "Hi $name"; 
echo "Hi" . $name; 
echo ("Hi $name"); 
echo ("Hi" . $name);

… all do, basically, the same thing. This might not sound like a bad thing, but it is, because it means that programmers can do the same thing with very different code, and it's hard to tell what is wrong with a script when there are so many possible ways to write things. Even with all I know about PHP, I still have moments when I open a file written by someone else and I see things that are totally unfamiliar to me. It also means that it's easy to make mistakes, since you can confuse syntactical differences between two ways of doing the same thing (and end up with a script that does nothing at all). See what I mean?

But all things considered, I encouraged my students to study this PHP stuff intensely, because it's so much fun, and you can do so many cool things with it. Like start your own blog :)

Get a trackback link

1 Trackbacks/Pingbacks

  1. Pingback: PHP Performance: Echo & Print — Elliott C. Back on June 30, 2009

10 Comments

  1. Dean Strelau on October 19, 2006

    Even with all I know about PHP, I still have moments when I open a file written by someone else and I see things that are totally unfamiliar to me.

    Ever try to read Perl written by someone else (or heck, Perl written by you)? Yeah, you'll suddenly like PHP much more :)

  2. Christian Montoya on October 19, 2006

    LOL, I've heard bad things about Perl, and I've decided to just stay away from it indefinitely.

    I should have mentioned that I told my students we would follow the convention of using the print function with quotation marks around variables, just to stick to one way of doing things so they won't get confused. Conventions tend to make coding a lot easier.

  3. Elliott C. Back on October 19, 2006

    You're telling your kids to write print "$var"; to echo a variable? I'll hit you back with a test showing you why that's not such a great idea…

  4. Christian Montoya on October 19, 2006

    Elliot: Other than being slower than echo, it's not that bad. I know about these things. I can help them make the move to echo in a couple weeks or something.

  5. Andrew on October 19, 2006

    Small note, your last example:
    echo ("Hi" . $name");
    should probably be something more like:
    echo ("Hi" . "$name");
    or:
    echo ("Hi" . $name);

  6. Christian Montoya on October 19, 2006

    Thanks so much Andrew, I'm incredibly careless when I'm writing in a hurry.

  7. Johan on October 21, 2006

    It is very important to learn your students about malicious injections when your saved data is being sent back to the server.

    I also would talk about PEAR, a god given bundle.

  8. Christian Montoya on October 21, 2006

    Johan: I would love to talk about things like that, but you have to remember that at least half of these students have never touched programming before. They are still trying to make sense of includes and $_POST. Injections, etc. are covered in the second course on web programming.

  9. Elliott C. Back on October 21, 2006

    Either your hot comments template snarks trackbacks, or something else went wrong–check out my post on print v. echo

  10. Christian Montoya on October 21, 2006

    Elliot: It's nothing to do with my template, you should know that. Either it's taking a long time for the trackback to get through the tubes, or Akismet is trapping it. If it's not up by tomorrow, then something is definitely wrong.

    And thanks for that comparison, I'll definitely refer it to the other TA's and maybe the students.

Leave a comment

Use Markdown or basic HTML. For posting code, use Postable. Please keep comments respectful and on topic.