
Setup VS Code for Efficient PHP Development - lmichelin
https://blog.theodo.com/2019/07/vscode-php-development/
======
kevinvdburgt
Been using vscode for a long time now and just love using it! It feels more
stable and smooth for me than using the phpstorm ide.

~~~
duiker101
Really? Guess I'll have to give it a try. I am a hardcore IntellJ fan but it's
good to see what's out there.

~~~
charrondev
My experience has been the following:

VSCode is far and away the best IDE for typescript. Nothing comes close.

PHPStorm is far better than VSCode for PHP. It is far better at handling
imports, it’s debugging is more flexible and makes running individual tests
much easier (and debugging them). It has code generation for boilerplate like
constructors, getters, and setters. As another commenter mentioned it handles
references in doc blocks far better as well.

I can do some PHP programming in VSCode, but am far productive in PHPStorm.
It’s the other way around for Typescript though so I run them both all day and
have the keyboard shortcuts configured similarly.

~~~
steve_adams_86
> makes running individual tests much easier (and debugging them)

This sort of polish is incredible. I love having it in RubyMine. If I had way
more time I'd try to build a VS Code extension to make this work, but I really
don't have the time.

Little things like this make an IDE worth paying for.

------
factorialboy
I've tried VS Code multiple times. Without prejudice. Really want to make it
my primary editor.

After persisting with it for over a week, I had to revert back to Sublime. The
typing experience of native is still just so much better.

~~~
jjeaff
Do you have a decent GPU? Because electron is GPU accelerated and probably
would make a difference. I have heard complaints from people with integrated
graphics not getting a smooth experience.

I'm very sensitive to issues like that and I find it buttery smooth. Though I
am running it on a rather highly performance system.

~~~
dmitrygr
sign of the times: you need a _good_ GPU to edit text

~~~
jjeaff
Makes sense if you want to edit colorful text in a gui wrapper.

------
esistgut
Last time I checked PHP extensions on VSCode couldn't understand if the
imports where actually used in the docblock annotations. Well, they couldn't
undestand most of what was going on docblock annotations to be fair. Things
like "organize imports" and "rename symbol" were missing too.

------
felixfbecker
I am the author of the PHP Debug and IntelliSense extensions, awesome to see
this get publicity on HN (aside from the Devsense fiasco
[https://news.ycombinator.com/item?id=18538432](https://news.ycombinator.com/item?id=18538432),
lol)! If you're passionate about PHP in VS Code and are missing some feature
or see some bug, please don't be afraid to jump into the code and do a PR!
I've built them as a community project from the start, with as many comments
as possible and (the language server) intentionally written in PHP so PHP devs
can contribute. I actually don't get to write any PHP anymore nowadays, but I
am always happy to review PRs!

~~~
soulclap
So are your IntelliSense extension and the PHP Intelephense extension
competing solutions? Why? Isn't there a way to join forces?

And I have to say that I've had better experiences with the latter. Also "last
commit: 14.11.2018" on IntelliSense doesn't sound that great.

~~~
felixfbecker
They are fundamentally different - my language server is implemented in PHP so
it can build on existing PHP parsers and PHP devs can contribute to it.
Intelephense is written in TypeScript. They are two different approaches and
both can coexist.

You can bump that date (and your experience), by making a pull request which I
will happily review ;)

------
soulclap
Last time I tried the 'Getter & Setter' extension, it was quite a pain
compared to PHPStorm. I had to click on each of my variables to generate a
getter and setter. Wish it was just let me choose which variables I want to
generate getters and setters (issers and hassers) for.

I really like to work in VS Code when I am on my home laptop (as in: not at
work) but things like these more or less force me to keep a PHPStorm trial
version open in the background.

------
kevinvdburgt
Another thing why i prefer using vscode over phpstorm is that i can use vscode
for almost every language. Mainly a php/react/typescript dev, but when working
on other projects written in go, python or rust i just van use the same ide
which i really like!

------
75dvtwin
would be great for VS Code to add OpenBSD support (I am using VSCode on Linux
and Windows, but would like to move to OpenBSD since I no longer do dev work
requiring phone emulators (which are unlikely to be on OpenBSD anytime soon)).

The article also gave me an idea to try SQLTools (I am having lots of trouble
with using pgAdmin4... )

------
trilila
I wont support VSCode for one reason (downvote to oblivion): it’s “open
source” sponsored by a near monopoly corporation, which makes VSCode a
marketing tool for Microsoft. This kills the business model of InteliJ which
does a lot of work in making great IDEs. Basically, Microsoft is using its
wealth to dump a free product on the market and to kill its competitors.

Think about it for a moment: this kind of open source kills genuine businesses
due to the monopoly position of the company “sponsoring” it.

~~~
roryokane
Even if Microsoft is hoping to kill competitors, I don’t see how it’s a
problem. If people stop using their competitors because VSCode is just as
good, then people are using a program that is just as good, for free. That’s a
better state of affairs.

Perhaps you’re imagining that at some point Microsoft will stop developing
VSCode because it has served its purpose, leaving people with no options. In
that situation, people can still use the software for free for a while, until
the code rots enough that it won’t run. Possibly by then, volunteers in the
open-source community will have started maintaining it. Even if there aren’t
enough volunteers to maintain VSCode for free, anyone (such as JetBrains)
could start a company that maintains their own fork of VSCode (which they can
do because it’s open-source) and charges users to use it. In that case, we are
no worse off than before VSCode was introduced; we just had a few years where
the popular IDE was temporarily free.

~~~
hrktb
We had that with Google basically killing the RSS reader market, and it looks
painfully hard to have it back to anything relevant, so this is a pretty bad
scenario.

Now I don’t think VSCode will kill its competitor, it’s not that good IMO.

~~~
roryokane
I don’t know that much about the history of RSS clients, but I’m not sure that
Google Reader’s shutdown is comparable to VSCode’s future abandonment in terms
of its effects on the market. The crucial difference is that Google Reader was
not open source. Maybe if Google Reader had been open source, someone would
have kept a fork of it running. I don’t know in what way the RSS reader market
was “killed” or why that happened, though, so I can’t say for sure that such a
fork would have prevented the market from being killed.

I agree that VSCode is not yet good enough to kill off competitors like
JetBrains, so there is little need to worry either way.

