5 ms·
It's incredibly hard to find good PHP developers. I just inherited a PHP project that it's a nightmare. It doesn't make any sense. It works on PHP 7.3 but the
by Darmody 5y ago
It's incredibly hard to find good PHP developers.
I just inherited a PHP project that it's a nightmare. It doesn't make any sense. It works on PHP 7.3 but the quality is worse than the old PHP 4 stuff.
It is so easy to write good PHP code nowadays but most devs don't do it. They just go for the old ways, with spaghetti code, no clear architecture, etc, because it just works. They don't have to think, just type. Thats why people hate the language. They see the bad code and they think the language is poorly designed.
- hparadiz 5y agoThese days if you're not using PSR4 configured auto loading with all your code in the src or tests directory and a separate public folder then you're not really qualified to work on PHP at a professional level. I highly encourage using this template for all new projects https://github.com/thephpleague/skeleton https://github.com/thephpleague/skeleton
- Darmody 5y agoI just had my worst PHP dev experience in 5 years of coding. Literally. I just had to leave the office. I'm on my way home and still feel fatigued. The project not only doesn't use composer (well, it does now because I needed some components) but it has the same third party components duplicated or triplicated around the application. It looks like they downloaded them Everytime they needed them. Some of them are modified to make them work on newer versions of PHP. And the views and the logic are mixed together in big 4k lines files with no functions. Html, js, PHP, tens of SQL queries on loops, all mixed together. It's so bad it looks that it was made like this on purpose. The funny thing is a pretty important project for a pretty important and unique customer.
- tored 5y agoClassic. Absolutely fabulous when this happens. Just want to nuke everything to oblivion. But there is hope, sometimes it can be better to inherit badly written repetitive & copy-pasted code, rather than badly written abstractions. Badly written abstractions can be really hard to get out of years later because it tends to be viral all over the project, however when there are no abstractions at all, you can decide them right now, you are in charge. Bit by bit you can unwind this mess to something grander, to your own creation. Good luck. Praying the PHP prayer for you.
- Darmody 5y agoThere's no unwinding. Boss says it should be done like this just to finish tasks quickly. For the last couple weeks I've been thinking I should look for a new jobs as it looks there's no future here.
- hparadiz 5y agoI've actually fixed this sort of situation at multiple different companies. Typically I end up getting buy in from management once I have started cause it saves money in the long run. You start by setting up the standard router for all URLs when the php file doesn't exist. You then setup your router to answer somefile.php or whatever file you want. You then have that route execute your own class. You simply delete the original file and it now loads from your router. You can typically copy/paste the code from the file into a function in a class without any modifications. As you go you can get rid of includes / requires all over the place because now you've got auto loader configured so you can just call code from other files at will. So then I just repeat this process. Sometimes it takes years but I can typically make a huge dent in most systems in the first few months. If I don't get buy in I do it anyway for any code I'm asked to work on cause it makes the work better and there's no reason not to do it at that point. I actually kind of envy you. I enjoy refactoring projects like that. You can typically bring that 4k line file you mentioned down to just a few classes and views.
- lowercased 5y ago> It's incredibly hard to find good PHP developers. But... is it much easier to find good devs in any other tech stack? I don't see it, personally. My ruby friends complain it's hard to find ruby devs at all, and harder to find good ones. I do see a lot of JS/node folks that get accepted as 'good', but when the rubber hits the road, the code is often still... meh - cut corners, SO copy/paste, etc. I see bad node and bad js and bad python... but somehow the languages and stacks get a pass and "it was just a bad developer". But if you see bad PHP, people think "the whole language sucks". Completely inconsistent.
- Darmody 5y agoYou don't see as much bad python code as you see bad PHP code. PHP has no entry barrier. You can just start typing and things start working. Compare that with deploying a hello word website in python, java or elixir.
- lowercased 5y agoI don't see much python code period, in my day to day work, but what I do see often... doesn't seem demonstrably 'better' by any metrics than run of the mill code from any other stack. But it sometimes comes with some sense of smugness about being 'pythonic'. Standard Java I don't get that sense, but do from some Kotlin advocates I know (usually the ones that are new to programming in general who feel they've found some new magic bullet that will overturn all the bad PHP out there).
- deleted 5y ago[deleted]
- Zelphyr 5y agoYes, for all the warts of the language, the worst thing about PHP is the illegible code that gets written by someone who glued together a bunch of solutions they found on StackOverflow. The good news is, in my experience, most of those people have moved on to JavaScript. Note that I enjoy both PHP and JavaScript immensely. But, my God, some of the code that I've seen in both languages...