avatarJ.A. Becker

Summary

The article discusses the challenges of learning PHP, despite its reputation for being easy, and provides guidance on overcoming these obstacles.

Abstract

The article "Why Can’t I learn PHP?" addresses the common misconception that PHP is an easily learnable programming language. It outlines five significant challenges faced by learners: the complexity of PHP code that intermingles with HTML and JavaScript, the misleading ease of learning PHP propagated by developers, the difficulty in setting up a PHP development environment, the inadequacy of the official PHP documentation, and the overwhelming number of starting points for beginners. The author emphasizes that learning PHP is not straightforward and requires navigating through a maze of setup issues, poor documentation, and mixed-language code. To assist learners, the article suggests resources and strategies for tackling each challenge, such as learning the basics of HTML and JavaScript, using a professional IDE like PhpStorm, relying on community knowledge on Stackoverflow, and following a structured tutorial.

Opinions

  • The author believes that PHP's ease of learning is often exaggerated, leading to frustration for newcomers.
  • It is implied that the intertwining of PHP with HTML and JavaScript can be daunting for beginners, akin to learning multiple languages simultaneously.
  • The article suggests that developers may intentionally downplay the difficulty of PHP to deter competition or to boast about their own skills.
  • The official PHP documentation is criticized for being community-driven and not user-friendly, often leading learners astray.
  • The author recommends avoiding the official documentation in favor of community resources like Stackoverflow and specific books for more reliable guidance.
  • The overwhelming number of learning resources available is seen as a hindrance rather than a help, making it difficult for beginners to choose a starting point.
  • The author endorses PhpStorm as an IDE that simplifies the setup process and provides valuable documentation and support for PHP learners.

Why Can’t I learn PHP?

5 Reasons it’s so damned hard.

Photo by KOBU Agency on Unsplash

PHP is known for being the easiest programming language in the world to learn. All it takes is a tutorial or two and you’ll be coding your way into a pile of cash in less than a week. 💥 💰 💰

…and many a man and woman has walked down that pyrite path and stepped off a cliff and shattered their bodies on the hard rocks of reality. ☠️

