How to not get lost

I’m a newbie attempting to learn PHP. I’m learning the very basics at this point (syntax, variables, operators, control structures, etc.). I’m a fast learner, and am trying to stay focused on the basics, but I’m finding that I’m getting distracted by researching various PHP related topics such as:

  1. My development environment. I work on a Windows 10 machine running VMWare Desktop (running two VMs (Ubuntu 16.04 and another Windows 10). Running WAMP. Just read up on VirtualBox, Vagrant, and HI. Seems I should be moving in that direction. Distraction from learning to code.

  2. OOP. I’m researching OOP but it seems premature. At what point do I begin considering different paradigms? Distraction from learning to code (though will need to be considered in the future).

  3. Learning HTML / CSS (somewhat experienced in the use of both already), MySQL, and SQL. I know they will all work together, but which do I prioritize? Distraction from learning to code.

  4. Concern that I’m spending time with tutorials that will teach me legacy code and techniques. Distraction from learning to code (though this seems like a valid concern).

So I’m looking for guidance from experienced web developers on what I should ignore for now and what I really should be considering in addition to learning the core of PHP. Much appreciated.

1 Like

Hi nscherneck welcome to the forum

My first localhost way back was XAMPP and plain old notepad.

You have choices when using such a simple text editor.
You can copy-paste – not much work, but you don’t always learn as well
You can write every line from scratch – a lot of work but you learn the hard way fast
And of course anywhere in between the extremes.

You already have your test environment(s) - Good enough for now. You’ll know when the time to move on is.

As long as you can write code using Objects you won’t be stuck with only procedural. Nothing says you need to write class files just yet.

Old tutorials? As long as you don’t expect everything to go smoothly, a lot can be gained by studying the code enough to figure out where and why it is broken.

What I suggest? Fire up the text editor and start writing code.
Put the file into the localhost server and check in a browser or three.
Tweak in “improvements” until it breaks, figure out what happened. …

Oh, and save back-up copies unless you want to lose the “good” file.

The different paradigms are the biggest difference between languages. It is relatively trivial to learn the second and subsequent language that uses a given paradigm - it is learning the first where effectively you are almost back at the beginning of learning to code. I first learnt OOP using C++ as the fourth paradigm (or was it the fifth) and it took as long to learn that as it did to learn the prior ten or so languages using paradigms I already knew.

Hey @nscherneck, welcome to the forums!

  1. I agree with @Mittineague - you already have a development environment set up, so this will serve to get you going at the outset. Do ensure that your version of WAMP is running an up-to-date version of PHP though (currently PHP7). SitePoint has a good article on using Vagrant for PHP and the advantages of doing so, which is worth a read.

  2. For the small programs that you’re likely to create as you start learning, OOP is overkill. Once you’ve learned the basics that you mention above, you’ll come onto functions. As your programs start to grow in complexity, functions will allow you do break up your code into small, easily understandable, and composable pieces. I think this then leads nicely into learning OOP, as you’ll have already started to think about creating abstractions and more modular code. OOP takes those concepts a step further.

  3. I’d go for SQL. MySQL uses SQL, but includes proprietary functions/extensions to the SQL language. Having a good general knowledge of SQL will allow you to communicate with all the popular relational DBs (MySQL, PostgreSQL etc).

  4. That’s definitely a very valid concern, as there are a lot of outdated (or just plain wrong) tutorials out there. I’d recommend bookmarking http://www.phptherightway.com/, as this is a great reference that covers a lot of best practices with PHP development. It has links to tutorials and more in-depth resources for each topic.

Well to be fair that was before vagrant existed. The only option we had was xamp or manual install. Manual install on windows was next to impossible.

Its really not all that difficult to set-up a vm thanks to great tools like puphpet. At home I run a surface pro 3 with Windows 10 and have several vms built that way. People make it a bigger deal than it really is or are just to stuck in their old ways. If for no other reason puphpet is better than xamp because installing extensions is a breeze. Installing extensions on xamp can be a nightmare. Not to mention the Linux LAMP knowledge base is much larger than the XAMP one. Local environment set-up problems are much easier solved in a Linux environment than a Windows or Xamp one. There is just much more information available for provisioning Linux machines for dev environments other than .NET than there is for Windows. Lastly eventually you’re going to need to know some light sys admin stuff. Xamp teaches nothing about that. Using vms will provide a means of dipping your toes in the pool of some light sys admin/devops stuff.Things that are very critical if you ever want to become a senior or lead developer. Especially in this age of cloud technologies.

1 Like

Or you could create a multi-boot HD. It’s basically exactly like having a VM, but with much faster speed. Having an OS ontop of an OS will lag you like crazy. Try installing a Linux on a VM only to have it lag on you to the point where your host OS lags with it. Not a fun day in the park. Just happened earlier. While I was talking with @Mittineague, I was telling him how I was using a VM and had Yosemite installed, it lagged to the point where I couldn’t even login. And no. As I have said more than 1 time that the lag has nothing to do with shared documents or shared users. That option is unchecked and it isn’t using shared whatever.

With using multi-boot, you can always trash it if you don’t like it. You are basically just creating partitions to use. Just like using a VM. Only that VMs lag because it’s an OS ontop of an OS. With multi-booting, it’s an OS by itself.

And if you are worried about viruses then you are already screwed because viruses can jump from network to network regardless if it’s a VM or not. Say you have an infected VM, where is that VM stored? It has to be stored somewhere and that somewhere is on the host machine. Which means that the host machine is already infected because of the VM.

Let’s get down to business here. If you are talking about a “one button click” solution, wouldn’t Vagrant fall into that category as you once so elegantly said “you can add a line to the configuration file and then run it in the command line”, isn’t that the same thing as a “one button click” solution?

I think if you truly want to learn how to install PHP, you best do it manually because in fact, you do learn terminal commands. You don’t know because puphpnet lets you pick and choose with adding packages via one click on their website. And then you just run a vagrant command and you have your PHP environment. If you manually install LAMP, you learn that not everything comes from a “one button click” solution. If you screw up installing PHP, then you will have to figure out what you screwed up on.

Example, months back, someone installed PHP wrong and had raw PHP data displayed on screen instead of having it being executed. That’s because the person installed PHP wrong. With using puphpnet installs, you won’t get that problem, BUT, you also won’t learn and know that issue and know how to debug it. It is best to learn in full length what could happen when PHP bricks when you install it wrong.

I have no problem with how people want to install their PHP environment, but when someone constantly annoys other members and have nothing nice to say, I’ll step up and describe my experience with said topic.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.