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 - "php #facepalm"
-
I absolutely HATE "web developers" who call you in to fix their FooBar'd mess, yet can't stop themselves from dictating what you should and shouldn't do, especially when they have no idea what they're doing.
So I get called in to a job improving the performance of a Magento site (and let's just say I have no love for Magento for a number of reasons) because this "developer" enabled Redis and expected everything to be lightning fast. Maybe he thought "Redis" was the name of a magical sorcerer living in the server. A master conjurer capable of weaving mystical time-altering spells to inexplicably improve the performance. Who knows?
This guy claims he spent "months" trying to figure out why the website couldn't load faster than 7 seconds at best, and his employer is demanding a resolution so he stops losing conversions. I usually try to avoid Magento because of all the headaches that come with it, but I figured "sure, why not?" I mean, he built the website less than a year ago, so how bad can it really be? Well...let's see how fast you all can facepalm:
1.) The website was built brand new on Magento 1.9.2.4...what? I mean, if this were built a few years back, that would be a different story, but building a fresh Magento website in 2017 in 1.x? I asked him why he did that...his answer absolutely floored me: "because PHP 5.5 was the best choice at the time for speed and performance..." What?!
2.) The ONLY optimization done on the website was Redis cache being enabled. No merged CSS/JS, no use of a CDN, no image optimization, no gzip, no expires rules. Just Redis...
3.) Now to say the website was poorly coded was an understatement. This wasn't the worst coding I've seen, but it was far from acceptable. There was no organization whatsoever. Templates and skin assets are being called from across 12 different locations on the server, making tracking down and finding a snippet to fix downright annoying.
But not only that, the home page itself had 83 custom database queries to load the products on the page. He said this was so he could load products from several different categories and custom tables to show on the page. I asked him why he didn't just call a few join queries, and he had no idea what I was talking about.
4.) Almost every image on the website was a .PNG file, 2000x2000 px and lossless. The home page alone was 22MB just from images.
There were several other issues, but those 4 should be enough to paint a good picture. The client wanted this all done in a week for less than $500. We laughed. But we agreed on the price only because of a long relationship and because they have some referrals they got us in the door with. But we told them it would get done on our time, not theirs. So I copied the website to our server as a test bed and got to work.
After numerous hours of bug fixes, recoding queries, disabling Redis and opting for higher innodb cache (more on that later), image optimization, js/css/html combining, render-unblocking and minification, lazyloading images tweaking Magento to work with PHP7, installing OpCache and setting up basic htaccess optimizations, we smash the loading time down to 1.2 seconds total, and most of that time was for external JavaScript plugins deemed "necessary". Time to First Byte went from a staggering 2.2 seconds to about 45ms. Needless to say, we kicked its ass.
So I show their developer the changes and he's stunned. He says he'll tell the hosting provider create a new server set up to migrate the optimized site over and cut over to, because taking the live website down for maintenance for even an hour or two in the middle of the night is "unacceptable".
So trying to be cool about it, I tell him I'd be happy to configure the server to the exact specifications needed. He says "we can't do that". I look at him confused. "What do you mean we 'can't'?" He tells me that even though this is a dedicated server, the provider doesn't allow any access other than a jailed shell account and cPanel access. What?! This is a company averaging 3 million+ per year in revenue. Why don't they have an IT manager overseeing everything? Apparently for them, they're too cheap for that, so they went with a "managed dedicated server", "managed" apparently meaning "you only get to use it like a shared host".
So after countless phone calls arguing with the hosting provider, they agree to make our changes. Then the client's developer starts getting nasty out of nowhere. He says my optimizations are not acceptable because I'm not using Redis cache, and now the client is threatening to walk away without paying us.
So I guess the overall message from this rant is not so much about the situation, but the developer and countless others like him that are clueless, but try to speak from a position of authority.
If we as developers don't stop challenging each other in a measuring contest and learn to let go when we need help, we can get a lot more done and prevent losing clients. </rant>14 -
I've been writing PHP for more then 10 years. So, one fine day while having coffee with new tech manager...
Manager: huh, you've been programmer for very long time. Can you explain how echo works?
Me: err.. Echo. Spit out string. (show some example code on my phone)
Manager: I mean, I want to know, which part in C++ code in PHP engine. (trying to impress with jargons)
Me: I don't know. But why?
Manager: As programmer, you need to know, so you can echo more efficient.
Me: ... Errr... Ok... (I've been echo-ing for more then decade. Is there a way to make echo more efficient?)13 -
Me: *Runs composer install on workstation then reads manga on phone*
Terminal: DO NOT RUN COMPOSER AS ROOT/SUPER USER
Me: *glances at computer screen, sees the words run and super user. Ctrl + C. type in, sudo composer install*
5 mins later
Me: *facepalm*3 -
After 3 hours of struggle, I was able to setup multiple versions of PHP and configured easy switching on Apache on a fresh install of elementary OS.11
-
FUCK PHP!!!
We were trying to go live with a big online shop, it is connected through a crappy API to SAP.
PHP keeps outputting fucking errors because our intern doesn't fucking know how to properly write PHP.
YEAH, JUST FUCKING RETURN A WHOLE DIFFERENT TYPE OF DATA IF THE FUNCTION HAS AN ERROR.
Oh and using fucking strtr( ... ) to insert stuff in a string is REALLY FUCKING 1337...
And when you think the whole fuckery has reached the summit, just look at how HE FUCKING CREATED THE UGLY EMAIL TEMPLATE:
$content .= "UGLY HTML ABOMINATION";
$content .= "MORE UGLY HTML";
$content .= "HTML WITH SPELLING ERRORS";
$content .= "<table>";
$content .= "TEARS OF TIM BERNERS LEE";
$content .= "<table>HE FOGOT THE FUCKING '/'";
and dozens more of these lines...
and the whole piece for ALL 3 FUCKING LANGUAGES...
Thanks for writing the fucking backend stuff, it is better to rewrite the whole piece.19 -
Started writing PHP as a tag for a rant and the third suggested tag is "PHP #facepalm". What are people trying to say about PHP? 😝1
-
Meeting with an investor who brought two tech advisors.
Advisor A: you should consider using php.
Me: why?
Advisor B: node.js is older.
Me: :|
You can argue about advantages/disadvantages, but how the fuck can you argue with a fucking timeline?!4 -
I can’t even say what’s wrong with PHP, because— okay. Imagine you have uh, a toolbox. A set of tools. Looks okay, standard stuff in there.
You pull out a screwdriver, and you see it’s one of those weird tri-headed things. Okay, well, that’s not very useful to you, but you guess it comes in handy sometimes.
You pull out the hammer, but to your dismay, it has the claw part on both sides. Still serviceable though, I mean, you can hit nails with the middle of the head holding it sideways.
You pull out the pliers, but they don’t have those serrated surfaces; it’s flat and smooth. That’s less useful, but it still turns bolts well enough, so whatever.
And on you go. Everything in the box is kind of weird and quirky, but maybe not enough to make it completely worthless. And there’s no clear problem with the set as a whole; it still has all the tools.
Now imagine you meet millions of carpenters using this toolbox who tell you “well hey what’s the problem with these tools? They’re all I’ve ever used and they work fine!” And the carpenters show you the houses they’ve built, where every room is a pentagon and the roof is upside-down. And you knock on the front door and it just collapses inwards and they all yell at you for breaking their door.
That’s what’s wrong with PHP.8 -
Hr Interviewer: So I see you have worked for over 6 years, mostly with Php.. which one do you know? 5.4 or 7?
Me:
*facepalm*
"both"
*that should impress her*
Those are the people who suppose to find me a job? 😓 I'm screwed4 -
it kinda pisses me off that server side languages don't get the same credit as they used to since single page applications started and everyone asks what front end i use.
i be like dude i use php. then he says oh so you use jQuery for front end.
*facepalm*1 -
So, company I work at, is on desperate need of PHP developers, who can work in WordPress and Magneto. Company announced vacancy.
Only 20 CVs were dropped 4 days before from today. So company called all of them for interview and I was one of the interviewer. Most of applicants told me that they know Laravel but not WordPress.
I was like fine. Maybe they can work on WordPress too. But I was wrong. Here are some funny interviews:
Me: how many types of inheritance does PHP support?
Applicant 1: 7. Single, multiple, etc..
Me: Do you know difference between interface and abstract class?
Applicant 2: (he just said some gibberish)
Me: why do u prefer Laravel to WordPress?
Applicant 3: because by default Laravel support payment gateway, so we can create e commerce application faster. WordPress doesn't support payment gateway.
Me: how many WordPress site you have worked on?
Applicant 4: I have 4 themes in WordPress.org
Me: Do you create all of them by yourself?
Applicant 4: Yes
Me: Do u know difference between require and include?
Applicant 4: No
Me: Do u know difference between query_posts and WP_Query?
Applicant 4: No
Me: (facepalm)6 -
A gigantic codebase of several tens of millions of loc [prolly hundreds of mill's as we don't see all of it] in java EE.
Very complex business logic where bells have their own whistles with their own bells with .... You get it.
Very fine-tuned performance to make app so performant that the only bottleneck becomes the db. The beefiest rds instance becomes too laggy [orm, so sqls are immutable]
Client moves to rewrite the whole thing in PHP. Motivation: lower TTM
:facepalm:11 -
That feeling when you about to leave at work and ready for the long holiday, and suddenly there's a 🔥. You need to investigate and fix the issue. What a day!2
-
Fun issue
Swedish client is unable to enter a currency conversion rate in a field and submit. 'Not a float' well we can clearly see that it is a float when he does it (0.5 for example), not an issue for us though.
Reproducing was a nightmare, eventually it boiled down to the fact that the framework we were using had automatic locale checks. Now because our numeric fields are actually weird text fields (front end nonsense), it was converting the period to be a comma (Swedish people would write 0,5 normally). And if you actually entered 0,5 the range check (0.01-1000) failed because it couldn't parse the comma (no locale check on that one)
Godamn facepalm. Really confused the hell out of us when we saw the error, had to go diving through library code. To top this off, locale checks are supposed to be disabled as of about 2 years ago
In revenge against our oppressor :PHP: on slack is now an alias for the shit emoji5 -
I Remember what my senior told me once:
"You know you're in the wrong job when you see source code filled with comments written by ur senior dev scolding other devs for code fuckups" -
Came across this in a site work took on from another agency. Bad JS calculation of someone's age, there was many other terrible date manipulation parts throughout the site4
-
Aaaah ! So fuckin done with this Server error !
I am checking if a cookie is set in Php and if it is, I am redirecting user to some page, basically its a 'remember me' logic. But this fucking error comes in everytime my page redirects.
I have a similar logic to check if user is currently logged in the current session,and if he opens a new window and types the url(index.php) he is automatically logged in (obviously,duh !) and redirected,bt it dosent crash at that time!
Help 😥15 -
That feelings when you want to run a server-side script without server. Feels stupid for 30 sec, then I installed xampp. (Also first rant! )2
-
when u r hired as a django developer and told to learn php also in the first week. (gonna quit this job)4
-
Been working at a new job for two months and had a code review on the latest project.
My senior asked me why I had used interfaces because he dosent see the point in them and that they aren't useful. #facepalm3 -
I think I may have officially gotten myself fired before I even started a new job. My salaried start date was supposed to be Jan 3 but they hired me to do spot work at my hourly rate until then. My server side PHP skills were never great but they appear to be completely inadequate to the task of patching their undocumented, spaghetti legacy code. I just sent a note basically saying I either need to convert their entire site to something else 3 weeks ahead of the timeframe we planned or to basically outsource my work to another developer to patch this code. Feeling like a total imposter at the moment. I wouldn't hire me.4
-
Overheard PHP developer say: "I don't like Node.js, it should be more like PHP where everything is async."3
-
So PHP 7.2 according to its creator, is actually faster if you write bad code.
Well im not amused.5 -
SoundCloud Go+ Failed Big Time, So This Was Expected. Still Came As A Shock. Pentabytes Of Music, Just Vanishing?
Anyway, A Great Opportunity For Spotify To Completely Vaporize Their Only Competitor!13 -
A full stack php developer, PM me today who looks a lot bigger in age than me.
First of all, it was pain in ass and dick to understand what he was trying to ask for help. If cannot communicate in English, fucking use php ...Err hindi
All he was saying was, it's not working, and then added working. Inside my mind... "Is it even working or not"
At last I got, what he said. His nodejs application was running on terminal but not localhost. */ Facepalm..*/ 🤔🤔🤔Ass plam /* dickpalm1 -
Php suxx asss. I`m at my second php dev job and I recommend all newcomers to stay away. Both projects were full of shiat developed by people with no technical background before. The current project I work on is just a bunch of nested if else like 10-15 blocks and after you finish booom there s another block of ifs . The fucking code looks like a wave. There were also some files named like file1.. file15 . Fml4
-
php being php...
Complaining about "header already sent". I wonder why.
Solution: no permission to chmod the file system, thus printing an error to the output. That error provokes freezing the header, thus the header cannot be written anymore...
*cheers*2 -
This comment is why iis is an abomination for allowing multiple languages
/*Didn't know how to do this in php so wrote in asp just call it do do the task*/ -
When a CS student asks me (business IT student) how he can get kubernetes to work in PHP.
(No, I did not swap those two)
*facepalm* -
Have you ever rejected a job offer just because said company uses php. I did 3 in last two weeks.
p. s. I already have job, may that's why3 -
I'm browsing through my old 'learning projects'.
I realized that I didn't knew json and exploded the whole json string and had an array with 4 dimensions. -
wasting 4 hours trying to send a post request and fetching back the json reply, and having to fall back on fsocket when c url is not available is no fuck, the fuck with C api code in what's supposed to be web directed high level language that has no fucking native interface for REST actions
!rant -
Fucking Yeoman, guys.
For a school project I thought I'd try it out to scaffold out my folder structure etc. Ran a php generator (not having commits since 2013) through npm and sipped my coffee while one node deprecation warning after the other filled my terminal.
Now I just feel like I'm sitting with my dick in my hand while staring at what looks like the fucking source code of the Matrix itself.
Does anyone use Yeoman for PHP projects anymore?
Well, at least Grunt works flawlessly 😎 -
“Just a quick fix” Classic start to a reported ticket. Ticket states that a form field was not doing anything.
Think to myself ok this sounds like a nice easy one for the morning. A few hours later I find something like the following written by a senior member of the dev team.
SearchClass {
//...list of getter and setters
Private $snakeCaseName;
SearchFunction() {
Foreach($this as $property => $value){
//... if property keys = string for each object property then do code
If($property == “snakecaseProperty”){
//...do stuff
}
}
}
}
Why does this loop exist!!!!! All it does is remove any error checking if a getter method is misspelt...
To make matters worse the entire search method was over 300 lines building a MySQL query string.... even though there was an ORM and entity classes available!!!2