DEV Community

Peter Tasker
Peter Tasker

Posted on • Originally published at petetasker.com on

Open Source, PHP and Visual Studio Code

VS Code

Lately, VS Code has been getting a lot of hype in the dev community. It's been around since for a few years and TBH is a really sweet editor. Lots of great extensions and community support. It's also quite fast (for an Electron app 😬) and the peeps and Microsoft seem to be keeping it up to date and iterating quickly.

However, anything you really need to work with PHP is missing by default. I believe this is by design to encourage a vibrant extensions community. Luckily, like most languages, there's a vibrant open source PHP extension community. There's a few great extensions for PHP: PHP IntelliSense, PHP Debug (both by the same developer) as well as PHP Intelliphense (#wat?). There's even a really great intro by Jeffrey Way on Laracasts outlining everything you need to do to get VS Code set up for PHP dev.

Some of the PHP packages work fine and have over a million installs (!!!). Sometimes, however, they don't work. Like, at all. Just today, the PHP Debug extension completely broke. Luckily the developer was paying attention and rolled out a fix within hours. Pretty awesome support for an open-source product!

However, if you paid for the editor, say something like PHPStorm, you could go and raise an issue on their support channel. You could complain about the product not working, rightly so, as you've paid for the right! As a 'customer' you have a certain amount of clout with a vendor like Jetbrains. This is NOT the case with open source, and I feel that we developers forget this.

This is where I take issue. I'm all for open source software. I've built my career on it. The issue is that the developer for this plugin had to fix the issue himself. There's an expectation there that he HAS to fix the issue, and do it RIGHT NOW. And if it's not done immediately people freak out, complain on Twitter, write a blog post about, have a cow 🐮, man.

Open source is just that, open. If you find an issue with a plugin, editor, extension or WHATEVER, see if you can fix it! That's the whole point. Let's not throw our hands up and complain, let's get our hands dirty and fix the damn thing.

That's what open source is all about. Let's remember that.

/rant

Top comments (7)

Collapse
 
nikoheikkila profile image
Niko Heikkilä

I'm able to use XDebug without much problems in VS Code but it's the PHPUnit extensions (I've tried at least three of them) that seem to either break alltogether, run with wrong configurations or encounter some other shady matters. Unfortunate, because that and good refactoring support might be the only obstacles for me to fully switch off from JetBrains world.

Microsoft seems to be focusing on Javascript and Typescript which is nice but not enough for me.

Collapse
 
coolgoose profile image
Alexandru Bucur

I'm an user of both PhpStorm and VScode, but the sad part is that even if there's a bug in Phpstorm, and you report it, there's a slim to no chance of getting it pushed asap.

Collapse
 
ptasker profile image
Peter Tasker

Yeah, that's also true. My main reason for staying with Storm is that it has a lot built in (code auto-formatting, Xdebug etc.). The whole VSCode extension community is a little wonky at the moment, at least for PHP support.

Collapse
 
coolgoose profile image
Alexandru Bucur

That's true, storm is great since it covers a lot of things (including nice db remote support, rest calls etc), but I do use VSCode as my daily here's a file edit it handler.

Collapse
 
erhankilic profile image
Erhan Kılıç

I hate Visual Studio Code. Because of Microsoft.

Collapse
 
dojovader profile image
Okeowo Aderemi

Wow Microsoft has changed it's no longer the same, TypeScript is awesome despite it being from MS, even BabylonJS, leave the personal sentiments and use the tools.

Collapse
 
ptasker profile image
Peter Tasker

🔥But seriously, VS Code is pretty sweet. TypeScript seems neat too, but I haven't had reason to use it over ESNext.