AboutFull Stack Software Engineer, Electrical Engineering Driven by OCD & Club Mate. Beautiful and maintainable code is what gives life its beauty.
Joined devRant on 4/25/2017
Do all the things like ++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatarSign Up
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple APILearn More
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 ";"...8
[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
[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.11
Gotta love it when you try out a different VS Code extension for a specific language and then on each autoformat, more and more spaces get inserted.
I keep myself motivated by reading about new technologies, language features and constantly trying to improve my code.
I see great reward in having fast and readable code.
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
One of my bad dev habits is that I tend to take up too much work because a lot of devs I had to work with seemed not competent enough. It's a bad habit because I get way overworked which influences code quality and deadlines.
I have to learn to trust more in others and give up some responsibility... it's hard though.
I think a big influence on my mindset has been that I never worked in a team bigger than 4 developers and I had way more experience in web dev than the others.
I sometimes may appear as an arrogant prick, but it's not intentional.9
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
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 dear, a scaling problem I solved was replacing some Regex matching with simpler string functions. While I'm a huge fan of Regex, it's unreal how much performance they can suck out of some high-n loops...
I got about 120x out of some critical code thus making a CPU upgrade unnecessary.8
[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 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
[Certified CMS Of Doom™ moment]
Ah yes, the good old "generate a huge CSV just to know how many rows there are"15
4 hours wasted due to a rather strange "scope poisoning" bug... it was really fucking strange.
Had to move the 5 lines of code, above where the error happened, to a private function.
The 5 lines just called an XLSX library which read a given file and returned an array. I don't know how but the thing somehow messed with my Soap client call one line below. The culprit must have been some IO resource handle which didn't get destroyed when in the same scope due to persisting object references..1
[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")!
What's your way of arranging open code files in your IDE's window?
I usually have 2-3 code files open side by side and keep the lines at a maximum of 80-120 characters.
Other devs I know mostly have only one file open in full width at any given time... which I can't wrap my head around.2
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.7
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.9
Seriously, fuck Discord's new community guidelines! They now think they even own you outside of ther shady app:
"We may consider relevant off-platform behavior when assessing for violations of specific Community Guidelines."
Addressing harmful off-plattform behavior:
"When we talk about off-platform behaviors, we’re referring to any behaviors taking place outside of Discord, either in other digital spaces or in a physical community. If we become aware of specific off-platform, high-harm behaviors with credible evidence committed by a person with a Discord account, we will take the off-platform harmful behavior into consideration when assessing whether that account has violated a specific Community Guideline."
"We are applying this off-platform behavior consideration only if we become aware of highest-harm threats, including using Discord for organizing, promoting, or supporting violent extremism; making threats of violence; and sexualizing children in any way."
Why does every fucking internet company think that they own their users?17
If some of you front-end devs haven't used CSS-Grid yet and are still annoyed by using nasty position and JS hacks to place stuff, I strongly recommend you to take 1-2 hours and read this incredibly useful guide for CSS-Grid:
and this one for Flex:
These two links have saved me PLENTY of hours struggling with all kinds of responsiveness and placement/sizing issues.1
"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
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