This article explores all the uses of an integrated development environment (IDE) and compares the costs and benefits of 7 popular IDEs.
Writing a series of articles about PHP gave me a deeper understanding of the world of PHP developers. I've talked to many PHP programmers, and what surprises me most is how few use IDEs. Most programmers use a text editor such as Notepad, Emacs, or Vim on Microsoft Windows.
The text editors I mentioned (and those I didn’t mention) are all great – I don’t want to debate which editor is better. However, I would like to emphasize that not using a text editor will give you a deeper insight into PHP code. Almost everyone thinks of a PHP project as nothing more than a directory of files (this view is very one-sided). Now let me take you into the world of IDEs, show you what IDEs can – or should – bring to you, and introduce you to seven of the most popular IDEs.
What is an IDE?
In short, an IDE provides a one-stop service for coding work. An IDE includes an editor within which you can edit code, debug the code, view the code in a browser (usually embedded), and check in and out of source control. To support these functions, IDEs have a set of features not found in basic editors such as Notepad or Vim. Of course, you can extend the editor to achieve these features, but the IDE includes them all in one streamlined package - and it's all preconfigured:
Projects
One of the IDEs The key feature is that it treats a PHP application as a project, not just a set of files. This concept - a project - maintains additional information, such as source control configuration, database settings for debugging, and the location of certain key directories.
Debugging
Another handy feature is integrated debugging. Using this function, you can set breakpoints in the editor, and the PHP interpreter will stop when it reaches this script. Starting from a breakpoint, you can inspect the values of local variables and diagnose problems in your code. You can use the echo statement in your code to check the value or you can use the error log to get the value of the variable.
Code Intelligence
PHP is a very regular programming language, which means it follows simple patterns. These patterns not only make the code easier to write, but also make it easy for the IDE to inspect the code in the project. In addition, they can help you write programs by displaying the results of inspections. For example, if a class named MyClass is defined in the project, when typing the keyword new, the IDE will immediately provide a pop-up window that includes MyClass as an option. When an object of that type is used, the IDE displays its available methods and instance variables. When you start typing a function command, the IDE displays its available parameters. To be fair, this is the number one reason why you should use an IDE instead of a text editor. This kind of code intelligence can effectively reduce mistyping class names, method names, and parameters.
Class View
Another effect of the code intelligence engine in the IDE is that the IDE can generate a class view of the project. Instead of displaying files, the system displays the different classes that have been defined, regardless of the file in which they are located. When a class is clicked, the editor accesses the corresponding file and displays the corresponding class, method, or instance variable. This is a great way to navigate in large projects.
Multi-language support
Each IDE mentioned here not only supports PHP but also supports related language sets: JavaScript, StructuredQueryLanguage (SQL), HypertextMarkupLanguage (HTML) and CascadingStyleSheets (CSS). Because HTML and CSS are relatively simple, IDE support for them is the best. Support for JavaScript often highlights syntax, but support is better than no support.
Source Control
All of the IDEs reviewed here support some connection to a source control system, allowing versions of files in a project to be maintained over time. You can mark a particular version of a file as a release version so that you can revert it if changes need to be undone. Using a source control system is critical in a team environment, even for personal use. A good source code control system comes into play when the disk crashes or when a customer suddenly wants a previous version instead of the current one. Most IDEs support ConcurrentVersionSystem (CVS) and Subversion, which are both open source control systems. One of the IDEs supports Perforce, a commercial source code control system.
FTP/SFTP integration
One feature related to source control is the use of FTP for the latest code in the server. This is much easier than using an FTP client or packaging the file yourself, sending it to the server and then unpacking it.
Database Navigation
A non-basic but very useful feature is database navigation. Using this feature, you can browse the database accessed by the application, find table and field names, and return query results. Some systems can even automatically write some database access code.
Integrated web browser
Some IDEs support an integrated web browser that can navigate directly to the page being edited using specified additional parameters. This browser can be hosted within the IDE or called externally. To be honest, I'm not a big fan of the integrated browser because I don't mind switching between two separate applications for editing code and viewing results. But I know it does have a role, but you don't have to use it.
Fragments
The last feature I found in all these IDEs is the support for full and custom code snippets. A snippet is a small piece of code that performs a small task such as running a regular expression on some input, connecting to a database, and querying the database.
The above summarizes the core features that can currently be expected from purchased or open source IDEs. Next, some popular IDEs will be introduced, some IDE pictures will be shown, and the features they support and their costs will be explained.