5 ms·
I spent about 10 years in a niche: maintaining legacy PHP software. I have been down some very deep rabbitholes of PHP black magic. I have written 10+ medium-to
by smt88 8y ago
I spent about 10 years in a niche: maintaining legacy PHP software. I have been down some very deep rabbitholes of PHP black magic. I have written 10+ medium-to-large applications from scratch in PHP, 4 of which are still running in production more than 8 years later.
I feel qualified to say the following:
- Java will not kill your startup. Bad coding MIGHT. But it also might not.
- PHP will not save your startup. Good coding MIGHT. But it also might not.
- You can write good/bad software in Java. I've seen both.
- You can write bad software in PHP. I've never seen good software in PHP (including my own). At this point, it's becoming hard to believe it is possible to write good software in PHP.
Mostly this is a problem with the awful design of the language. Adding better typing is helping, but at that point, why not just use something else?
Also, most arguments in favor of PHP mention its popularity. I suspect that if you removed WordPress, Drupal, etc. from the calculation, you'd see PHP plummet to the bottom. I don't know any young people who learn it anymore, and I haven't met a startup building their product in PHP in many years.
- beaconstudios 8y ago> I don't know any young people who learn it anymore, and I haven't met a startup building their product in PHP in many years. That's a poor metric for whether you should use it though, as both groups tend towards over-focusing on new "cool" tech stacks. I bet Vue would come up as the top framework amongst these groups but it is certainly not yet battle-tested.
- smt88 8y agoIt's not the only metric, but it matters. It has a huge effect on who you can hire and who wants to work for you. Smart people are often attracted to learning new stacks.
- scarface74 8y agoIt matters being on the other side for one of the reason the article cited -PHP programmers are more plentiful and cheaper than Java programmers. I worked for a company that had a legacy product that was written in PHP and started hiring like crazy over the next year to bring an adjacent product to market in .Net. But by year two, it was obvious that the new product was something that the market didn’t want but they were getting more opportunities on the legacy PHP side. Within 6 months after they abandoned the .Net product and started focusing on the PHP product, every single developer -14 in all left - starting with me. I called recruiters the same day that they announced they were focusing on PHP and left within a month. The only reason it took 6 months was that some were close to thier three year vesting period and one or two others were closing on a house. None of us were going to waste our time doing PHP. We knew there was no money in being a “PHP Developer”. Looking at LinkedIn, none of us mentioned that we ever touched PHP, we didn’t want recruiters wasting our time.
- mywittyname 8y ago> We knew there was no money in being a “PHP Developer”. The hate on PHP is real, but I think it's completely unjustified. I do a lot of work in PHP because is a great tool for anything web or Linux related. I can get code that works out the door quickly and it will happily run for years without issue. I think the biggest issue with PHP is that it made software development much more accessible. I've worked on a few projects over the years that were started by some domain expert with no experience in programming. They are able to cobble a workable product together by reading a few chapters of a web development book.
- scarface74 8y agoThe hate on PHP is real, but I think it's completely unjustified. I do a lot of work in PHP because is a great tool for anything web or Linux related. I can get code that works out the door quickly and it will happily run for years without issue. The issue is not "hating" on the technical merits of PHP. The issue is going where the money is. PHP developers don't make nearly as much as C#/Java/NodeJS developers.
- beaconstudios 8y agoas an ex-PHP and current React/Node developer, I think that's because the tech market is pretty irrational. I could get a lot more done in PHP than I can in Node, and laravel blade templates are much harder to get wrong than your average react app that didn't need to be an SPA in the first place.
- fgonzag 8y agoPython, Java, and C# are not new cool tech stacks yet they are still widely used in greenfield projects. They've also evolved a lot (new Java frameworks are quite decent, asp.net has also gotten a lot better from the aspx days)
- leesalminen 8y agoWe have a PHP app written in the past n < 10 years. We’re actually looking for a lead dev. Shoot me an email if interested!
- icc97 8y ago> I suspect that if you removed WordPress, Drupal, etc. from the calculation, you'd see PHP plummet to the bottom You can't just say "... if I ignore the ~30% of the internet that WordPress powers". But anyway, after that... Wikipedia, Laravel, Symphony, CakePHP. At the bottom of that pile... I built a CakePHP front end for a startup that after 8 years and was sold for $50m. Didn't require massive scaling, but the code had to be released on Windows servers in internet disconnected sites. The PHP code didn't require a single fix to production in the last 6 of the 8 years.
- vesak 8y ago> But anyway, after that... Wikipedia Granted. > Laravel, Symphony, CakePHP. These are frameworks. > I built a CakePHP front end for a startup that after 8 years and was sold for $50m. That startup was much more than just that front end, wasn't it?
- icc97 8y ago> That startup was much more than just that front end, wasn't it? It was what 99% of all customers saw, and it was practically bug free for 6 years. What else do you want? I built and maintained it primarily as a single developer. Yes there were other parts to the company, but both Slack and Facebook were started up purely on PHP - so there's no reason to suggest that you still can't build up $50m companies on purely PHP code. Anyway the discussion from the article is whether it would have been better to write it in Java. I can't see what benefit Java would bring.
- vesak 8y ago> so there's no reason to suggest that you still can't build up $50m companies on purely PHP code. Yeah, that I agree with. The success of a company and the quality of the programming language(s) it uses are almost never linked. >Anyway the discussion from the article is whether it would have been better to write it in Java. I can't see what benefit Java would bring. Quite true, yes.
- smt88 8y ago
- Meekro 8y agoI started my company, ArkServers.io[1], in late 2016 and built mostly in PHP. I'm familiar with Python and Ruby, and have done projects in both, but still strongly prefer PHP. I'm not sure what the standard for "good software" is, but I hope what I'm building is not too far from it! =) [1] https://indiehackers.com/businesses/arkservers-io https://indiehackers.com/businesses/arkservers-io
- smt88 8y agoI also prefer PHP over Python and Ruby, especially because it's a lot easier to find PHP devs. I have written mostly-maintainable, very stable PHP apps. It took a huge number of tests, static analysis, comments, phpDocs, and trial/error of different libraries. Since then, I've written back ends in C#, TypeScript, Go, and Rust. I have mixed feelings about all of those, but I'd never need as many tests. The languages allowed me to be stricter than PHP did/does. Type systems are also an amazing form of self-documentation.
- innagadadavida 8y agoJava developers like to solve the problem the “right way” while the PHP devs solve it “right now”. Latter works much better in early stage startups, but former is easier to maintain longer term.
- smt88 8y agoI agree with what you said except for the generalization that Java devs always (or usually) do things the right way. I have seen some Java software that was a massive spaghetti-and-meatballs mess before it even reached beta.
- mywittyname 8y agoJava developers design an abstract solution that will apply to all known instances of a particular problem, then provide an framework for outlining a custom solution via a well-defined XML schema. PHP developers will solve the problem with an if statement and a value in the database.
- throwaway0255 8y agoI won’t dispute that PHP is an objectively terribly-designed language and has many fundamental and unfixable flaws throughout its implementations and throughout the language itself. I’ll also agree that the popularity argument is completely facile (bots cloning old WP stacks to create SEO spam does not make you popular, that spam being responsive does not make you the biggest mobile app language, etc), the people making those arguments know it, and they continue to say these things anyway... But, why do you think it’s impossible to write good software in PHP? How long has it been since you’ve written something big with it? I would agree that it’s unlikely for a PHP project to result in good software, especially if it’s big and has had many contributors. But in 2018, PHP has typing, it has packagist and composer, its community has agreed on a standards org and is rapidly adopting those standards. The ecosystem offers tons of solid open source libs and frameworks. PHP has all the language constructs you need to organize your code and scale it to multiple devs (namespaces, encapsulation, etc). Facebook is still using PHP as it’s primary language (as hack, which is basically PHP7 with some differing notation). Laravel is directly competing with Rails and Django and is easily in the same league. So why can’t good (web-based) software be written in PHP in 2018?
- mywittyname 8y ago> I would agree that it’s unlikely for a PHP project to result in good software, especially if it’s big and has had many contributors. I disagree. I've contributed to several large open source PHP projects and never had any trouble figuring things out. It's surprising how quickly I can get comfortable with a massive, foreign PHP codebase. In fact, I think the structure of PHP makes designing certain systems, such as plugins, much more intuitive. It also helps that the PHP community is often united on tooling. Unlike the Java community, whose tooling seems to oscillate between verbose & power to simple & rudimentary and back again.