Using a Program Editor

Although a plain-text editor works for editing HTML, PHP, and JavaScript, there have been some tremendous improvements in dedicated program editors, which now incorporate very handy features such as colored syntax highlighting. Today’s program editors are smart and can show you where you have syntax errors before you even run a program. Once you’ve used a modern editor, you’ll wonder how you ever managed without one.

There are a number of good programs available, but I have settled on Editra, because it’s free and available Mac, Windows, and Linux/Unix. You can download a copy by visiting http://editra.org and selecting the Download link toward the top left of the page, where you can also find the documentation for it.

As you can see from Figure 2-20, Editra highlights the syntax appropriately to help clarify what’s going on. What’s more, you can place the cursor next to brackets or braces and Editra will highlight the matching pair so that you can check whether you have too many or too few. In fact, Editra can do a lot more than this, which you will discover and enjoy as you use it.

Program editors are superior to plain-text editors
Figure 2-20. Program editors are superior to plain-text editors

Again, if you have a different preferred program editor, use that—it’s always a good idea to use programs you’re already familiar with.

Get Learning PHP, MySQL, JavaScript, and CSS, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.