Java will kill your startup. PHP will save it
medium.com
medium.com
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.
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.
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.
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.
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.
They've also evolved a lot (new Java frameworks are quite decent, asp.net has also gotten a lot better from the aspx days)
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.
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?
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.
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.
The value of popularity for PHP comes from larger talent pools, better libraries, etc. WordPress doesn't contribute to those.
I'm not sure what the standard for "good software" is, but I hope what I'm building is not too far from it! =)
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.
PHP developers will solve the problem with an if statement and a value in the database.
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?
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.
PHP is "designed for the web?" What does that even mean in this context? They never really explain it beyond saying PHP is tightly coupled to your webserver (which is not objectively a pro, not even close). Knowing my early history of PHP, it was originally closer to "cobbled together to get something to work for the web."
There seems to be a weird, baked in idea that Java software is always bloated and PHP software cannot be. In other words, it's predicated on a language-agnostic idea, but it's applied directly to two languages.
After all that, I find this highlight particularly hypocritical, since the article never actually offers any real benefits to PHP beyond "it's popular" and "it's for the web":
> Letting someone sell you on a language (like Java) without having a full evaluation and discussions about architecture and design is like letting a home builder sell you on buying a house you’ve never seen because his contractors use only the latest and greatest hammer (or sledge hammer in the case of Java EE).
You then lose the popularity argument that comes with PHP but the rest of the article I think is still relevant.