Hacker News new | past | comments | ask | show | jobs | submit login
Setup VS Code for Efficient PHP Development (theodo.com)
95 points by lmichelin 4 months ago | hide | past | web | favorite | 63 comments



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.


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.


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.


> 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.


+1

phpstorm is a work of art


Know what you want.

PHPStorm is an IDE. It can be used as a simple editor but compared to the other it sucks at it, very clunky.

VS Code is an editor. It can be used as an almost IDE with refactoring and stuff but compared to the other it sucks at it, very clunky.

I use both, for PHP and for Go, and they're very different beasts who both have their uses. It's weird to me that one could consider them in competition or having to "chose one" between them, unless you don't really know what kind of tool you want to work with.


We need to retire the IDE/Text Editor distinction. It really serves no purpose now other than to cause pointless debates or make people feel a bit more elite.

The line is too blurred between the 2 and it doesn’t really matter anyway.

Nearly all text editors these days are just modular IDEs, people add on the bits they want and do their work in them. May as-well just use IDE to describe all of them.


I know you've seen others use this line, and how smart they appeared doing so...

But for VSCode, the distinction just isn't there anymore. It has integrated debugging, refactoring, indexing, and all sorts of other language-specific features.


Yes, and if you use VS Code for those features it's terribly far behind the competition. Even its auto completion for PHP (a very nicely supported language) is nowhere near as complete and reliable as the one from PHPStorm. As for refactoring, well, it's not even in the same league.


So does Emacs. Emacs also has multiple webrowsers and email clients out of the box. Those features do not make Emacs not a text editor though.


Well IntelliJ Community Edition has so much limitations, like Enterprise part is only available in Ultimate.


With the amount of value that I get out of IntellJ Ultimate considering I use it for every language I use (Java/PHP/Go/JS literally whatever) I am VERY happy to throw them $89/year (you get discounts for consecutive years, first year would be $149). That really feels like nothing and it's definitely well deserved.


It's $499 a year and comes down to $299 after two years, much more expensive now - https://www.jetbrains.com/idea/buy/#commercial?billing=yearl...

For some use cases the language specific IDEs can be better and getting access to all of them is quite pricey.


That's for organizations. I am talking IntelliJ Ultimate (no Resharper included) for individuals.


I am VERY happy to throw them $89/year

Is that $89/year so you can get updates each year, or does it stop working if you stop paying?

I won't rent software ("SaaS").


Updates. When you pay, you get a perpetual fallback license to that version

https://sales.jetbrains.com/hc/en-gb/articles/207240845-What...


If you pay for 1 year you get to keep the minor version from the start of the year. Eg. if you start a 1 year subscription now you will get to keep version 2019.1


The idea is if we are coding for work and we get paid for it we can sacrifice a few dollars to have professional team work on our tools and support people that are paid to respond to bug reports. The free edition of Visual Studio not Code was also super limited.

I tested VS Code on a side project and even for JS Intellij was better for me


sublime is so much faster than both.


Sublime just doesn't do what PhpStorm (and others Jetbrain's IDE) does.

And yes I sometimes wish it would be faster, but not enough to use something else with a quarter of the functionalities.


What does phpStorm give you that sublime doesn't? Refactoring tools are nice and deployments configuration are nice but the tradeoff just loading the app in terms of speed can feel like minutes.


People do refactoring regularly. You start the app once.


I'm not a Sublime expert but: great Git integration, database management, Xdebug handling, all those extensions (the Symfony extension is basically magic, and that is just scratching the surface), I could go on.


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.


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.


sign of the times: you need a good GPU to edit text


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


Electron does weird stuff... I never liked these in the end...


I'm on the latest MacBook Pro. Hardware isn't the problem. It might be some plugin but I'm a minimalist when it comes to editor plugins.

The specific issue that became my last straw was automatic insertions of return char. I think linked to the intellisense plugin. But I just lost patience and went back to a reliable text editor.


Ah, so this is why VSCode runs fine on my desktop, but chugs on my otherwise decent Thinkpad? I've been using Sublime on my laptop for this reason, but do miss the advanced features of VSCode.


Runs just fine on my very underpowered Thinkpad. Although slightly faster on Linux than win10.

Remember, vscode extensions are written by third parties and not always very well-written.


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.


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, 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!


Hello :-) Pleased to see that you appreciated my article and thanks for your great work on PHP debug for VS Code! I will do a PR with pleasure if the opportunity arises ;) Feel free to retweet my article btw ^^ https://twitter.com/lm_michelin/status/1152182328086732800


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.


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 ;)


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.


> 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.

You could say the same for every "open source" products backed by a Multi Billion dollars corp, React (Facebook), Go (Google), ... Java (Oracle).

> This kills the business model of InteliJ which does a lot of work in making great IDEs

I don't think so, PHPStorm is still miles aways in front of VSCode for PHP development, and there is no serious Java dev with VSCode either. Jetbrains will be OK.

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

VSCode became popular because it learned from the philosophy of Textmate and Sublime Text: A good IDE should be first and foremost and excellent text editor. If anything VSCode "killed" Atom, but both belong to the same corporation.

Now yes, Microsoft is getting unpaid developers working on their product. There is certainly a moral angle, but it's not really killing the paid competition.


I use both and agreed, Intellij is a fantastic IDE for Ruby, Python and PHP with little setup required (but lots of configurability if wanted) etc.

If anything they complement each other as no one would accuse intellij of been quick to start often I'll whip into vscode for those edits.


