Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "phptsd"
-
[Certified CMS Of Doom™ moment]
Ah yes, the good old "generate a huge CSV just to know how many rows there are"14 -
Behold the PHP pyramid of doom!
You know what kind of code is coming... a big pile of shite! 😍
Obviously you have to return by reference (&) because of performance and memory reasons. ☝️🤓
Man... I've seen code...22 -
Ah yes, write your own fucking website crawler in PHP and deoptimize so hard that it uses some gigabytes of RAM and takes about 1 hour to crawl the very own website it's running on.
Oh and don't forget to download every single image and video file in order to "crawl" it for extremely valuable text content.
What a genius move! I'm really impressed.7 -
Oh boy, my riskiest coding decision was certainly that one time when I refactored some 50k lines of critical legacy shit code in 3 days, straight up merged everything into master and then deployed to prod.
Luckily there was only one minor bug I had to fix after that... phew...
(To my defense: I was solo-working on it - the infamous CMS Of Doom™)2 -
Do NOT "compress" your code by leaving out braces in control structures and putting the 300 char statement on the same fucking line as the control structure!
Yes, your code file becomes vertically shorter than the usual 3000 lines, BUT my brain tumor proportionally grows larger.7 -
You know a Repo is fucked when you have to rely on global text search to find and rename symbols like method or class names.4
-
[CMS of Doom™]
The gift that keeps on giving...
When you think you've seen it all after 7 months in legacy hell, you get another gift:
Let's say you use PHP, but your IQ is in the zero-ish range, then it is obvious to:
- use define() for constants in all your config.*.php files
- then include said config.*.php files multiple times
- and because define() doesn't overwrite the same constant, because it's - you know - a constant, you instead of including just do a file_get_contents() to read the PHP file as string and then parse the values by Regex.
The dev who wrote this was truly one of the devs ever.12 -
4 hours! four fucking hours! f.o.u.r. h.o.u.r.s.!
It's the amount in the time domain this bug has cost me to fix. The cost in the sanity domain is immeasurable...
I swear, the god damn ass births of devs who coded this abomination should be slowly mutilated and then raped by their own severed limbs.
It took me 4 hours to figure out that their 12 year old binary CLI tool they used to generate PDFs from PHP could not handle neither HTML5 nor some linebreaks at specific places. Some part of it is due to them using REGEX to find and replace HTML tag.
Yes, I am indeed very pissed. And I need a 🥃 or 3
What we learned:
- Don't use REGEX to "parse" HTML
- Don't call random compiled CLI tools from PHP if there are PHP packages to do the same shit9 -
Imagine saving Integers and Floats in a MySQL table as strings containing locale based thousand sepatators...
man... fickt das hart!
Wait, there's more!
Imagine storing a field containing list of object data as a CSV in a single table column instead of using JSON format or a separate DB table.... and later parsing it by splitting the CSV string on ";"...7 -
They actually did it...
Cheezus Crust, they actually "generated" 3 HTML selects to let a user chose a Date.
(nvm the line numbers, it ends at 3000)
They didn't even bother to generate the fucking arrays lol15 -
Date of doom... they forgot the double quotes...
(btw. $dateString is in the form "1234-10-11")
The fun part is that this comparison fails because $dateString is not numeric (due to "-") thus won't be (non-strictly) equal to 0 (int).
Damn fuucking amateurs... all hacks no skill.10 -
Oh boy... something just happened I'd have never expected.
Remember my rants about the PHP CMS Of Doom™?
Guess what... the boss of said company just called me to offer me a job as their new tech lead. WTF.
I'd rather slowly impale myself on a rusy pickaxe.
I'd rather tattoo my face with a giant, pulsating, uncircimcised shlong.
I'd rather take a swim in a pool of Hydrogen fluoride.
I'd rather work 80h/wk on pimple extraction.10 -
These fucking imbecile devs left me a bunch of bugs in a 150k LOC legacy hell...
Too bad it took some 8 months for them to finally surface in prod. God damned...
Technically, this whole codebase is one giant abyss filled to the brim with bugs.6 -
[CMS of Doom™]
Gotta love the fact that the fuckers who originally "coded" this abomination of a CMS implemented a method which replaces some text before sending the HTML to the client.
Guess what fucks with my code?6 -
If you ever feel incompetent or unsuccessful in life, I have to tell you one important thing:
The company which created the "CMS Of Doom"* has been existing for 21 years and is still going "strong".
*not actual name4 -
Damn, it's quite refreshing to work on some C#.NET microservices instead of the usual PHPTSD in the CMS Of Doom™...4
-
[CMS Of Doom™]
Imagine bringing every HTTP Query Param and every god damn fucking POST var into to current code context.
"extract()" is one of the reasons why I have terminal PHPTSD.10 -
Fuck this completely abysmal CMS!!!!
Not even god damn Einstein would be smart enough to understand this stinky pile of legacy code!
No, it's not enough to write an HTML template in PHP with less than 500 lines of code, noooooo, every god damn template HAS TO BE AT LEAST 3000 FUCKING LINES OF CODE WITH RANDOM INCLUDES EVERYWHERE!!!
Every fucking thing I fix spawns at least 2 new bugs! I FUCKING CAN'T!!!
I swear, if I meet these fucking worms of developers... someone will eat fresh turds mixed with puke from a highway toilet!17 -
How to log in to CMS Of Doom™...
What could go wrong?
MD5 password hashing? HTTP links? Extracting the whole $_POST array?8 -
"Biggest challenge you overcame as a dev?"
Overcame? I wish! I'm in the midde of fixing the worst legacy code clusterfuck I have ever seen...
Yes, it's even wayyyy worse than WorstPress...
There are days where my coworkers hear profuse laughter coming out of my lone bureau, some of them might already be thinking that I've gone mad. Maybe I have... bwahahahaha3 -
I got terminal white-space autism because of the CMS Of Doom.
Forgetting one or adding one too many leads to major problems on prod.4 -
[CMS Of Doom™]
Ah, yes, their built-in bullshit newsletter module just sent the n-th user n emails. Wonderful considering n=368.
The culprit? Better don't ask...
OK, anyway: So the mailer is running as a CRONjob, but nah, not as a console script call but by a public HTTP GET URL call, fucking obviously (it's the CMS Of Doom for a reason).
So these fucking imbeciles "implemented" an ob_start() callback where HTML links are - for whatever fucking reason - modified by some regex (obviously everybody knows parsing HTML by Regex is trivial). In this case the link was somehow modified to recall the mailer Cronjob...
This must have upset the pngoing mailing process thus spamming mails. Whyyyy
And I've thought I've seen it all after 6 months in this legacy hell...
This is why you don't run a company consisting of only beginners in PHP (in cluding their "CEO")! -
How do such people even breathe???
Does somebody here know whether comments of this kind can be generated by an IDE?
I have to assume they used PhpStorm due to some hints in some files.13 -
Fuck MS Word and every other WYSIWYG editor for text AND especially if said editor is a custom built abomination made of PHP and JS.4
-
[CMS of Doom™]
Imagine creating a CMS so bad that you let the owner (who I work for) define in a simple input field what email address is used as the sender address for the welcome email of newly registered users.
Basically they filled in a personal email of the company some 3 years ago AND of course the person with said email address left the company a few months later thus for some 2-3 years newly registered users received a welcome email with a sender address of an unavailable user.
And I thought I've seen it all in this CMS...3 -
You know the PHP legacy code base is complete garbage when it requires a script memory limit of 1.5GB.9
-
I think I have PHPTSD...
This absolutely abysmal custom PHP CMS I have to migrate is even worse than I expected. At this point it's easier to guess the table relationships in MySQL than trying to decypher the code which that other company's CEO and his slaves wrote.
I have to assume that he is an absolute genius, well above 180 IQ points, as I have zero chance of understanding his code within my limited lifetime...4