From the course: PHP: Choosing a PHP Editor

Advantages of using a text editor to write PHP - PHP Tutorial

From the course: PHP: Choosing a PHP Editor

Start my 1-month free trial

Advantages of using a text editor to write PHP

- [Instructor] Well, there are many advantages to using a full fledged IDE for PHP development, this can sometimes be more than you need, and a lot of mileage can be got from an advanced text editor instead. In this course, we will be focusing on Notepad++ when discussing using a text editor for PHP development, but much of what I say will apply to the many other editors available as well. On the slide, you can see some of the most popular text editors used by PHP developers. So some of the features of Notepad++ in particular, but again, this applies to most of it takes editors or we have syntax highlighting. So you can see, we have different colors for different parts of our code here, html tags are this kind of greeny blue. We have purple php tags and then different kinds of variables and strings. This is very helpful, it helps us to know where we are in our code. We also have auto completion which I generally have turned off actually, because for me one of the reasons to use a text editor is to keep things really simple. So I can turn on this feature by going to Settings and then Auto Completion and I enable auto completion on each input. So then if I do something like db = mysqli, I'm just go, then all the options will be displayed and I can use my down arrow to select the one which I want which is mysql_connect and then we have auto-completion. But like I say, I generally have this turned off which I do by going to Settings, Preferences, unchecking, Enable Auto Completion. We also have a folder as a workspace which is a useful feature is over here. My folder is open as a kind of project directory and obviously if I had more folders that will be displayed and I could open and close them. Another great feature is keyboard shortcuts. So for example if I do Ctrl + D, then I can easily duplicate a line. And if I have multiple lines that are basically the same with just small changes that becomes very useful and also for commenting. So for example, if I do Ctrl + K, I can comment, align and if I Ctrl + Shift + K, I can uncomment it again. So these are some useful features for PHP development some of the general advantages of using a text editor for PHP development over a full fledged IDE, are shown on the slides. One thing that I find particularly useful is the way that I can just open or create a single file rather than working with a project. So this means you can just open or create a PHP file and do some development without waiting for a relatively long time for everything to load and to create a project, et cetera. Some of the use cases for a text editor in PHP development, when you're first learning and you just want to try some simple PHP examples and also when you just want to make small tweaks to existing files.

Contents