28 行
1.6 KiB
Markdown
28 行
1.6 KiB
Markdown
title: Stop fucking using dependencies!
|
|
author: 寮
|
|
date: 2022-03-29 12:37:44
|
|
tags:technology,webdev
|
|
----
|
|
I'm pretty tired of having to fix projects of customers that keep collapsing because their original developers decided to spam with dependencies for literally everything.
|
|
|
|
Even for something like the CURL library, which is part of PHP itself, I've seen multiple libraries being used in a single project (I ASSume it's because they tested one, didn't work and installed a different one, and never bothered to deleting the previous one ever again).
|
|
|
|
What I do in this case is I just copy/paste the CURL function from one of my own projects, delete all the CURL libraries, replace all the lines of code where CURL is used (read: takes me a couple of hours), and shit just works!
|
|
|
|
To see what I mean:
|
|
1. Go to https://packagist.org/explore/
|
|
2. Type "curl".
|
|
3. Notice how many libraries get pooped out.
|
|
|
|
Guys!\
|
|
All you need is this:\
|
|
https://www.php.net/manual/en/book.curl.php\
|
|
It's portable (works in PHP and all the bloatware/frameworks), and it fucking works!\
|
|
And if it doesn't, just install php-curl (on Debian: "sudo apt install php-curl"), and then it will work.
|
|
|
|
As a bonus, you'll start to actually understand your own code too.
|
|
|
|
What's worse is when they start using dependencies to fix a problem with a dependencies of a PHP framework, just because they don't know how to do it the right way.\
|
|
Or they use a dependency of 100s of MiB which literally only does "setcookie()" and "echo $_COOKIE" in the OOP way.\
|
|
Sure, let's just launch a ballistic missle with remote controls just to kill a mosquito, why the fuck not...
|