Don’t believe the lies (liar #1, liar #2, liar #3, liar #4), it’s hard as hell to learn this language. Trust me, I know. I was a web developer for many years and getting started with PHP nearly broke me.

But it’s worth it. Despite whatever anybody says about it being a dying language, it’s still powering more than 75% of the world’s websites, like Facebook, Yahoo, Wikipedia, WordPress, Drupal, and so on. And it will continue to power these sites well into the future.

So learning it isn’t a waste of time. But don’t kid yourself, it is an uphill battle.

Here are five of the most challenging stumbling blocks to learn PHP and how to overcome them.

1. F*cking Spaghetti Mess Code— Three Technologies In One

Valid PHP code can contain HTML, JavaScript, and PHP.

<?php
$myVar = 'Hello World'; 
echo"<div class='myclass'>".$myVar."</div>";
print('<div onclick=\'alert(\'jejejeje\');return false\'>Your name is <span>' . $yourname . '</span></div>');
?>
<p>
<h1>Hello</h1>
<b>The end of PHP is nigh!</b>
</p>
<?php
echo "No it's not!";
?>

It’s daunting as hell to start learning a programming language when you’re faced with something like that 👆 piece of nastiness. It’s kind of like wanting to learn Spanish, but then having to learn German and French at the same time too.

How to Overcome

There is nothing you can do to short-cut this challenge. To know PHP, is to know HTML and JavaScript. They are tightly bound together, forever and ever, amen.

So just accept it and lean into it. You don’t need to learn the entire depths of HTML and JavaScript. Just learn enough to recognize their syntax so you can mentally parse it out from the PHP code. To do that, you’ll have to read up a little on JavaScript and HTML:

2. All The Lies Beguile You

Image by Christel SAGNIEZ from Pixabay

One of the greatest challenges to learn PHP, is the web of lies surrounding it.

When you start, you’ll believe all the B.S. about how easy it is to learn and how quickly you can make money. And then when it doesn’t come to you immediately, you’ll Google stuff like, “Why Can’t I learn PHP?” and you’ll be met by things like this: https://www.quora.com/Why-cant-I-learn-PHP (TL;DR -> The problem is you, you’re either not trying hard enough or you don’t have the right ‘aptitude’.)

And you’ll be crushed. You’ll think everybody is smarter than you, cause it took them a week and you’re four months in and nowhere. And you’ll likely quit because it will all seem so impossible.

How to Overcome

You need to know that the entire world is trying to trick you. Developers want you to think it’s easy because they are setting you up for the big fall. It’s like, “Don’t Worry General Custer, there aren’t any Indians in the hills,” says the Native American Scout who’s working for the other side.

Why would developers lie to me? You ask?

Reason Number 1, is because we love to brag about how smart we are and how quickly PHP came to us. Makes us feel awesome. Reason Number 2, is because we don’t want the competition. We don’t need you out there working your hardest, making us work our hardest. So it’s better we destroy you by breaking your confidence. It’s a pretty good trick, honestly. It’s been working for years.

So beat this trap by knowing that PHP’s simplicity is a lie. Arm yourself with this shining truth and be prepared for long, hard work and keep your confidence intact.

3. The First Step is a Doozy — Setting it All Up

PHP is an absolute nightmare to set up on your computer. You have to install an entire universe of software just to say Hello World!

Nothing is more frustrating and daunting than trying to get started and being met by a thousand obfuscating error messages:

Confusion!
WTF??!?

How to Overcome

You need an IDE. Don’t bother with any of the Cloud IDEs (Cloud9, CloudCode, etc.) Most have been bought up by the big boys (Google, Amazon, and so on) and now they make you jump through a million confusing hoops to get started.

I highly recommend, PhpStorm by JetBrains (I am NOT paid to recommend them). It costs about $19 a month, takes seconds to install and can very quickly get you up and running. It also has huge amounts of well-written documentation: Get Started, Debugging, Creating a new project from scratch. Seriously, time is money and it’s worth the 19$ bucks a month!

4. The Official Documentation Sucks

The official documentation is community-driven, not professionally driven. So it’s hit and miss. Mostly miss, honestly.

Image by Markus Winkler from Pixabay

They don’t dive down into the details you need. Their UX is a massive challenge to navigate. The content is written by coders, not actual writers, so they don’t break the concepts into consumable chunks of information. And so forth and so on the litany of their problems go. Hmmm…confusing, they are <(-_-)>

How to Overcome

It’s best to avoid the official documentation completely. They sent me down many a rabbit hole before I learned to avoid them.

For PHP development, Stackoverflow is your new best friend. It’s where all the big boys learn to code and where you should be too. There is a massive amount of information on PHP there and actual functioning code to steal…I mean, functioning code to learn from.

Also, this book is fantastic for newbies: PHP for Absolute Beginners (I am NOT paid to recommend this.) This helped me get started, and will likely help you get started too.

5. Too many places to start— Where’s the best one?

Image by Gerd Altmann from Pixabay

The number of places to begin is overwhelming.

There are heaps of tutorials, books, videos, classes, blogs, audios, and now even this article.

Where does one start their PHP journey? Should I pay for an online class? Buy a book? Just pick a free tutorial on the internet? What’s my first damned step! Will somebody please tell me!

How to Overcome

Best place to start is to start here:

This video is recent, covers all the basics, and he uses my favorite IDE: PhpStorm. You can easily follow it, pause it whenever you want a break, and best of all it’s 🆓🆓🆓🆓🆓🆓

Final Thoughts

The hardest part about learning any programming language isn’t the language itself, it’s all the stupid little stumbling blocks that stop you from starting.

Remember that everybody learns at their own pace and nothing is wrong with what. For me, it took more than a year to get to the point where I could code something of value. And that’s a year of working day in and day out, plus weekends. I’m sure your journey will be shorter.

And keep this in mind too: the hardest part of any journey are the first steps. Once you surmount those, the going gets easier and easier.

Good luck, good learning, and good programming.

☘️️️☘️️️☘️️️

PHP
Programming
Learning To Code
Software Development
Technology
Recommended from ReadMedium