The problem, in my opinion, is that authors that write books (I've ranted about this before, so I'll keep it short) are often NOT expert programmers or writers or both.
If a programmer wants to teach you about looping, they have to come up with some sort of toy example that allows them to USE a loop. The beginning programmer is only supposed to come away with the knowledge of various loops, and how to use them.
Unfortunately, if the example itself doesn't really look like it lends (no pun intended) itself to the concept being taught, the whole thing just looks unwieldy and silly.
In the authors' defence, in regard to register_globals, NO ONE turned register_globals off in their code because PHP had it ON by default. It allowed a really slick and elegant approach to solving problems. A programmer only had to know if $logged_in was set, he didn't care where, because he was under the
assumption that it came from an appropriate source.
These kinds of assumptions led a lot of programmers to write really ambiguous and security-hole-prone applications.
As with any language, PHP is evolving, and it's understandably difficult for a new programmer just learning to learn the language as it existed when most PHP4 books were written when things are so different now.
But it's not impossible. The more you stick with your learning, the more you learn about the language in it's "faulty" stages, the more the fixes and changes will make sense to you. As an experienced PHP3 programmer, learning to write code with register_globals off was immediate, because the reasons behind the change were so clear and obvious (once I read them!).
So what's the point? I guess what I'm trying to get at is DON'T let your frustrations with the evolution of a language or it's "common practices" get in the way of your learning it. When a language evolves, EVERYONE (beginning to expert) is learning it at the same time. People with a head start pick up new concepts relatively quickly, but they have the DISadvantage of breaking old bad habits, whereas newer programmers are given the benefit of learning things the "right" way from the start.
Okay, rant over.
Take care,
Nik
http://www.bigaction.org/