9 Ways to learn to code with PHP

When we try to learn a programming language, there always is a annoying question floating around in our mind – “what should I do next?”. We try a few tutorials, skim through a book and we feel completely puzzled.

Everyone goes through this. The only way out is to keep believing that you can do this and just fight your way through this. It is possible, but to make this journey easier, I’ve put a list of ideas how you can learn to code with PHP.

  1. Do tutorials
    Here are couple very good ones to start with:
    1) http://devzone.zend.com/6/ – One of the best tutorials for complete PHP beginners that will show you all the basics
    2) http://net.tutsplus.com/tutorials/php/how-to-create-a-phpmysql-powered-forum-from-scratch/ – Create a PHP/MySQL powered forum from scratch with Tuts+
  2. Build simple things
    I wrote another blog post with 10+ PHP project ideas for beginners. Here are another 3 very simple ideas to build with PHP:
    1) Learn to insert data from PHP into MySQL: http://www.phpeasystep.com/mysql/5.html
    2) A contact form which would send you emails
    3) PHP calculator – add, divide, substract, multiply. Get creative with the user interface :)
  3. Read books
    You don’t need to read many books. One or two should be more than enough to start with. If you start with a book, it might be boring to follow since it’s hard to understand everything at first. However, when you read a book once you have some understanding of what programming is and how it works – it’s a lot more useful and fun. Here are 2 books you can start with:
    1) http://www.phptherightway.com/ PHP the right way is highly recommended ebook for PHP beginners
    2) http://www.techotopia.com/index.php/PHP_Essentials PHP essentials – ebook in a wiki style. Another highly recommended ebook for beginners.Here are over 500 free programming ebooks to continue with.
  4. Do a few courses
    Some courses are better than others and although some of them claim to be “the only thing you will need to learn [x]” that’s never the truth. You will still need to do all the things (or most of them) I mention in this list.
     Codecademy is great way to consolidate your new knowledge and understand it a little bit better
  5. Rewrite apps built by others
    Take other people programs and rewrite them piece by piece, trying to analyse and understand how and why this code works. It will be difficult at first, but after a few little projects you’ll get very good at reading code, noticing patters and seeing how things fit together. Reading good code not only will teach you things you wouldn’t have otherwise learnt, it will also develop your ability to notice potential bugs in your own code.
  6. Break other people’s code
    When you don’t feel like rewriting other people code, you can pick a program and try to break it. Delete a function and see what happens, change the variable name and watch what kind of error you will get. Add new functions and utilize the existing code in ways no one expects you to.
  7. Improve and change apps built by others
    Take a simple app and add your sizzle. Make it do custom things. You can start with very simple modifications and work your way up to chaning most of the functionality.You can find some free PHP apps here:
  8. Start small and push gradually
    It’s very important to start with small goals and push yourself a little. These tiny pushes will add up to serious increments over time, but you won’t notice it.
  9. Commit to long-term.
    Learning to code is a life-long challenge. It’s not something you can do it 3 weeks. The truth is – programmers never stop learning. There’s always something new to discover, something new to create and learn. That’s the exciting part of coding – it’s never the same. In 5 years most of the programming landscape will be totally different. If you don’t constantly learn – you become a dinosaur. No one wants to work with dinosaurs.

Bonus tip: Teach someone else. Teach your girlfriend to create her personal website. Show your best friend how to make a simple PHP app. When we teach other people, we tend to learn and understand the stuff in much deeper way.

Bonus tip 2: Don’t get stuck with PHP. There are other languages out there. Try out Python, go through a Computer Science course, give Ruby a go. Keep an open mind to other solutions and languages – it will make you a better programmer.

Did you like the article? Let me know in the comments!