Not sure why you put "open source" in quotes, because it really is open source. You can freely fork it, modify it, rename it, whatever. I'm not sure what you think Microsoft's angle is for getting people to move away from IntelliJ, but I seriously doubt it's even a consideration. JetBrains makes a ton of money from Microsoft developers (most of our team uses ReSharper and Rider), and I don't think I'd consider VS Code quite in the same league as a dedicated IDE.

I'm curious; do you feel the same way about RedHat? Canonical? Java? What's the criteria for "this company is too big for me to trust their open-source products?"


I’ve put open source between quotes because having a near monopoly company back it makes it feel like a product sold at a dumping price only to increase the company’s brand popularity, so they can cross sell other products. Given Microsoft’s size it can afford “selling” a product for free and open source for as long as it takes to monopolise that niche. I feel the same about google, facebook, and others. I dont feel the same about red hat (pre ibm) or canonical. It’s quite ok to monetise on open source, but not to use it to monopolise yet another niche.

What I want to support is open source projects built by genuinely independent communities or individuals. Also i support high quality paid ides such as those developed by jetbrains. As devs many of us want to be indies, but we dont want to pay for software - a bit of a catch 22.

The issue i have with large companies doing open source is that they use the movement as a marketing tool, and kill indie developers or small companies and truly independent communities, while their core products are still closed source and cross sold thanks to free bait.


If you were here, I'd buy you a beer.


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.


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.


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.


I am not worried about microsoft stopping developing it, i am worried about microsoft putting companies out of business using free products, which they then use to cross sell their closed source ides and as a marketing tool. If they are so open source friendly why dont they open source their visual studio, or windows, at least the older eol versions - so we can learn something out of their code, as per open source’s principles?

That’s right. Because they don’t care. They want a marketing product, dumped and aimed at commercial ide developers. VSCode is a free product, with the source code made available and developed by people for free, and for the benefit of microsoft.


I am not worried about microsoft stopping developing it, i am worried about microsoft putting companies out of business using free products, which they then use to cross sell their closed source ides and as a marketing tool.

So would you be opposed to participating in a free forum that is used as a marketing tool by a venture capitalist?


Well I won't downvote you, but your reasoning is a bit poor. There are many open source IDEs out there, VSCode just being just one of the few. So why not boycott all those other editors too?

You also imply that because Microsoft is such a big company it can put more resources than the other editors can, thus having "unfair" advantage over the others? I understand your concern, but as far as I know Microsoft hasn't leveraged VSCode's market share to do anything unreasonable and alas, if they did I'm sure people would just fork the editor without all the BS of Microsoft.

And I'm not against IntelliJ and they make good editors, but I don't want to pay for their products if I any way can. If Microsoft gains goodwill of developers and a lot of users for their product, well good for them! About time they started doing that. I still dislike Windows as much as before, but hey I got now a great editor that is free and I love to use.


It could be maybe a parallel made with Chrome, it was a good browser with tons of money put into it by Google, developers liked it, google got evil but still most people use Chrome instead of Chromium or Firefox.


There's nothing to "support", it's free software that you can use if you want, just like Vim, Atom, and Sublime. Open-source software has supplanted lots of commercial offerings over time. It's standard commoditization.

VSCode isn't endangering any IDEs and has a very long way to go for all that functionality, most of which is provided by the community and not Microsoft. In case you didn't know, Microsoft itself has Visual Studio which has lost its own users to VSCode and Rider alternatives.


Thank you. I appreciate those with the free time to fight the fights they feel are important.

I don't have the luxury to be principled. I just use whatever tools get the job done. Because when Friday afternoon rolls around, I'm going home to be with my kids.


That's a pretty good excuse actually, we're running out of people.


While I agree (and for the same reason think that it was actually a good thing for RSS that Google Reader was killed), it seems that the big companies can never win. If they make a closed source or paid tool the crowd will criticize them, if they make open source it ends up the same.


VSCode is an alternative to Atom, Textmate and Sublime Text. I’d see Intelij more into the kitchen sink included heavy weight IDE.

I’ll agree with you paying IDE could get more love, but each of these apps have specific strength and weaknesses that make them their own niche. Choosing one or another purely on principals would be weird.


The commoditization of software has been a trend for years. If Intellij wants to charge for a dev environment, they have to offer features that make it worth the cost.


Yeah, well, it's the best IDE I've used for PHP (or any other web development) in a couple of years.

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

I hate to break it to you, but the only open source projects that last are sponsored by big companies. Most people don't want to work on edge-case bug fixes unless they are paid.

You should be thanking big companies, regardless of Monopoly status, for giving us such great, free, software. Which I might add, took lots of money to create.


kills genuine businesses due to the monopoly position of the company “sponsoring” it.

While I agree with most of your point, since VS Code is open source, can't the commercial IDE makers just borrow the good parts and ideas from VS Code and make their products better?

Sure, it won't mean anything to the sort of people who won't use a paid product for any reason. But it might sway people who are on the fence. Hopefully in the long run that will keep the competitive ecosystem healthy, and not just run all the commercial alternatives out of business.


How this any different than any other open source product has always been? Android killed Windows Mobile - do you have an Android phone? Do you use any software that is “free as in beer” subsidized by other businesses instead of paying for the equivalent software? What about Stack Overflow - it completely killed ExpertsExchange.

All of these products “killed business models”.


Hey there,

Check out https://vscodium.com/


> This kills the business model of InteliJ

Wrong. Competing is ALWAYS great for product and customers.


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.


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!


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... )




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: