Hi, David. This is an interesting approach, but I think it’s a solution to a slightly different problem than teaching someone PHP. Instead, it’s a solution to teaching someone the basics of building a web app and you just happen to use PHP to teach those concepts. A perfectly worthwhile and desirable goal, but different.

David Sklar

I agree and disagree with some of the points Sklar (sorry, two David's makes this confusing) goes on to make. If I may paraphrase, Sklar is raising a point which competes with that raised by Ben in our initial discussion. My initial suggestion in the discussion with Ben indicated that books should start by teaching PHP on the command-line and slowly build up to constructing a very lightweight MVC framework and example application. One of Ben's chief, and valid, concerns equated selling books about PHP with convincing readers or page-flippers that the book would teach them to build web pages in the first few chapters. Or that individuals might be turned off if they weren't creating XSS attacks willy-nilly by chapter 3. I think the counter to this that Sklar raised is that by hiding the framework you turn off the people who don't feel they're really getting their feet wet with PHP. They feel that by using your framework they aren't learning the 'real guts' of the language.

This clearly relates directly to some of the arguments Sklar makes that other languages face this challenge as well, but PHP perhaps more so than others. PHP digs its own hole here because unlike a .NET, Java, or a ColdFusion, PHP has built its name on easy to learn and get going. You can pay $4.99/month and get a server running PHP in 10 minutes. Writing an application in any of these other platforms can take orders of magnitude longer to setup, there's an expectation of barrier to entry for learning, and often you have to buy pieces of it like an IDE. Sklar indicates that it's important to strike the balance between "a way to do things" and "the way to do things".

The dilemma lies in choosing whether I ask the reader to take on faith that the framework underlying the first half of the book isn't worth delving into right now, but is worth understanding later and either using the quick framework or garner enough knowledge of the principles to build your own. Or, do I go back to my original plan of introducing PHP on the command-line as we built up a small framework and graduate up to a web page far later in the book.

I have full confidence that either approach might work. I know universities teach Physics both with and without calculus to which I'm sure the physics professors initially said "you can't teach physics without calculus, it's heresy!" But, this day in age there's only one physics. I know my economics professor told me she didn't like math, but she managed to teach a great class about economics concepts by moving lines back and forth on graphs.

[tags]learning php, programming, computer science, php, php books[/tags]