[nycphp-talk] if you were teaching PHP...
jlacey at att.net
Mon Jan 17 21:00:02 EST 2005
David Mintz wrote:
> I wonder if any of y'all care to opine about this:
> If you were teaching an introductory PHP course (no previous programming
> experience required) and you intended to cover some MySQL, would you teach
> the "classic" procedural mysql_xxxx API, mysqli, PEAR::DB, or some
> combination of the above?
> I taught this class last semester and spent some time on mysql_xxx,
> followed by PEAR::DB, but next time around I am tempted to require my
> victims to run MySQL 4.1 and learn about mysqli.
Since abstraction is "hiding" the classic procedural, meaning you have
to ultimately talk to MySQL, or any database, with what it understands,
I'd teach them both. First, the classic, then the abstract (PEAR).
Given the amount of time, I would cover PEAR::DB over against ADODB for
the simple fact that there is a lot more happenin' in PEAR and they
should be exposed to what it offers--besides DB abstraction. Of course,
it wouldn't hurt to provide an example of ADODB where they don't have to
actually code and run it.
As to learning the syntax of basic SQL statements, I'd spend some time
entering basic SQL commands using the MySQL command line client (demo
the MySQL GUI too!) before coding it in PHP.
That said, I would also make sure they learn mysqli. If that sounds
like a lot, it is. I'm sure anyone who has taught (and learned!)
programming appreciates the time that can be saved by providing
partially coded examples (for a worksession) where they only have to
complete a small percentage of the code. After all, it's not a data
entry or typing class. You can provide complete examples as a part of
the course documentation. They need to walk away with a good
representation of what they are actually going to run into "out there".
It pretty much boils down to how much time they have for *doing*. I'd
rather cover 70% of "the material" and have them feel comfortable with
90-95% of it rather than trying for "100%" of the material and have them
feel comfortable with 65-70%. It's about building confidence as well as
skills. At the end of a class, I want them to say: "Wow, I really
learned a lot!" and *not* "The instructor was really knowledgable".
my $0.02 for what it's worth,
More information about the talk