Archives For Learning PHP

Sections covered in this article: Basic database applications.

In each CoreDogs Experience article, my goal is twofold: (1) to look in-depth at a single feature of the site or its content (this will likely be analysis or commentary of a CoreDogs feature that is present in multiple places as opposed to a single section) and (2) to take a look at what went on in a given section of the course.

CoreDogs Feature: Organization

So far we’ve taken a look at several of CoreDogs’ differentiating features.  Now, let’s take a look at the way the site is organized.  There are three “books” of instruction; Foundations, ClientCore, and ServerCore.  Within each of these books are 5-10 lessons.  Each lesson contains a number of “sub-lessons” or explanations.  There is a definite and obvious hierarchal structure to the entire site.

Another element of organization that I really like is the Wikipedia-style table of contents at the beginning of each sub-lesson.  Here is the table of contents for the Creating a database lesson:

[image here]

Each item on the table of contents is clickable and takes the user to a hash tagged location on the page.  I love seeing this simplistic table of contents at the beginning of each sub-lesson because it lets me know (along with the “Where are we?” and “Lesson Goals” sections) what exactly I’m in for and how much content there is.  Additionally it gives me an instant picture in my mind of the shape of the lesson.  By “shape of the lesson” I mean something like the story arc of a book or movie.  It’s a sort of Cliff Notes to what I’m going to be learning.

Course Content So Far

The Basic database applications section focuses on creating an application (in the form of a website) that displays information (from a database) for users.  Furthermore, the application allows administrators to add, edit, or delete records in the database.  As noted in a previous article I found the sections regarding forms to be tough and a little hazy in instruction, but this database section was a home run.

The way that this section teaches the concepts should be imitated as much as possible in today’s textbooks.  The first three sub-lessons (of 17 total) focus on providing the goals of and necessary background information for creating a basic database application.  Then, two separate Sample applications are introduced; a website called DogToys (that stores products in its database) and a website called DogRock (which stores articles about dog rock music).  As new concepts are introduced throughout the section, it is explained how the concept would be implemented on each site.

Furthermore, the student is instructed to build a third sample throughout the section; a website that stores jokes in its database.  So for each concept that is taught, the student not only sees it implemented in two different samples, but then is charged with implementing it themselves in their own, slightly different sample.  When done this way, CoreDogs does not teach the student how to replicate an action; it actually causes them to be able to apply what is learned in a real world situation.  If one is able to create a basic database application revolving around jokes, why wouldn’t they be able to create one revolving around books?

On top of these praises, I have to add that creating the database was fun.  I actually enjoyed myself as I worked through each sub-lesson, crafting my application to make it better, bit by bit.  The way that the entire Basic database applications section is broken up is masterful; at no point did I feel bogged down or confused.  This is what the Form lessons should ideally be like as well.

There are a few ways that this section of the ServerCore book could be even better.  First of all, when MySQL injection attacks are discussed, it may be helpful to provide a little further explanation as to what the “escape_string” method actually does to the data.  I also found myself wondering if phpMyAdmin is only for use in PHP applications, or can be used otherwise as well.

Finally, the exercises page could use some help.  It seems that there are three large projects offered here, but each one is broken into three smaller exercises.  I understand that this helps break down the work, but it can also be disorienting to fish through nine different exercise wondering “Which one should I do?”.  Simply dividing up each group of exercises would probably do the trick.

All in all, this was an excellent section of CoreDogs.  The “learning” itself was at the seemingly perfect steepness so that this student was never frustrated and actually enjoyed creating the application.  Seriously, all textbook should try teaching their concepts in this fashion; it could change the way that we learn.

Section covered in this article: Web site templates.

In each CoreDogs Experience article, my goal is twofold: (1) to look in-depth at a single feature of the site or its content (this will likely be analysis or commentary a CoreDogs feature that is present in multiple places as opposed to a single section) and (2) to take a look at what went on in a given section of the course.

CoreDogs Feature: The Dogs

Another recurring theme within CoreDogs is the presence of some dog characters.  Some of the commonly appearing ones are named “CC”, “Renata”, and “Kieran”.  They are employed as characters who contribute a sort of Socratic debate method that aim to answer common questions.  For example, after a given amount of explanatory/instructional content either CC or Renata will make a comment like “Hey wait a minute, this seems awfully complex.  Is it worth the effort?”, and then the Kieran character will affirm their question by saying something like “Good point.  Let’s talk about that a bit”.  After this hypothetical dialogue, the course then gives a detailed answer to the dog’s questions.  The screen shot to right is placed near the end of Web site templates section.  The conversation that follows is very helpful in making an argument for the added productivity that the seemingly complex PHP dynamic web template creates.  It serves as a great summation of the usefulness that should be grasped from this section.

