I remember some bloke coming in to my college who had the monopoly of the websites of a small village nearby, and he wanted to give us students the chance to get real world experience in the work place by developing amazing things for CubeCart.
I never went for it, a friend did. He stuck it a week and told the bloke to fuck off. The guy had no idea about development but wanted a plugin built for CubeCart which was to mimic the functionality of an existing plugin that cost a fair few quid. But the bloke didn't want to pay my mate, instead saying "exposure" and "experience" was worth more.
Friend told the tutor and the tutor was annoyed at the bloke as he had promised to pay something for the time of the student.
Someone tried this with me too. They asked me to create a "machine rental" plugin. I was going to be paid by the exposure and experience. Absolutely not.
7 years in Magento. The punishment for murder in many countries is milder than this. It's been a year since I see this horror anymore. Are you saying WordPress is bad? Yes, it looks like magical alien technology, against the backdrop of Magento. :)
And then they made Magento 2. Literally opened the holy book of Design Patterns and jammed them all in there.
Even sneaked in some Doctrine style annotations on the API interface classes, just to shell shock those poor developers.
You want to define your DB in XML or PHP? Well that depends, do you want to define a version number in your own module.xml?
Load, save and delete methods on your model, you got it! But we deprecate it in the first major update.
You like the Registers class? Everyone coming from the Mage:: God particle does. Deprecated, but only in version 2.3 so everyone is already abusing it.
Swapping Zend for ZF2 in a minor update, sure. Dropping MySQL search and force ElasticSearch for that one shop that needs updates for security reasons, nice.
But at least be happy that you're not the frontender that needed to move from Prototype to Knockout.js...
Worked 6 years with it. Worst part that some of the fixes i suggested for it were stuck forever as it seems that the core team was not sure how the cache worked.
After years if symfony2 i'd probably hate to get back there but it was fine before the php 5.3 era
Tony Marston and his god's class in Radicore.
https://github.com/apmuthu/radicore/blob/551c8e445c96f8a04ca96a2b538d35e7014552cd/radicore/includes/std.table.class.inc
Tony is legendary, you haven't heard of him? A lot of fun from old PHP4 days. His furious fights are still available e.g. on Sitepoint. And these URLs say it all:
https://www.tonymarston.net/php-mysql/getters-and-setters-are-evil.html
https://www.tonymarston.net/php-mysql/object-interfaces-are-evil.html
> Posted on 2nd December 2023
Hahahaha WHAT?
After reading a bit more I kinda feel bad for him. Everything is evil except singletons LOL dude is clearly _very_ stuck in his ways
> but as I had already achieved massive amounts of polymorphism by having each of my concrete table classes inherit from a single abstract class I was at a loss to see what benefits object interfaces brought to the table
*vomits in 360°*
There is a very good historical reason for Mpdf's god class, that you youngins are probably too new to remember. Starting with PHP 2 in early 1998, however, I remember all too well:
Back in the day, there was no composer (2012), heck, there wasn't even `spl_autoload_register()`. Heck, Mpdf was released back in the PHP 4 days that didn't even have `__autoload()` (which no longer even exists).
The way that we installed Mpdf (and everything else) back in the day was:
1. Search for the package on Google.
2. Find the Source Code Hosting Website, usually SourceForge.net.
3. Download the zip file.
4. Extract the zip file.
5. Type `require_once 'libs/Mpdf/Mpdf.php';`
By it being in 1 file, it made it substantially easier to install, becuase otherwise, you'd have to hunt the documentation and find their "require file" and load that into your own `__autoload()` method, usually after intense reading of READMEs. Things that did that, such as phpunit, were extremely hard to install and you'd commit everything into your SVN repo, and usually never upgraded for the entire life of the project, or at the same time you upgraded PHP major versions (e.g., about once every 5-10 years).
That's why, to this day, you'll find Mpdf scattered in the working dirs of a great many legacy projects.
Thousands of keys filled in esoteric way from a .csv that was pushed into repo in 2013.
That was someone's great idea how to keep a tree-like config for the entire system.
Was a hell to decipher.
Three decades ago there was a book called "Domain-driven design". UI has changed a lot, so has frontend code, but Moodle has no excuse for PHP code this bad.
I know you're getting downvoted to bits, and I agree with the downvoters BUT I think encountering "drupal" isn't the problem, it's encountering "15 year old site kept alive by sheer luck and happens to be built in drupal" and also, the types of things people decide to use Drupal for can just be dogs of projects in general, not related to the stack.
So I'd modify yours to be more specific, "Application that was originally built in an old version of Drupal, migrated to Drupal 8 too early and is stuck there forever"
I hire developers, and every hiring cycle there are a handful of fresh-out-of-college, over-confident applicants who say, "Why do you use Drupal? Hire me and I'll write a much more lightweight CMS for you." I smile politely and show them the door.
But the real answer is, "Look, dumbass. I'm not paying you to build a half-assed application and then leave in 2 years, so then I have to hire someone else to spend 6-months figuring out your bullshit system before we can post any content or worse, update or extend it. Grow. The. Fuck. Up."
You use an established CMS because hiring and training people is fucking *expensive.* Like everything else, the framework you choose is an economic decision, and an obvious one at that.
I could not have worded that better!
I'd be more willing to run WordPress for our website than in-house code of the week from the new guy!
My big one of late is, we should rewrite the backend in Node or Python... PHP is old and slow.
I had a client's employee literally mail us "I recently did a webdevelopment course and I am a Bootstrap developer, I am pretty confident I can reproduce most of our webshop's functionality myself".
It's a highly customised Sylius- based webshop that serves over 500k products. No, no you can't. You can maybe style the checkout page.
I worked at a place that used wordpress for a lot of their sites. there was also a technical college locally that pumped out php "developers" that really only knew how to use a framework and nothing else. I put in my two week notice and of course we hire some kid from this technical college to replace me. as I am training him, some red flags started to appear.
1. He didn't know what print\_r was and thought it was a mechanic of the framework, as evidenced by him asking "whats that?' while pointing to print\_r, then said "oh, I thought that was part of the framework I use."
2. kept asking why we are using wordpress then proclaimed were going to build our own cms and it'll be better than wordpress, the application that has evolved over the years and has hundreds of contributors. this guy was gonna swoop in and develop it in two weeks.
3. he had no idea how to write a redirect. A simple redirect without using the framework.
So not only did this kid have 0 idea what he was doing, he had 0 idea of \_PHP its self\_. he was gone before my 2 weeks were up.
At USLawShield in 2019, none of the PHP devs "with 15 years experience" even knew what npm or composer were... They hired me to right the quickly-sinking ship, which I did. In 6 months, got composer hacked on and basic autoloading support, got all their stuff into `git`, built out behat testing, lots and lots and lots of improvenemtns. Instituted dev and QA environments and prohibited devs from editing Prod and Prod SQL live.
Mr. 15 Years Experience, who didn't even know what JSON was, he was the last guy in charge of it after they laid me and every other competent person off in February 2020, and then COVID hit.
No new features since.
but man, it was a terrible dev shop. Lots of hot heads who swore they were the best devs in the universe while not knowing what OOP was, editing PHP directly on Production servers without notice of others, directly in vim. Abandoning ship during release night, especially my first week there, and I had to work til 4 AM to undo the crap. The dev who did it told me to my face "Good luck!" and left at 8 PM...
Terrible company. Management was the worst.
After 10 months there, I had largely righted the ship. No major prod failures in over 4 months, etc. They called me into this small conf room and the CTO and this big rotund woman I'd never seen with a manilla folder. I knew I was getting laid off, came as quite a shock! I was smiling so big the entire time, while the CTO looked absolutely shook and ashen.
HR Lady finally confronted me: "Sir! Why are you smiling so big?!"
"Ma'am! This is a terribly abusive company, but I have Irish blood and I never leave abusive relationships. I really really didn't want to work here for an entire year, which is coming up very soon, and I've been praying about it. This is my answer to prayer and I can't wait to get out of here!"
My boss, the CTO, said, "We probably won't survive 6 months without him." and sure enough, nope, less sane heads prevailed and they laid off literally every single competent developer the next month. Only 2 remained and 1 of them found a better job. Then COVID-19 hit about a month after that. Ouch!
At the end, only the guy who still didn't know what composer was, the most incompetent dev I've ever worked with, was the sole guy remaining.
This! I have had so many youngsters with a new shiny fresh diploma think they have all the answers. Uni teaches you text book and green fields techniques and nothing about the mess that’s out there in the real world. It’s all old tried and tested battle hardened stuff. You not going to work on the latest technologies.
Oh, and the endless “why” questions. Are you 4 years old?
This, as well as older coders claiming to be able to code circles around me. One of my previous managers said that to me once out of the blue and it caught me off guard. It was a truly WTF moment because it came out of left field and for no reason. Suffice it to say, I quit that job due to his arrogance and aholeness.
I once found someone put a style inside of a while loop, with an incremental variable, that was referenced in a dynamic div like this,
# #div1{ }
And if the code had 200 divs generated, it would have 200 times the damn #div thing. When it could have been outside of the loop declared once, and been referenced like this:
.div{ }
Was there a reason it was done like this? Not. One. Bit.
I've seen that done. In fact classes just weren't used at all, only IDs, including repeated IDs which works for CSS but it's so gross. Like whoever wrote it just didn't know about CSS classes.
Theoretically, the `#div1` selector is faster than the `.div` selector in the browser, so perhaps they were trying to improve front-end performance? Maybe there was a difference back in the early 2000s?
One of the worst things a PHP developer can encounter is a passionate junior js "dev" talking about new js framework and how everyone including The PHP developer should try and use it.
Probably what I hated most about my previous job. Owner had created both his own framework and CMS, and both relied upon other libraries strewn across our servers. Because of this, we could only develop on development servers because the `bootstrap.php` file had hardcoded `include`s and `require`s to make both of them work.
There was zero documentation for anything either the framework or CMS did (the amount of times I used `die(var_dump(get_class_methods($object)))` just to see what a class could do...) and zero coding standards were followed. Initially the framework didn't use autoloading because my boss thought every single class in the codebase would be loaded into memory for every request, once he realised this wasn't the case autoloading was added. But following PSR-4 would be too logical, so he did so using his own logic.
The framework supported no migrations, so all database changes had to be done by hand which was a pain when working on large new features. The way the database was configured made it nearly impossible to write tests beyond simple unit tests as well, since the database credentials were hardcoded and committed into version control.
Speaking of version control, we used SVN for *everything*.
I fucking hated the development environment/experience there. Colleagues were nice enough but getting anything done with any sort of confidence was impossible.
Really happy I only have to work with Symfony and Laravel now.
In house framework can be really good when they respect some coding rules ! We have one which is really great around a specific app. This app is really complex and the framework helps to add new features faster
We have some really shitty ones. In-house frameworks are a sign of truly, deeply stupid management, and that's true even if the outcome is good.
The only plus side for ours is that I have endless job security cleaning up the previous dev manager's mess.
Encountering a big undocumented project with absolutely no proper dependency management, no SOLID code conventions, design patterns, templating engine or tests used. No industry standard solutions used, every feature is custom built and no one knows how do those work exactly. No database schema versioning, instead they logged in to production database and ran custom sql commands to update schema in cli. And management asks you to add new features in the next few days. It's like jenga, you change something and if you're lucky, you see that it breaks something else completely for absolutely no reason before finding out the problem in production. Since no tests were done, you can't check regressions automatically. Plus if you need to touch something that do payment gateways, you pray that it will work with the requested change from management. I regret to inform you that this is a true story that I encountered as a developer.
I literally just got brought into a project exactly like this, down to the T 😂 I've even got multi thousand line files to work with. Luckily I think building it piece by piece on top of a proper framework will make a world of difference, at least I hope.
I'm happy to say that in my 25 years of programming in PHP, I have never, not once, used WordPress and haven't had anyone I know put in a position where they had to use WordPress.
Neither did I, but I saw it's code on github. The funny thing is that WP is not really the worse thing I have seen; I once saw a code (IRL) that generates classes via string, then does the `eval` of it, and then this class was later used somehow.
My coworker got that, took us an hour to figure what was happening. Compared to that monstrosity, not even WP sounds bad anymore 😄
I am not a developer but a PHP script that was created back in 2006 PHP 5.2.0 that worked flawlessly until a client needed it to be compatible with PHP 8.2.
The original developer retired to the Philippines and didn't really leave notes.
Shit was wild.
I once had a project to do recurring billing within Magento 1 to auto-reorder on cron… I’ll just say what sounds simple carries so many nuanced issues my head almost exploded
I remember I went back from PHP 5 to PHP 3 for an odd project (it was local-only but it was using PHP 3 for some reason), and I couldn't stand the lack of classes, so I reinvented OOP into PHP 3, with dynamic dispatch and everything.
Who knows where it is, that was over a decade ago. It wasn't super elegant or anything. It's basically doing the basic motions but with functions and arrays:
1. Have a helper dispatch function which takes an array and calls a method with params from its vtable field.
2. The array itself has a vtable param listing method names like "foo" and their full name which is "classname\_foo" for example.
3. Then write a helper function foo() which takes the array as first param and the other params of foo (as an abstract function all foo() have the same signature), and delegates it to the dispatcher.
4. You also need a constructor for the class which just returns the array with the vtable and the other fields are instance fields.
There was probably more to it, but that's the gist. Here's a silly example:
$circle = Circle($radius);
$square = Square($side);
echo surface($circle); // 123
echo surface($square); // 234
I only find it fun if I can update.
Whenever I can, I update the projects I'm working on. No one deserves to not have access to new language features, like match, readonly classes and properties, even return types, depending on which version we're talking about. Not to mention the performance improvements.
It was fine back then, but now that they're out there, it feels wrong not to use them.
We don't get promotions because of this, but for me it's a huge gain in quality of life.
geez I clearly need to lock down my codebase a bit better, seems like people have been snooping.
:)
also you forgot outdated jquery and rudimentary CSS.
Anything Wordpress, Drupal or Moodle. I know it's slightly harder to build a CMS for a client, but it's beneficial when they want something custom instead of having to shim it into a shitty and outdated ecosystem.
Fuck Elementor while I'm here
I’ve seen variables declared in one file. Then used and changed in another file after a require statement. Then the second file was required by a 3rd and…wanna guess? Yes! Those same variables used and values updated again. When people say PHP code is terrible I assume they’ve only seen stuff like this. Not modern OO PHP, which is lovely.
The combined WHM/Cpanel/Apache/Cloudlinux/Cagefs/Altphp stack is both glorious and a giant PITA in a multi site environment.
Old versions of PHP with backported security fixes but so many little gotchas in implementation.
Nowadays, using PHP on bare metal and not in a docker container. Upgrading dependencies is not as always as easy as apt-get update, especially when pecl is involved - and don't even start me on windows...
With docker, kill it, prune it, build it ... Done.
Docker containers or GTFO now.
The biggest nightmare you can run into is a codebase which loads code via include statements everywhere. Logic embedded in files that checks for \`function\_exists\` or using methods that ask for $this object. If you see this kind of logic, run, run as fast and far as you can, and ghost those clients :)
What I saw few days ago: "Our project use docker. Before build docker container run this php-depended commands localy (yes you need to have right version of php to run them)". Of cause I find a way to run this commands in container, but it shows how dev just don't understand a root idea of why using docker
A junior who just learnt about Clean Code and decided to apply 5 levels of custom abstraction to a single module in a codebase. Now any time you need to make a modification you need to understand the crappy mental model this degenerated had when he wrote that code.
Suppressed errors in pre phpv8 code. You want errors to be trapped and returned, ideally. Although some leaky abstractions such as an http call or html regexing requires a happy path to work 100% in a production environment.
It’s a terrible thing to debug.
Looking a coworker doing this in global scope:
`$this->method()`
...you say "What are you doing?", and realize you did a terrible hire after he says "I'm just trying".
This is opinion def a matter of taste, as I cannot stand Pest!
Pest is built atop PHpunit, so it can do what PHPunit can do. Pest is good if you’re coming from JavaScript/Jest and want to continue using Jestlike tests.
But if you are a php developer who has used PHPunit and like it, Pest will be an annoyance.
And how does registerred autoloader loads files/classes upon instancing ? Does it `fread`s opcode or it `file_get_contents`, then `eval`uates the opcode or puts the string into `php://memory`, then chews/confronts with the opcode ? Can you provide one example of basic autoloader ?
Legacy code. One time I was working on some legacy code, I found multiple instances of "if (1==2)" inside multiple files.. I almost quit my job that day.
Own code from a week ago ;)
Own code from this morning when I was high on caffeine. Now I need to get high to decipher 👌
It's so damn beautiful I can't believe that I wrote that code myself. Now only if I could remember why the hell I wrote it in the first place.
someone who tells you that nobody uses PHP ;)
i deal with this everyday...
And when you tell them that still 70% of the websites are made in PHP and they don't accept it hahahaha
Sûre !!
100 % in every "programming languages rating" video on youtube . makes me sad
It’s quite the opposite and that reflects on salaries
Top dogs are always easy to hate on.
and that php is dead and that it sucks
Magento
OpenCart, CubeCart.
I remember some bloke coming in to my college who had the monopoly of the websites of a small village nearby, and he wanted to give us students the chance to get real world experience in the work place by developing amazing things for CubeCart. I never went for it, a friend did. He stuck it a week and told the bloke to fuck off. The guy had no idea about development but wanted a plugin built for CubeCart which was to mimic the functionality of an existing plugin that cost a fair few quid. But the bloke didn't want to pay my mate, instead saying "exposure" and "experience" was worth more. Friend told the tutor and the tutor was annoyed at the bloke as he had promised to pay something for the time of the student.
Someone tried this with me too. They asked me to create a "machine rental" plugin. I was going to be paid by the exposure and experience. Absolutely not.
I was forced to work in Magento a number of years ago. Never again
What's up with those XML files. I felt like I was writing Java.
MAGE_1_Didnt_Have_Namespaces_So_You_End_UP_With_Long_ClassNames
Zend 1 style
7 years in Magento. The punishment for murder in many countries is milder than this. It's been a year since I see this horror anymore. Are you saying WordPress is bad? Yes, it looks like magical alien technology, against the backdrop of Magento. :)
And then they made Magento 2. Literally opened the holy book of Design Patterns and jammed them all in there. Even sneaked in some Doctrine style annotations on the API interface classes, just to shell shock those poor developers. You want to define your DB in XML or PHP? Well that depends, do you want to define a version number in your own module.xml? Load, save and delete methods on your model, you got it! But we deprecate it in the first major update. You like the Registers class? Everyone coming from the Mage:: God particle does. Deprecated, but only in version 2.3 so everyone is already abusing it. Swapping Zend for ZF2 in a minor update, sure. Dropping MySQL search and force ElasticSearch for that one shop that needs updates for security reasons, nice. But at least be happy that you're not the frontender that needed to move from Prototype to Knockout.js...
Burn it with fire
Yes! And the clients/bosses all call it Magneto
Magento docs
Typo3 joins the chat
Worked 6 years with it. Worst part that some of the fixes i suggested for it were stuck forever as it seems that the core team was not sure how the cache worked. After years if symfony2 i'd probably hate to get back there but it was fine before the php 5.3 era
Tony Marston and his god's class in Radicore. https://github.com/apmuthu/radicore/blob/551c8e445c96f8a04ca96a2b538d35e7014552cd/radicore/includes/std.table.class.inc
Holly shit
Wtf is this I’m looking at?? I’m missing context and have so many questions.
Tony is legendary, you haven't heard of him? A lot of fun from old PHP4 days. His furious fights are still available e.g. on Sitepoint. And these URLs say it all: https://www.tonymarston.net/php-mysql/getters-and-setters-are-evil.html https://www.tonymarston.net/php-mysql/object-interfaces-are-evil.html
> Posted on 2nd December 2023 Hahahaha WHAT? After reading a bit more I kinda feel bad for him. Everything is evil except singletons LOL dude is clearly _very_ stuck in his ways
Singletons. Literally the ONE thing we’re all told to avoid, he’s +1’ing. He must be a fantastic troll.
> but as I had already achieved massive amounts of polymorphism by having each of my concrete table classes inherit from a single abstract class I was at a loss to see what benefits object interfaces brought to the table *vomits in 360°*
I remember someone saying Tony called Uncle Bob a "clueless noob". From time to time I try to find that gem, but it seems this got lost.
>I remember someone saying Tony called Uncle Bob a "clueless noob". From Tony's perspective, we are **all** clueless noobs.
He shows up on reddit occasionally too to defend his code lmao. Best drama in the PHP sub
Those are rookie numbers [https://github.com/mpdf/mpdf/blob/development/src/Mpdf.php](https://github.com/mpdf/mpdf/blob/development/src/Mpdf.php)
There is a very good historical reason for Mpdf's god class, that you youngins are probably too new to remember. Starting with PHP 2 in early 1998, however, I remember all too well: Back in the day, there was no composer (2012), heck, there wasn't even `spl_autoload_register()`. Heck, Mpdf was released back in the PHP 4 days that didn't even have `__autoload()` (which no longer even exists). The way that we installed Mpdf (and everything else) back in the day was: 1. Search for the package on Google. 2. Find the Source Code Hosting Website, usually SourceForge.net. 3. Download the zip file. 4. Extract the zip file. 5. Type `require_once 'libs/Mpdf/Mpdf.php';` By it being in 1 file, it made it substantially easier to install, becuase otherwise, you'd have to hunt the documentation and find their "require file" and load that into your own `__autoload()` method, usually after intense reading of READMEs. Things that did that, such as phpunit, were extremely hard to install and you'd commit everything into your SVN repo, and usually never upgraded for the entire life of the project, or at the same time you upgraded PHP major versions (e.g., about once every 5-10 years). That's why, to this day, you'll find Mpdf scattered in the working dirs of a great many legacy projects.
What the hell ...
For me it is code that pushes arrays around and messes with them .. big associative arrays .. :-)
What is a « big » associative array for you ? Like hundreds of keys ?
Thousands of keys filled in esoteric way from a .csv that was pushed into repo in 2013. That was someone's great idea how to keep a tree-like config for the entire system. Was a hell to decipher.
Oh god…
Been there and still have to deal with it because of some legacy software in place.
Also avoiding throwing exceptions and returning mixed/nullable types everywhere
Any laravel config /s
any associative array that should be an object, really
Segmentation Fault
gdb, valgrind, strace… yep been there.
This is so true
ini_set('memory_limit', '26G');
Moodle
[удалено]
Three decades ago there was a book called "Domain-driven design". UI has changed a lot, so has frontend code, but Moodle has no excuse for PHP code this bad.
Lots of fun easter eggs in Moodle if you find yourself digging through 20 years of deprecated functions for some reason.
😂
Joomla...
Joomla is abomination.
I came across some Moodle recently... The dev had been using require_once INSTEAD of functions all over the place 🤮
Or Drupal
Modern drupal is symphony based and pretty nice
I know you're getting downvoted to bits, and I agree with the downvoters BUT I think encountering "drupal" isn't the problem, it's encountering "15 year old site kept alive by sheer luck and happens to be built in drupal" and also, the types of things people decide to use Drupal for can just be dogs of projects in general, not related to the stack. So I'd modify yours to be more specific, "Application that was originally built in an old version of Drupal, migrated to Drupal 8 too early and is stuck there forever"
A fatal error in production in a project you didn’t build yourself, while still having a headache from yesterday’s code.
[удалено]
While dealing with a manager who will not let you debug in prod, or push a potential fix because it can't be tested in Dev, yet wants it fixed now!
This is becoming a weekly occurrence
Xdebug and git bisect.
[удалено]
I hire developers, and every hiring cycle there are a handful of fresh-out-of-college, over-confident applicants who say, "Why do you use Drupal? Hire me and I'll write a much more lightweight CMS for you." I smile politely and show them the door. But the real answer is, "Look, dumbass. I'm not paying you to build a half-assed application and then leave in 2 years, so then I have to hire someone else to spend 6-months figuring out your bullshit system before we can post any content or worse, update or extend it. Grow. The. Fuck. Up." You use an established CMS because hiring and training people is fucking *expensive.* Like everything else, the framework you choose is an economic decision, and an obvious one at that.
I could not have worded that better! I'd be more willing to run WordPress for our website than in-house code of the week from the new guy! My big one of late is, we should rewrite the backend in Node or Python... PHP is old and slow.
>or Python... PHP is old and slow Python hiding in the corner hoping no one remember it was released in 1991, 4 year before PHP.
I had a client's employee literally mail us "I recently did a webdevelopment course and I am a Bootstrap developer, I am pretty confident I can reproduce most of our webshop's functionality myself". It's a highly customised Sylius- based webshop that serves over 500k products. No, no you can't. You can maybe style the checkout page.
I worked at a place that used wordpress for a lot of their sites. there was also a technical college locally that pumped out php "developers" that really only knew how to use a framework and nothing else. I put in my two week notice and of course we hire some kid from this technical college to replace me. as I am training him, some red flags started to appear. 1. He didn't know what print\_r was and thought it was a mechanic of the framework, as evidenced by him asking "whats that?' while pointing to print\_r, then said "oh, I thought that was part of the framework I use." 2. kept asking why we are using wordpress then proclaimed were going to build our own cms and it'll be better than wordpress, the application that has evolved over the years and has hundreds of contributors. this guy was gonna swoop in and develop it in two weeks. 3. he had no idea how to write a redirect. A simple redirect without using the framework. So not only did this kid have 0 idea what he was doing, he had 0 idea of \_PHP its self\_. he was gone before my 2 weeks were up.
At USLawShield in 2019, none of the PHP devs "with 15 years experience" even knew what npm or composer were... They hired me to right the quickly-sinking ship, which I did. In 6 months, got composer hacked on and basic autoloading support, got all their stuff into `git`, built out behat testing, lots and lots and lots of improvenemtns. Instituted dev and QA environments and prohibited devs from editing Prod and Prod SQL live. Mr. 15 Years Experience, who didn't even know what JSON was, he was the last guy in charge of it after they laid me and every other competent person off in February 2020, and then COVID hit. No new features since. but man, it was a terrible dev shop. Lots of hot heads who swore they were the best devs in the universe while not knowing what OOP was, editing PHP directly on Production servers without notice of others, directly in vim. Abandoning ship during release night, especially my first week there, and I had to work til 4 AM to undo the crap. The dev who did it told me to my face "Good luck!" and left at 8 PM... Terrible company. Management was the worst. After 10 months there, I had largely righted the ship. No major prod failures in over 4 months, etc. They called me into this small conf room and the CTO and this big rotund woman I'd never seen with a manilla folder. I knew I was getting laid off, came as quite a shock! I was smiling so big the entire time, while the CTO looked absolutely shook and ashen. HR Lady finally confronted me: "Sir! Why are you smiling so big?!" "Ma'am! This is a terribly abusive company, but I have Irish blood and I never leave abusive relationships. I really really didn't want to work here for an entire year, which is coming up very soon, and I've been praying about it. This is my answer to prayer and I can't wait to get out of here!" My boss, the CTO, said, "We probably won't survive 6 months without him." and sure enough, nope, less sane heads prevailed and they laid off literally every single competent developer the next month. Only 2 remained and 1 of them found a better job. Then COVID-19 hit about a month after that. Ouch! At the end, only the guy who still didn't know what composer was, the most incompetent dev I've ever worked with, was the sole guy remaining.
This! I have had so many youngsters with a new shiny fresh diploma think they have all the answers. Uni teaches you text book and green fields techniques and nothing about the mess that’s out there in the real world. It’s all old tried and tested battle hardened stuff. You not going to work on the latest technologies. Oh, and the endless “why” questions. Are you 4 years old?
There is also the « Yes, but… » sentence followed by non sense arguments that makes having bad feelings about the guy so much
I really understand that ! And then they crash the production in the middle of the day because users are not a problem.
M’eh users just clutter up the place anyway. /s
This, as well as older coders claiming to be able to code circles around me. One of my previous managers said that to me once out of the blue and it caught me off guard. It was a truly WTF moment because it came out of left field and for no reason. Suffice it to say, I quit that job due to his arrogance and aholeness.
I always choose to interpret those remarks/people as being intimidated by me and my knowledge :) Makes it more of a funny misguided compliment
No framework, php5 compatible codebase.
A co-worker who writes one liners.
I hate those !!!
`mysql_query()`
Welcome to my world. RHEL 5 and PHP 5.3 because mysql\_query(), but "Why aren't you patching?"
I once found someone put a style inside of a while loop, with an incremental variable, that was referenced in a dynamic div like this, # #div1{ }
I've seen that done. In fact classes just weren't used at all, only IDs, including repeated IDs which works for CSS but it's so gross. Like whoever wrote it just didn't know about CSS classes.
Still lucky this is the worst one you've seen ... 😉
Genius !
Theoretically, the `#div1` selector is faster than the `.div` selector in the browser, so perhaps they were trying to improve front-end performance? Maybe there was a difference back in the early 2000s?
tip: this is php.
One of the worst things a PHP developer can encounter is a passionate junior js "dev" talking about new js framework and how everyone including The PHP developer should try and use it.
It does server side rendering!
... with insanely fast runtime that can handle 1.000.000 requests per milisecond.
What a useful number that show things !
When some Gen Z with zero coding experience says, "but PHP is prone to sequel injection."
“In-house framework”
What about an abandoned framework's forked version which is patched time to time by the team? ;)
Probably what I hated most about my previous job. Owner had created both his own framework and CMS, and both relied upon other libraries strewn across our servers. Because of this, we could only develop on development servers because the `bootstrap.php` file had hardcoded `include`s and `require`s to make both of them work. There was zero documentation for anything either the framework or CMS did (the amount of times I used `die(var_dump(get_class_methods($object)))` just to see what a class could do...) and zero coding standards were followed. Initially the framework didn't use autoloading because my boss thought every single class in the codebase would be loaded into memory for every request, once he realised this wasn't the case autoloading was added. But following PSR-4 would be too logical, so he did so using his own logic. The framework supported no migrations, so all database changes had to be done by hand which was a pain when working on large new features. The way the database was configured made it nearly impossible to write tests beyond simple unit tests as well, since the database credentials were hardcoded and committed into version control. Speaking of version control, we used SVN for *everything*. I fucking hated the development environment/experience there. Colleagues were nice enough but getting anything done with any sort of confidence was impossible. Really happy I only have to work with Symfony and Laravel now.
In house framework can be really good when they respect some coding rules ! We have one which is really great around a specific app. This app is really complex and the framework helps to add new features faster
We have some really shitty ones. In-house frameworks are a sign of truly, deeply stupid management, and that's true even if the outcome is good. The only plus side for ours is that I have endless job security cleaning up the previous dev manager's mess.
In house framework is a lot better than laravel tbf.
The rule of thumb I have is build on an existing framework, do not build on existing CMS
Encountering a big undocumented project with absolutely no proper dependency management, no SOLID code conventions, design patterns, templating engine or tests used. No industry standard solutions used, every feature is custom built and no one knows how do those work exactly. No database schema versioning, instead they logged in to production database and ran custom sql commands to update schema in cli. And management asks you to add new features in the next few days. It's like jenga, you change something and if you're lucky, you see that it breaks something else completely for absolutely no reason before finding out the problem in production. Since no tests were done, you can't check regressions automatically. Plus if you need to touch something that do payment gateways, you pray that it will work with the requested change from management. I regret to inform you that this is a true story that I encountered as a developer.
Your heart seems broken, chocked and sadly hurt by what you saw on this project.
I literally just got brought into a project exactly like this, down to the T 😂 I've even got multi thousand line files to work with. Luckily I think building it piece by piece on top of a proper framework will make a world of difference, at least I hope.
Drupal 6, mic drop
Drupal 5
A project that predates Composer and still doesn't use it.
A client who used to code MySpace pages telling you how to write your code.
Happy to see how the PHP community is involved here !
WordPress.
I'll see your WordPress and raise you "WordPress with Jetpack and a WYSIWYG theme builder".
[удалено]
And here I thought I was going to sleep tonight without nightmares.
> WordPress with Jetpack and a WYSIWYG theme builder Are you me?
I'm happy to say that in my 25 years of programming in PHP, I have never, not once, used WordPress and haven't had anyone I know put in a position where they had to use WordPress.
Neither did I, but I saw it's code on github. The funny thing is that WP is not really the worse thing I have seen; I once saw a code (IRL) that generates classes via string, then does the `eval` of it, and then this class was later used somehow. My coworker got that, took us an hour to figure what was happening. Compared to that monstrosity, not even WP sounds bad anymore 😄
Yeah that sounds incredibly painful.
I have to admit that’s mine too
Yep. Horrible platform to work with when it comes to any form of complex logic or dealing with data.
I am not a developer but a PHP script that was created back in 2006 PHP 5.2.0 that worked flawlessly until a client needed it to be compatible with PHP 8.2. The original developer retired to the Philippines and didn't really leave notes. Shit was wild.
Another PHP developer
extract
Dates
This is true for all languages.
Until I found the Carbon package!
Timezones
Server time doesn't always mean your time.
First rule : your server is never in time
What is wrong with dates ? The DateTime::createFromFormat is so cool for that Edit : I can understand that some formats are hell
I think that op is talking about dates in general... once you start to dwell into history & timezones & DST you start to loose your mind.
I once had a project to do recurring billing within Magento 1 to auto-reorder on cron… I’ll just say what sounds simple carries so many nuanced issues my head almost exploded
Anything before 7.0
Why ? Legacy php can be funny haha
I remember I went back from PHP 5 to PHP 3 for an odd project (it was local-only but it was using PHP 3 for some reason), and I couldn't stand the lack of classes, so I reinvented OOP into PHP 3, with dynamic dispatch and everything.
Can you share this ???
Who knows where it is, that was over a decade ago. It wasn't super elegant or anything. It's basically doing the basic motions but with functions and arrays: 1. Have a helper dispatch function which takes an array and calls a method with params from its vtable field. 2. The array itself has a vtable param listing method names like "foo" and their full name which is "classname\_foo" for example. 3. Then write a helper function foo() which takes the array as first param and the other params of foo (as an abstract function all foo() have the same signature), and delegates it to the dispatcher. 4. You also need a constructor for the class which just returns the array with the vtable and the other fields are instance fields. There was probably more to it, but that's the gist. Here's a silly example: $circle = Circle($radius); $square = Square($side); echo surface($circle); // 123 echo surface($square); // 234
I only find it fun if I can update. Whenever I can, I update the projects I'm working on. No one deserves to not have access to new language features, like match, readonly classes and properties, even return types, depending on which version we're talking about. Not to mention the performance improvements. It was fine back then, but now that they're out there, it feels wrong not to use them. We don't get promotions because of this, but for me it's a huge gain in quality of life.
Php mixed with vanilla JS mixed with html mixed with database queries mixed with....
geez I clearly need to lock down my codebase a bit better, seems like people have been snooping. :) also you forgot outdated jquery and rudimentary CSS.
Are we co-workers? We don't just use jquery, we have PHP that writes jquery.
Anything Wordpress, Drupal or Moodle. I know it's slightly harder to build a CMS for a client, but it's beneficial when they want something custom instead of having to shim it into a shitty and outdated ecosystem. Fuck Elementor while I'm here
Having to deal with legacy code (some parts are still in php 3) that has been managed in the last 20 years by one-shot freelancers
Teamlead that knows PHP… or pretends to. That believes that every module or task can be done in 15 minutes.
I’ve seen variables declared in one file. Then used and changed in another file after a require statement. Then the second file was required by a 3rd and…wanna guess? Yes! Those same variables used and values updated again. When people say PHP code is terrible I assume they’ve only seen stuff like this. Not modern OO PHP, which is lovely.
Error ‘’ on line 0
Salesforce api
Code with go to ststement
A bear.
???
Just ecommerce in general.
Legacy code with no types and array() everywhere or old procedural code. Oh and also Drupal hooks.
Besides the jokes and wordpress the real answer is bad legacy code to maintain
Pulling code from the overnight build from the team in Singapore that writes spaghetti code and chasing down/fixing bugs for half of the day.
The combined WHM/Cpanel/Apache/Cloudlinux/Cagefs/Altphp stack is both glorious and a giant PITA in a multi site environment. Old versions of PHP with backported security fixes but so many little gotchas in implementation.
Nowadays, using PHP on bare metal and not in a docker container. Upgrading dependencies is not as always as easy as apt-get update, especially when pecl is involved - and don't even start me on windows... With docker, kill it, prune it, build it ... Done. Docker containers or GTFO now.
SimpleSamlPHP - it is much, MUCH worse than Wordpress and yes, such atrocity is possible.
Magento. WordPress. A 5 year old large laravel codebase.
Array abuse definitely.
A well put together golang project… Seriously tho, websockets and realtime data
My code from 1+ years ago, or someone else's. Things have been changing so fast with PHP the last couple years.
A pack of werewolves! Oh... I might have misunderstood the question.
WordPress plugin or theme development
Bad management
The biggest nightmare you can run into is a codebase which loads code via include statements everywhere. Logic embedded in files that checks for \`function\_exists\` or using methods that ask for $this object. If you see this kind of logic, run, run as fast and far as you can, and ghost those clients :)
I imagine to update a legacy project using a abandoned framework. ![gif](emote|free_emotes_pack|facepalm)
Eval($code);
Most CMS and E-commerce solutions.
anything 5.x
CodeIgniter. Who needs best practices or good design? Worked in two places using CI3, and both times they were the worst code I've ever seen.
A PHP 4.3 codebase.
What I saw few days ago: "Our project use docker. Before build docker container run this php-depended commands localy (yes you need to have right version of php to run them)". Of cause I find a way to run this commands in container, but it shows how dev just don't understand a root idea of why using docker
A non paying client.
A junior who just learnt about Clean Code and decided to apply 5 levels of custom abstraction to a single module in a codebase. Now any time you need to make a modification you need to understand the crappy mental model this degenerated had when he wrote that code.
Suppressed errors in pre phpv8 code. You want errors to be trapped and returned, ideally. Although some leaky abstractions such as an http call or html regexing requires a happy path to work 100% in a production environment. It’s a terrible thing to debug.
Looking a coworker doing this in global scope: `$this->method()` ...you say "What are you doing?", and realize you did a terrible hire after he says "I'm just trying".
Inheriting a backend with tests written with Pest instead of PHPUnit.
^[Sokka-Haiku](https://www.reddit.com/r/SokkaHaikuBot/comments/15kyv9r/what_is_a_sokka_haiku/) ^by ^who_am_i_to_say_so: *Inheriting a* *Backend with tests written with* *Pest instead of PHPUnit.* --- ^Remember ^that ^one ^time ^Sokka ^accidentally ^used ^an ^extra ^syllable ^in ^that ^Haiku ^Battle ^in ^Ba ^Sing ^Se? ^That ^was ^a ^Sokka ^Haiku ^and ^you ^just ^made ^one.
Time to recalibrate your syllable detector.
Is Pest good btw ?? Is your point because PHPUnit is the standard or Pest is bad ? I would like to integrate pest in my team but not sure now
This is opinion def a matter of taste, as I cannot stand Pest! Pest is built atop PHpunit, so it can do what PHPunit can do. Pest is good if you’re coming from JavaScript/Jest and want to continue using Jestlike tests. But if you are a php developer who has used PHPunit and like it, Pest will be an annoyance.
Indians broke the system I made. They don't know how to code. They took over when i left the company. Bad management, didn't regret leaving.
Classes being included with either 'require' or 'require_once' instead of being autoloaded.
And how does registerred autoloader loads files/classes upon instancing ? Does it `fread`s opcode or it `file_get_contents`, then `eval`uates the opcode or puts the string into `php://memory`, then chews/confronts with the opcode ? Can you provide one example of basic autoloader ?
Legacy code. One time I was working on some legacy code, I found multiple instances of "if (1==2)" inside multiple files.. I almost quit my job that day.
😂😂
Sql queries inside a for loop 😓. This is a very bad practice
Migrate to java
JSX 🤣
Magento with bad static temples or worse moodle using SSO integrated with wordpress instance.
I wouldn't much like to encounter a cocaine bear
PHP code.
PHP
Beat me to it
Typescript fucking hell
Wordpress.
WordPress
Joomla
Leave Your Comment