3 ms·
>what do you think PHP does better than other languages? Most of the time is not language A vs language B in abstract, it really depends on the project and wha
by simion314 6y ago
>what do you think PHP does better than other languages?
Most of the time is not language A vs language B in abstract, it really depends on the project and what experience you or your developers have.
Let me give an example that is not web development. We had a desktop app and we had a feature where the user can submit feedback or bug reports. This feedback was stored and managed in a third party product that had an API, we could not call this API directly from the application because we did not want to put our keys in the app. So we had to put 1 php file on our server that contain the secret key, we done a POST from the app to the server and the script would validate and then connect to the API. I am imagining that some people today would solve this with some super engineered containers or micro services but the solution I used with just 1 file with a few lines of code could be implemented in a few minutes by a developer and maybe 1 or 2 hours by some competent non-developer.
- williamdclt 6y agoGood use of PHP I'd say, but as usual its strength really is that it's so easy to execute on any server. If you already had, let's say a Node backend, it would have been easier to just add an endpoint for this. The language itself, while I had no hate for it, doesn't have much advantages over Python/Ruby/JS/TS/other.
- simion314 6y agoSure, and for different jobs I used other languages. For one task there was a great python library so we use python and sent to it requests from PHP , some other task there was a java executable that worked the best so I called it from PHP, some other tasks there were Linux CLI tools that worked best so I called those, and some other task needed to use node and puppeter(a Chrome) wrapper - it was crashing a lot so we put it on a different server and called it from the main server PHP project. So in real world projects you don't chose the tool based on coolness factor, if you want to solve a problem in the best way possible you need to use the best tool for the job.