VS Code Wins Best PHP IDE/Editor for WordPress Development in 2020

#

When building software or websites, you’ll need to use an integrated development environment (IDE), a code editor or if you’re really brave, a text editor. They each offer different benefits and drawbacks making it confusing to decide which tool you need, and from there, which tool to ultimately use.

When I was actively developing websites, Sublime Text was my go-to editor. I then moved on to VS Code but that was over two years ago. If you’ve ever taken any amount of time off from coding, you know that things change quickly. That’s why this article was put together through a delicate combination of research and poking and prodding our experienced dev team.

Below I cover the differences between IDEs, code editors and text editors. I then delve deeper into what they are, what to look for and which tool we recommend as your PHP IDE or PHP Editor. If you already know what you’re interested in, feel free to skip ahead:

But what’s the difference between an IDE, a code editor and a text editor?

Before we get started, here’s a quick overview of what each of these tools are:

  1. An IDE encompasses the functionality of several tools in one environment (like a database administration tool, a terminal and a debugger) allowing you to write code, compile it and debug it, all under one roof. It’ll be your one-stop-shop for web development.

  2. A code editor can often be suped up to include similar features to an IDE but usually won’t come with those features out-of-the-box. You can expect just a text editor with syntax highlighting, minimal language integrations and the option to install addons or plugins to add extra functionality. You’ll have to use addons or plugins to compile and debug your code.

  3. A text editor is a barebones text manipulation program. Think Notepad on Windows on nano on the CLI. Depending on the tool, you may get features like autocomplete and syntax highlighting but you’ll certainly need to use it in conjunction with other software.

IDEs

Best for: All developers, developers who like everything in one place, editing someone else’s code or code refactoring.

The best part about an IDE is that it allows developers to use one tool instead of three or more, making you that much more efficient as a developer. They usually include a code editor with syntax highlighting, a directory listing of files and folders in your project, build automation tools, a debugger, and language autocomplete features. Since they offer more functionality, they use more resources (memory, CPU) than a code editor or plain text editor.

IDE tools may be specific to a programming language. The PHP IDE I’ll be covering today, PhpStorm, is for PHP (unsurprisingly given the name 🙃), HTML5/CSS and JavaScript. There are also plugins available to support many other languages and frameworks.

What to look for in an IDE for PHP Development?

  • User interface that’s easy to navigate (since they offer so much functionality, it can be overwhelming)
  • Debugger
  • Git integration/Version control support
  • Compatibility with your OS

Best PHP IDE: PhpStorm

Many of our devs here at Delicious Brains Inc love PhpStorm. It offers way more than a basic code editor. Once you get used to the luxuries, it’s hard to turn back. Built specifically for PHP, it’s the ideal IDE for WordPress/PHP developers. You can even create a GitHub pull request from inside PhpStorm.

As with any tool, there are some pros and cons:

Pros

👍 Code completion of hooks
👍 Search on WordPress.org
👍 Navigate to any hook
👍 Define coding styles for languages you’re developing with
👍 Deep JavaScript and React support
👍 PHP Code Sniffer integration

Cons

👎 Can be slow with large codebases (code intelligence features require indexing the entire codebase)
👎 Pricey
👎 Interface can seem cluttered

Operating System

  • Microsoft Windows
  • Mac OS X
  • Linux

Cost

PhpStorm offers subscriptions for individuals or organizations with incremental discounts the longer you have it up until three years.

Individuals – $8.90 USD monthly or $89 annually

Organizations – $19.90 USD monthly or $199 annually

They also offer special discounts for students and teachers (free), open source projects (free) startups (50% off) and more.

Why PhpStorm?

PhpStorm is the top IDE for PHP/WordPress development. The abundant built-in features like code completion for hooks and the ability to search on WordPress.org all add up to save you time so you can focus on building software. You will have to deal with slow loading from time to time but that’s to be expected with such a powerful IDE. If you happen to be cleaning up your code, our examples of refactoring your PHP code for better readability can help.

Code Editors

Best for: All developers, developers looking for a less resource-intensive tool or those looking for a free option.

Code Editors are a happy middle-ground between text editors and IDEs. They offer more functionality than a text editor but not as much as an IDE. A code editor usually just needs a file, not a whole project. You’ll commonly see extensions available but won’t usually see a debugger or compiler built-in as you would in an IDE.

While code editors aren’t typically as powerful as an IDE, they can be with some tweaking. VS Code, for example, is often mistaken for an IDE because you can set it up to behave like one.

Like IDEs, code editors may support just a few programming languages or a wide variety.

What to look for in a code editor?

  • Lightweight
  • Offers extensions for added functionality
  • Compatibility with your OS

Best Code Editor: Visual Studio Code (VS Code)

VS Code (created by Microsoft) is another favorite here at Delicious Brains Inc. If one of our devs isn’t using PhpStorm, chances are they’re using VS Code. It’s lightweight so it won’t slow down your computer as much as an IDE and offers many extensions so it can be just as powerful as an IDE. VS Code doesn’t support WordPress out-of-the-box but this is easily achieved through extensions (some of our favorites are the PHP Intelephense and WordPress Snippet).

VS Code comes with its advantages and disadvantages:

Pros

👍 Lightweight
👍 Workspaces
👍 Many extensions/plugins available to make WordPress dev easier
👍 View docs without leaving the editor
👍 Extremely customizable

Cons

👎 Needs adjustments to support WordPress and PHP
👎 Limited Git functionality
👎 Can be laggy compared to other code editors

Operating System

  • Microsoft Windows
  • Mac OS X
  • Linux

Cost

Free!

Why VS Code?

VS Code has all the potential you need to create an IDE environment out of a code editor. It’s the most powerful code editor and one we highly recommend for WordPress developers. You’ll just have to take some time to configure it but once that’s done, you’re cruising 🏎

Text Editors

Best for: Expert devs or if you know the source code really well.

Text editors are the bare bones in the editor world but that doesn’t mean they don’t have their place. Many people swear by Vim. Text editors can do their only job really well and allow you to work with fewer distractions. Sometimes the bells and whistles can be overwhelming (to both you and your computer).

As you might have guessed, they’re just a text editor – you can’t edit the source code, there isn’t a compiler, no debugger and you won’t see any themes. But text editors can be so much more than Notepad. Plus, since it’s a text editor, it can be used for any programming language.

What to look for in a text editor?

  • Auto-indentation
  • Syntax highlighting
  • Search/replace
  • Regex support
  • Optimized to handle large files
  • Spell check with file comparison

Best text editor: Vim

If you’re anything like me, when learning to code you heard tales of those who got stuck in Vim and never escaped 😱

As it turns out, while Vim can be complicated, it’s quite robust. If you’re looking to use a text editor for your coding, we’d recommend Vim. It includes syntax checking, auto-completion, code linting, file management among other features. These features can be easily missed though and Vim is a tool you’ll need to spend a long time exploring. It’s all keyboard-based which, yes, can be overwhelming at first but once you get rolling you can be extremely efficient.

I’ve seen some people who’ve been using Vim for many years and it’s like watching a wizard programmer from a Hollywood movie. – Brad Touesnard, Delicious Brains Inc

Here are some of the positives and negatives of using Vim:

Pros

👍 Lightweight
👍 Very configurable
👍 Regex support
👍 Keyboard-based
👍 Can be used from a Terminal

Cons

👎 Difficult to learn
👎 Confusing documentation
👎 Poor support for external tools

Operating System

Cost

Free.

Why Vim?

As far as text editors, Vim is the way to go. It’s lightweight and once you get comfortable, you’ll be remarkably efficient. There is a lot to learn with Vim so you’ll always be discovering new ways to improve your workflow.

Did you know you could use Vim WITH an IDE/editor? Some IDEs and editors offer plugins or extensions that introduce Vim-mode, allowing you to use Vim keys/commands in the editor or IDE. For PhpStorm, you can use the IdeaVim extension. If you do go for it, you’ll just have to configure the shortcuts since both tools are keyboard-centric and may cause some conflicts with the key combinations. If you’re using VS Code, there’s also a Vim emulator you can use.

The Verdict: Which is the Best PHP IDE/Text Editor?

🥁…

We’ve established that each of these tools are at the top of their respective niche but which is best for WordPress/PHP development overall?

🥇 VS Code
🥈 PhpStorm
🥉 Vim

After using it for three years, I still love VS Code. It’s like it took my favorite features of PhpStorm and Sublime Text, and combined them to create the perfect IDE. – Matt Shaw, Delicious Brains Inc

VS Code can be made to be as powerful as an IDE but doesn’t come with the initial “bloat” or a price tag. With VS Code, you get to choose which add-ons you want. With PhpStorm, you’re stuck with all the functionality from the get-go, whether you need it or not.

It looks like others agree:

PhpStorm is a very strong runner-up, offering you one place to do almost all your dev work. You’ll deal with some lag but it’s built for PHP, making it a great option for WordPress development (or development with any PHP framework).

Vim didn’t get much love in our poll, with just 2.6 % of respondents saying it’s their favorite editor for WordPress development. It is a wonderful option among text editors but for WordPress development, you can’t compete with the features offered in code editors or IDEs. It can also be difficult to navigate between files which is essential for WordPress development.

Almost ten percent of those who participated in our poll had another favorite editor. If you aren’t keen on the editors I covered today, you may want to check these out:

IDEs

Code Editors

Or, you can use a combination of editors as Dipak does:

Once you’ve chosen your IDE/editor, Iain will guide you through setting up your local WordPress development environment.

What’s your favorite IDE/editor for WordPress/PHP development and why? Do you recommend any that I didn’t mention?

I can already hear the rumblings of another IDE/editor debate brewing amongst our devs 🏃🏼‍♀️