ryoblog/src/blog/why-i-use-php-for-webdev/index.md

4.5 KiB

title: Why I use PHP for web development author: 寮 date: 2022-07-21 17:05:00 tags:technology,webdev,internet threadid: ALi5Ooxixlo9i4P03E

I already hear you saying, "but Ryo-chan, PHP is sooooo 2005, why the fuck would you still use that in 2022 instead of switching to Python/Ruby/Rust/Nim/Java/Node/ASP/C#/Kotlin/Swift/Go/whatever"?
First off, Kotlin and Swift are no webdev languages, they're walled garden languages for Android and iOS/macOS respectively, so it makes 0 sense for me to even use it.
Second, Ruby, Java, Python, and C# are desktop programming languages, so they should have never be made into webdev languages in the first place!
There is a framework that allows you to make websoytes in the Bash scripting language, that doesn't mena it's a good idea.
Third, Node is not a language, it's a framework for JS that kind of pretends to be its own thing, and JS is a frontend scripting language, and should never have been turned into a backend and/or desktop and/or mobile language, m'kay.
With that out of the way, well, why should I have to become a student for the rest of my career if I get the job done with something I know for almost 2 decades?

PHP is all about freedom, PHP is simple, PHP is easy to pick up, it just feels right from a minimalist point of view.
You mkdir a folder and cd into it, then you touch a file (or just type nvim filename.php right away), and write stuff from 0, no dependencies required, only the PHP intepreter.
The only other languages that can do are JavaScript, HTML (+ CSS), and nothing else (well, there are more, but I'm talking about webdev here).
As much as I shit on JavaScript for being a horrible language, just plain vanilla JS is not that bad, it's the frameworks, dependencies, and lack of discipline from soydevs that really make me hate JS.
Go comes close, but requires init command first which creates go.mod file, uses compiler (compiled languages are better for performance, I know, it's just a difference from PHP, that's all), but still not too bad.

In the case of Ruby on Rails, first you MUST use that framework for webdev, second it creates a bunch of files for you which creates many layers of complexity before you even begin to code.
PHP and JavaScript frameworks are the same, which is why I hate them so much.
Java and Python too require a web framework for webdev, and those too generate way too many files.
There is no framework that is simple, provides freedom, is easy to pick up, and is minimalist, simply because frameworks are never designed to be that way in the first place.
They always give you bloat to start with, no freedom of creativity allowed at all, you must learn the system on top of the language first before you can even start making anything.
Which is why I prefer to just make everything from scratch, as it's easier for the machine, easier for the developer, way more optimal performance, way more easier to deploy the final release, and so on.

As for the deployment, what do you think is easier for your normie clients?
Having to open up the terminal, login to SSH, create a new user, sudo su - newuser, clone the Git repository, install a bunch of dependencies through apt-get, run Composer/go build/NPM/Yarn/whatever to install even more bloat (I mean dependencies), configure stuff, run the migrations command, activate soystemd (only) services, put a service restart command in cron to automagically restart your web "app" from time to time because it's so bloated that it keeps crashing all the time, and then continue the setup through the browser?
Or just having to upload the files using (S)FTP, renaming the config file, filling in the DB details, create a DB in phpMyAdmin, run the installer script, and call it a day?

For the people calling me a boomer for refusing to learn different languages, as a matter of fact, I can program in C and C++ very well too, but then again these aren't webdev languages.
I can write JS code, I can write C# scripts in Unity (RIP), I can read Java, Ruby, Kotlin, Python, Go, and Swift pretty well (though not really make stuff in it), and I'm even in the process of learning Go and Python, because these are seemingly the only 2 trendy languages that don't seem to go away anytime soon.
I patiently held back on these 2 until I concluded that they're not yet another meme languages that explode in poplarity for a year or 2, and then nobody cares anymore.
Though not a fan of Python for its dependency hell situation in which each random pacman -Syyu command can break an entire application due to a version mismatch of 1 out of the 38283948 dependencies.