This method aims to answer questions that students would commonly ask at a given point in the lesson.  I love this.  (I was immediately reminded of the way the Apostle Paul lists hypothetical questions and then answers them for readers of his letter to the Romans)  As a student, thinking that I could read detailed explanations to my questions would greatly decrease any worry that I might have about taking an online course.  In my opinion, it would be great to see this used in all of the text books that I’m required to use at school.

 

Course Content So Far

The Web site Templates section focuses on the PHP require command as well as variables to create a dynamic template for a website.  The advantages of this sort of template come from being able to edit the header or footer of a website in one spot, and have the changes be immediate on every page of the site.  You could almost call this sort of template a content management system.

This section felt quite a bit longer and more exercise laden than the previous sections, but this is understandable because it is introducing the actual use of PHP for the first time in the ServerCore book.  To get the student familiar with PHP, a combination of near-transfer and far-transfer exercises are used.  While I was going through these exercises, one question kept popping up in my mind:

Earlier in the ServerCore book, I was instructed to set up a development server on my PC using XAMMP.  This was very easy to set up and has worked seamlessly so far.  BUT, after completing each exercise, the user is instructed to submit the URL of the completed exercise.  This is so the instructor can check my work and make comments on it if necessary.  The problem is that if I submit the “localhost” URL from XAMMP, the instructor won’t be able to access my work.  This shouldn’t surprise anyone, but I think it should be clarified that to submit an exercise, it needs to be first uploaded to an actual web server.[1]  In fact, differentiating between the student’s Development and Production server could be useful in that it will familiarize students with this real-world concept that may be used in the workplace.  A comment at the end of an exercise like “Upload the completed exercise to your production server and submit the URL” should be enough once this concept is explained.

Another minor snafu related to the use of XAMMP was that in the Show IP Addresses exercise, IP addresses were displayed as “::1”.  This was mentioned by another student in the discussion section of the exercise (which proved helpful in this case).  If the use of XAMMP is encouraged throughout ServerCore, it may help to mention this in the main body of the content as well.

One more XAMMP related remark was that in the Web server time exercise, the time was displayed was not the same time as my PC’s clock.  This doesn’t bother me much, but I can imagine some students getting frustrated by this (thinking they did something wrong).

The quality of the instructional content is still top-notch, as mentioned in my previous article.  Though, something to be careful about is the use of the HTML <code> tag when referring to file names that are in examples or diagrams.  In the image below (taken from the Complete template system page) I thought there was a CSS file named “library.dogsite.css” being referred to.  This is a tiny quibble but may be worth keeping an eye on.

 

All in all, this section was rewarding especially because I’m already able to use PHP to create a sort of dynamic web site template.  Many of the images and diagrams work very well and are great at visualizing what is being explained.  I particularly liked this color-coded one.  See the table below for a summary of my thoughts on this section.

 

What I Liked

Needs Improvement

  • “The Dogs” and their discussions can be very helpful.  I wished more text books used this!
  • Being able to actually use PHP in under an hour was encouraging.
  • Images and diagrams are well done and do an excellent job at further explaining the instructional content.
  • Results of the Show IP Addresses exercise were a little peculiar due to the use of XAMMP.
  • Results of the Web server time exercise were also peculiar.
  • Using “x.html” as an example file name could be mistaken for XHTML, the markup language.
  • Spots where <code> tags are used for file names could be potentially confusing.

 



[1] Admittedly, this is mentioned in the instructions for the Web server time exercise, but I think it could be more helpful if it was implemented throughout the ServerCore book.

Sections covered in this article: Why learn PHP with CoreDogs? and The PHP Ecosystem.

In each CoreDogs Experience article, my goal is twofold: (1) to look in-depth at a single feature of the site or its content (this will likely be analysis or commentary a CoreDogs feature that is present in multiple places as opposed to a single section) and (2) to take a look at what went on in a given section of the course.

CoreDogs Feature: Writing Style

The first thing that jumped out at me was the style and methods of writing that are employed on CoreDogs.  The writing style is clean, factual, and minimal.  Never wordy, every sentence is very clear in the point that it wants to make.  Take for example the two opening paragraphs of the ServerCore book:

ServerCore helps you write programs that run on Web servers. As explained in Foundations, that’s where much of the business value of the Web is. It’s not surprising that companies want to hire people with server-side skills. Even humans, as well as us dogs.

ServerCore covers the programming language PHP. Other languages are used on the server-side, like PERL, Ruby, Java, and C#. The first chapter explains why PHP was chosen. The second chapter is short, talking about how PHP works, and (free!) tools for writing PHP.

Paragraphs often begin with a simple statement like: Continue Reading…