What problem would you *not* use PHP or JavaScript

January 25, 2021, 7:27 am
What problem would you *not* use PHP or JavaScript
What problem would you *not* use PHP or JavaScript to solve? In other words, when would you decide to use a language other than PHP or JS?

Big data, machine learning, block chain

Accesa hardware like comm port

Literally anything with heavy async requirements (where synchronization is part of the business process). Its not that we dont have the tooling, but we dont have the community nor the adoption.

I would be more interested in: what problem would you not use another language but PHP in. I think PHP caters to a space where other languages can cater too as well. Familiarity and productivity are then the drivers. But what about PHP makes it so great that you NEED it?

We faced a problem integrating an RFID antenna to our Electron app, we used a Python daemon for that

Now a day all languages are in race trying to do everything. It is good to pick a library that is solid, old and have a active community. So Python for machine learning, C++ for Maths, Physics related calculations and also for dealing with hardwares

You can do anything with PHP and nodeJS for web dev. This does not mean you need to use PHP for video editing or picture editing. Simply exec() run another tool you downloaded from GitHub. This can be ImageMagick, FFmpeg. But a switching whole language to solve just 1 problem ?

Twitter tagged this tweet under `web development` and it shows

Whenever you want to write it in another language. You can write most things in PHP but you can also write them in anything else.

I learned Python to do web scraping for a project because I couldn`t do it in PHP.

as often as humanly possible

Non-html5 game dev I guess.

Mostly automation work, I`d prefer python.

Concurrent programing. Long running processes etc. This is for PHP. JS maybe.

I still find it`s a little too easy to end up with memory leaks to be comfortable with long-running PHP. The fixes are usually easy to make, but hard to track down

Im doing image processing / deep learning to find aneurysms in MRI images, using Python and Rust for ecosystem and performance reasons

binary stream processing

actually besides web developement, for all the other applications, there are better choices; machine learning->python, low-level stuff->c/c++, native mobile iOS->Swift, android->kotlin.

When building a native iOS app.

I would not use php if I was the one who got to choose the language.

Ill bet you a trillion dollars there are some scientists out there banging out Fortran as we speak lol

Things close to the machine (device drivers, OS development, etc)

Memory safety or memory consumption. Safe concurrency. Reverse proxy.

Making a Cross-Platform mobile or desktop app. Replacement for React Native or Cordova and Electron.

image processing and machine learning

I still see too many JS-based animations or interactions that CSS can now achieve more gracefully.

Bits of random data (text) processing, for which I usually use Python. I also find that easier to write in an editor like Vim.

Anything that needs to be implanted in the body c: Anything else, PHP :D

Depends on the tooling available for specific tasks: Id do AI/ML stuff in Python, vision/image segmentation in C++, iOS apps probably still in Objective-C.

Device natives dev - sometimes its unavoidable to have to write some Objective-C/Java, a lot of the build tools are written in Ruby (if you want to extend them)

In my case when building a Desktop application for windows (I use C .Net) or IA (python)

Often in just trying do one thing and that might be a little bit of glue around a library. If the best version of that library is Ruby then guess what, Ruby it is. CLI scripts, workers, etc dont matter too much what language it is if its 20-100 lines.

every single problem, if i have the choice.

High throughput services. Machine learning. Software that runs an elevator.

system daemon, UI app (desktop), embedded services (so called IoT now ;)

PHP didnt succeed with reading & serving protected m3u8 files for some of our live streaming videos. We had to rewrite a part of the project using Go, now it works like a charm.

For "Loopless" script in python

In data analysis with millions of rows and I need threads I use Golang instead PHP

For scientific calculations python and R are better choices.

Im becoming more and more convinced that JS is too often overkill and creates more problems. At least if youre using EmberJS. /grumph

Processing or generating complex Excel files. Php tools cant do what openpxyl can do

Async workloads (where jobs arent sufficient) - ie - do these N things concurrently and respond immediately - not easy in PHP, a breeze in Golang for ex

Machine learning (jupyter notebook)

When client ask for .NET

When it comes to WASM I would not use PHP. (:

Maybe something related to AI. Seems like Python and Java has a big advantage on libraries for that.

async and multithreading the multithread in php api is very poor

Ive yet to need to build something in anything other than JS or PHP. JavaScript is particularly flexible. I guess if you count bash, Ive written a fair amount of bash scripts?

Working with hardware, for example when needing to use GPIO

When I kindly ask my neighbour to turn the volume down.

Server level setup/configuration stuff. I tend to prefer something lower lever like a bash script. I also tend to think that processing large data sets might not be ideal to use PHP, but I actually have no proof of that.

To treat a huge text file. Perl for the win!

Any performance critc app.

Websockets. There ways with PHP but much better ways with other languages. Node or Elixir would be better.

Concurrency and threads

Often we choose other languages because of frameworks and community. Python is rather less efficient than PHP but has a huge ML community and awasome frameworks. Besides, in my experience with that language, is more friendly for non-technical people.

When I want to script something to automate or setup stuff for me, then I lean on bash or Python Or when I want super-efficient concurrency, then Golang

Speaking to people often doesn`t go well in PHP. I would probably use English.

I mainly do server admin and back end stuff these days. Always use PHP. Although I have be known to resort to bash shell for some things. About to start on Laravel, Livewire etc for a personal side project It is a very long time since I have had to resort to C or assembler

bash scripts I guess

Building a static site using with liquid tags

very strong guarantees about correctness, you`ll also get fully predictable timing/performance if you need.

IMO, the only reason to use PHP for such things is if you don`t know anything else and time is a factor (it usually is).

Low attack surface (no heavy runtime, no interpreter, fuzzing-proven light runtime, no GC that maybe implemented correctly (the only GC I think is trusted is the old one of the JVM, it is proven against hackers)). Type safety, no accidental change of int to string (unlike PHP)

Tbf at some point I used Go for everything but went back to JavaScript. I only use PHP because work uses it

ive needed async/concurrency for things like setting timers, doing periodic things during long running processes. Also grpc support for streaming in php isnt very good.

Multi threaded apps

For some quick/simple data processing, I`d go for nodejs

when something must be 100% correct its much easier to archive it with (for example) rust because the language enforce correctness everywhere. long running stuff in php is pain if you use third party libs.

Web scrapping, i use python cuz php wouldn`t do the job and javascript its just to slow and sometimes more complicated than python.

It`s not a problem of what you can or cannot do. Because you could do anything you want in PHP alone (even client side with webassembly) or JS (server side with Node.js). It`s more a problem of what`s the more adequate tool for the task : TTM, performance, maintainability

A parser for a language. A problem for which correctness is top priority. An algorithm where single-machine concurrency would make things easier.

Historically, I would have said low-level system access and interaction with system libraries is a bad fit for PHP. But I`m seeing things are starting to change with FFI and JIT in PHP 7.4 and 8.0

distributing CLI binaries is so much easier with Typescript/Node than PHP, hence using Typescript

Bare metal performance where languages like Rust and Go (compiled languages) kick the dust over JS & PHP interpreted languages. Algorithms, Mathematical Compute, Multi Threaded Performance, Parallel Processing where compilers can extract the juice better than interpreters

When interacting with the wife. sleep() doesnt work, Promises with the dishes not resolved. Besides that everything else.

Love problems. For those I would use the language of love.

For really low latency projects (sub millisecond response time) such as ad serving or real time biding

Daemons or long-running processes. PHP doesnt give me native control over memory, signal handling, concurrency and multi-threading. I would use Go or Python for those use-cases.

When I need something like downloading videos or scraping the web then I use Python. Everything else I use PHP&JS.

Also, somethimes the language is dictated to by your goals. My IntelliJ plugin is also written in Java because thats what it has to be written in :D

Embedded stuff, digital signal processing

PHP works for long-running processes with a few hacks bits (restarting periodically etc), I found some use-cases where its easier to use a language that copes with this better. I use Java for my Twitch Chat -> Webhooks bot for example

Machine Learning due to available frameworks. Super high concurrency workloads. Those are all I can think of

Interesting question. I read this article today about using JS libraries for clients I still use python for all my one-off scripting needs.

Desktop applications, though it seems everyone is hell bent on using JS. Mobile applications, also see above. Embedded systems, thankfully dont see above at this time. Machine learning (python), although people seem hell bent on forcing JS into this already solved problem as well

Data science would lean to Python libraries.

could you explain how to make a multi auth guards using foritfy? without using subdomain form admin logic

With AWS now you can just use their api to do most things that php cant

few GB (e.g 3gb) XML parse data. I back to python or golang.

Services that need to communicate over GRPC; where we need Full Type Safety > Golang. Personally I prefer golang today over PHP (or Python) because it is ways easier to write it in a Team

Speed and efficiency.. like i had to use a snippet of java servlet inside php app to integrate user data with Zapier CRM

Games Serious Desktop Applications Drivers In short: Everything not running in a Browser or different from an api

I usually go for Python when creating complex CLI things for CI/CD.

Projects requested by clients. For example, I wrote a backup workflow for my client, specifically, in PowerShell.

You have to use non-blocking implementations of standard libraries (like PDO), that`s one thing. Second, goroutines are native in Go, but in PHP you have to choose a framework, and they all have different approaches

Realtime stuff (mainly WebSockets)

I would choose Go for some microservice with gRPC when I need the speed.

Long running processes. I know you can use reactphp amd friends, IMO it`s still not very natural to write daemons in PHP. I`d probably choose Golang

I use Python or Java for big data and analytics as we work with banks mostly. The big data ecosystem (e.g. mapreduce jobs) is only evolved in Java, C++ and Python for now.

for data processing, I`d prefer Python over PHP due to the availability of NumPy and Pandas.

I think this is not too much of a valid question for PHP as PHP is meant to be used for web dev. For anything not related to web development, its not that good. So, when would I use PHP? Whenever I have a problem thats not related to web development (ML is one simple example)

I recently chose golang as backend for websocket server which does a lot of data processing. Seems to be much faster and uses less memory than equivalent php or node.js setup.

If it can`t be done using JavaScript I`d use a paid service. Still wait for typescript to be a first-class citizen on major platforms. A native threejs port will be amazing for games and creative applications.

Monetary applications (e-commerce, banking, etc...) because no handy native Decimal solution. Applications that are security heavy, needs a stronger type system like Scala, C, and maybe Rust. Performance heavy tasks, tend to compiled languages without GC, currently Rust only.

Audio/video manipulation. Anything that needs fast concurrency.

Id say complex mobile apps. Something like React Native is fine for most use-cases, but if you need to build things like video conferencing, AR, or external hardware integration (e.g. cameras), you probably want to use native SDKs.

For something who needs GPU power lik AI i definitely use Python, for everything else i always stick with PHP.

I use Python for scripting. It is installed by default on Linux and I can use the same scripts on both Linux and Windows.

- for portability - for high compute needs, not just I/O - if it needs access to the host system - require a library only available in another language (Pulumi for exemple)

I have basic knowledge of relational database design i need to practice and solve challenges. In my village I dont have any mentor. Suggest me resources to learn designing models for mobiles shop, garments shop pharmacy etc...

I wouldn`t use pure PHP for manipulation of audio or video.

scraping data in general. Selenium with python is my 1 choice these days.

Embedded hardware projects that require low power but tcp enabled comms. Such as the stuff Im working on for agritech later this year. Will use c++.

Machine learning. There are some PHP libs but to me PHP sounds like a wrong tool for the job.

I started as a php developer, switched to js for asyc stuff and then switched to go for typings safety and easy deployments

For markup I`d choose HTML and for styling I`d go for something like CSS.

 
Sponsored links