• Discussion
  • What were your biggest misconceptions when you first learned PHP?

I'm writing lessons for a Intro to Webdev course (LAMP stack) and I want to spend extra time making sure my students understand not just how to build what they want but why they're using specific methods. For that reason, I'm trying to cultivate the best understanding of the course material I can.

I'd like to know what particular understandings people struggled with while learning PHP, or web dev in general so I can try to make those things clear when I impart the knowledge.

    Not sure this is from when I "first learned" PHP, but something I've learned hard is Von Moltke's axiom.

    In particular, that just because something is doable doesn't mean it's practical to do it. This particularly applies to technologies of scale and manpower estimates in software development.

      Heh...I started learning in the late '90s, mostly by osmosis and trial-and-error, so my experiences probably have little meaning now. 🙂

      That being said, because of the nature of the beast, I think too many people jump into PHP without taking the time to learn basic programming concepts; ending up creating spaghetti-code sites that are impossible to maintain. Similarly, many PHP tutorials and such treat object-oriented PHP as a nice-to-know advanced topic, while these days any professional PHP developer must have a strong grip on the subject. Therefore, I think introductory PHP courses should tackle it early, along with learning to use functions and other tools to avoid 2000-line long, 7-level nested PHP files full of intertwined HTML. 😉

      I think one of the BIG things that I realize over and over all the time in myriad ways is that the boring details of implementation really matter. It's natural to whinge and moan when some gray-haired old person tells you that you have to learn what bits and bytes are and how integers are encoded versus floating point numbers and how strings are encoded differently than those and what character encodings are and what a stack is and so on etc, etc, etc.

      It's all well and good to get new programmers started quickly by thrilling them with a simple program, but when you must solve real-world problems, the hardest ones usually relate to some detail of how things are implemented. For example, the problem of "why do I see weird characters and question marks in my website?" is usually due to character encoding problems. You should have listened when the old gray hair explained the difference between LATIN-1 and UTF-8.

      Sadly, it has required long and torturous hours of confusion and failure to learn various lessons. As Ben Franklin said, "experience keeps a dear school, but fools will learn in no other."

        NogDog Nog makes a good point. Separation of HTML and PHP code requires extra effort, but it's totally worth it. I've been tortured by a site that intermingles the two for 15 years now. HTML has changed dramatically since it was built. Smartphones have appeared. Responsive design, etc. I'm about 3/4 done re-coding it.

          Write a Reply...