What's happening in our world

Home / Blog / Label: beginners
Label: beginners

Friday 17th January 2014 PHP Book Review: The Joy of PHP by Alan Forbes

A while ago, we did a quick overview of a few books that every PHP developer should keep a copy of somewhere in their library, but since buying books can get quite expensive after a while, we thought it would be best if we zoomed in a little bit closer and started looking more in-depth at some of the best PHP titles. This post, we're going to look at one of the more beginner level books that's a great help for those of you who are just starting out on the journey to become a proper PHP developer,  The Joy of PHP: A Beginner's Guide to Programming Interactive Web Applications with PHP and MySQL by Alan Forbes.
 
First of all, it's important to realise from the beginning that this isn't just another PHP reference book intended to act as the be-all and end-all of PHP development. It's targeted directly at the PHP novice, although it helps a great deal if you've already got some basic web programming experience - he covers the basics of HTML, but that's not the focus of the book. If you're already comfortable coding the front-end side of websites, this is the perfect book to help you get a taste of the basics of back-end coding so you can expand your skillset.
 
It takes you from the very initial setup of PHP and xAMPP on your home development environment, through basic PHP syntax and then starts giving you basic tasks that help you work towards making these initially abstract examples more concrete and relevant. The example he uses throughout the book isn't particularly exciting (a used car sales website), but it definitely  does the job, and Forbes' engaging writing style also helps to keep things moving along. The focus tends to be more on working with databases specifically, but as most beginner-to-intermediate PHP developers are going to be focused on database-driven projects, this shouldn't be much of a problem.
 
There is a little bit of criticism in the developer community about the way that he handles his code examples in the book - the ever-present threat of SQL injection attacks is something that no developer can afford to ignore in this day and age. That being said, the author isn't attempting to turn the reader into a PHP master, the goal is simply to get people comfortable with the basics. Anyone who takes this knowledge out in the world and creates websites for clients is going to be in for a nasty surprise, as this book should just be used as a jumping off point - but it does that job very well, and provides a great introduction to PHP and MySQL - just be sure to read up on security vulnerabilities, and then take on a few more advanced books!

Posted on January 17th 2014 at 03:55am
0 Comments

Wednesday 20th November 2013 Top Tips for PHP Beginners

Learning a new programming language can be a huge undertaking, and learning PHP is no exception. Not only do you have to learn the actual syntax and structure, but there are a number of different subtleties unique to any language, and PHP has its fair share. There are some best practices that you should get in the habit of applying to your work, so you don't have to come back later and break yourself of any bad habits. This is by no means a complete list, but it's a good starting point for PHP beginners.
 
First and foremost, use the latest version of PHP. This might seem like a no-brainer to everyone, but it's surprising how many people are still using outdated versions of PHP. Just make sure that you check with your hosting provider that they're willing to support the version you use. While all hosts should be supporting PHP 5 by now, they may not be supporting the latest subversion (5.5 at the time of writing)
 
Next, familiarise yourself with the PHP manual. Another one that might seem like a no-brainer, but most programmers learn from a 'Teach Yourself' guide or similar online tutorial system, and some have never touched the PHP manual in their lives. Give it a shot, and you're almost guaranteed to learn something that was left out of your quick-start guide.
 
If you haven't already switched to one, try out an integrated development environment, or IDE for short. We recently posted about some of the most popular IDEs, but it's important to find one that feels comfortable to you, so test out some of the available options to find your personal favourite. The simplest improvements over a basic text editor can make you wonder how you ever coded without an IDE.
 
To save yourself a bunch of headaches while you're learning (and after), make sure you have enabled error reporting. It will save you a huge amount of time trying to sort through code that you're not really familiar with, and you'll be instantly thankful for it. Just make sure that you remember to turn it off before you launch, or your benign users will be confused and any malicious users may have a route into your system.
 
Finally, make sure you get into the habit of writing your PHP code as cleanly as possible from the beginning. Use naming conventions for your variables that actually mean something, because by the time you're finished your project you'll have lost track of the obscure names you gave to your incremental loops. Indent your code and use plenty of whitespace, which will make sorting through things infinitely simpler and faster, and will make it easier for other programmers to help you out if it turns out you need it.
 

Posted on November 20th 2013 at 07:53pm
0 Comments

Labels

Try our free php source code demo
TRY SOURCEGUARDIAN FREE FOR 14 DAYS
Account Login:

login Forgotten Password?
Connect with us
Bookmark
facebook linkedin twitter rss
© Copyright 2002 - 2024 SourceGuardian Limited
Privacy Policy l Terms & Conditions l Company Info l Contact us l Sitemap l PHP Weekly News