A professional coder requires professional tools, sure you can write PHP with a regular text editor, but a specialised editor will surely make the job much easier and in-turn the code you write will certainly be more accurate. In this article, Techeadz will take you on a tour of the most popular all-purpose and PHP-specific editors out there.
You will learn what features are required from any code editor worth its salt; you’ll explore options for boosting your productivity, like snippets and integration of database. After that we will take a look at some tools that work with multiple technologies (Aptana Studio, Sublime Text, and Cloud 9) plus those more directly targeting PHP (PhpStorm or Eclipse). This series of articles is designed to be essential to anyone treading the path to PHP programming, not forgetting developers seeking to increase their efficiency and productivity.
What are the essentials for any PHP editor?
The basic laws of any craft, is to choose the correct application for the job in hand, to do that, you need to know the requirements for the job. In this article, we shall take a look at the core requirements for PHP coding. Essentially, a PHP Editor is just a plain text editor that can read and write PHP-compatible files, and what makes a plain text file compatible is the extension, which, depending on the version you’re working with, could be anything from the generic .php to .php3, 4, 5, even .phps.
Beyond this everything is a bonus. So, what else is vital for any PHP Editor? One of the top requirements is some sort of specific syntax handling, one that provides colour and formatting.
Now this is a multi-purpose feature. It differentiates between PHP code blocks and other surrounding code in an HTML/PHP hybrid page, as well as highlighting properties, methods, and functions. Not only do you want to be able to identify the key code elements at a glance, but you also want some help in coding them. PHP is a strong, complex language, developed more than 20 years ago, over time, it’s been updated and is currently on its 5th version.
With more than 700 core PHP functions and almost 40 operators, and numerous logic constructs, like if/then, while, and for loops. That’s a lot of functionality to keep track of. Code hinting is one way that can help you keep all of this PHP straight. A good code hinting system looks at what you’re typing and quickly offers a list of suggestions that narrows with each key pressed.
Code hints are often displayed in a popup list, next to the current cursor placement, and the list is easily navigable by arrow keys. Select a function and the hinting continues with a display of the function’s syntax and any attribute availability. Once you’ve written your PHP code, it’s very useful to be able to verify your mistakes or typos and other syntax errors that could have found their way in. Syntax checking is a must have as a baseline debugging effort that verifies your code ability to be parsed.
Checking syntax is essential for making sure your braces and parentheses balance and for seeking out any duplicated commands, like “echo echo” or a missing semicolon that closes a PHP line.
This is part of a series of articles relating to PHP editors, and in the next, we will look at PHP Editor developments for improving your productivity and efficiency by uncovering productivity boosters.