The Life of a PHP Developer
jonkuperman.com
jonkuperman.com
critiques centered on the weaknesses of the language itself are missing the most important problem with PHP as a technology ecosystem. the technically rigorous, experienced, professional part of the PHP ecosystem is a minority and the signal:noise ratio is horrifically bad.
Do you know what happens if you put up an ad on a job board looking for PHP developers? You get flooded with hundreds of amateurs or lackluster freelancers (many of whom have no idea how far away from "good" they are) and a very small amount of responses from good developers.
Do you know what happens if you google search technical questions about how to do stuff in PHP? Flooded with blogposts and forum threads filled with actively harmful information instructing you on the wrong way to do things, without having any idea about why its wrong.
Other languages don't suffer from these problems to nearly the same degree. There are issues in the Python, Ruby, Javascript, Perl, Java, C#, etc. communities as well. Those problems are not nearly as intractable and damaging though. The communities of other languages have better signal:noise ratios and its really evident as soon as you try to do any hiring. It makes a difference.
edit Why the downvotes? Am I not contributing? Or is this just typical irrational PHP hate? I'm not apologizing for it, I'm just talking from experience here.
In case of many programming languages, there's certain culture built around them - with its own hierarchy of values, its own idiosyncrasies, approach and so on.
Like the tendency of overengineering and devotion to design patterns in Java world.
Now, the idea behind PHP is to "just get it working".
This philosophy is perfectly summed up by PHP's inventor, Lerdorf:
"I'm not a real programmer. I throw together things until it works then I move on. The real programmers will say 'Yeah it works but you're leaking memory everywhere. Perhaps we should fix that.' I’ll just restart Apache every 10 requests. "
Of course the qoute may be tongue-in-cheek, but I'd say the mindset is real.
(I've written software in C#, Java and PHP)
And PHP is very far from ugly initial creature of Lerdorf.
Anyway, IMHO the signal:noise ratio is MUCH better in Rails. Are there bad Rails people out there? Absolutely, but to the OP's point, there is a much large proportion of Rails developers who take their job seriously as a professional than those who do it for small freelancing gigs, for the lulz, etc. Furthermore, many of the issues that you have to teach traditional PHP developers, are "solved problems" by those in other languages/frameworks (Laravel/Symfony are good examples of where those problems are solved).
> Any respectable PHP developer nowadays uses a decent framework, and there are many. It's pretty easy to discern who's legit and who's not by whether or not they use/understand these frameworks.
This is exactly the OP's point. It's not that "any respectable PHP developer" doesn't exist, it's that weeding through all of the shitty ones to find them is much harder than people who specialize in other technologies.
"Resist complaining about being downmodded. It never does any good, and it makes boring reading."
Guidelines are important for online communities and sometimes worth explicitly reminding people of.
Personally, I think asking "why am I being downvoted" is better than just complaining, because sometimes it elicits a useful response. It would also be nice if the guidelines were more clear on whether downvotes should be used for disagreement or more like "this comment was made in bad faith".
"There are many" equals "almost all are bad".
The existence of different frameworks allows for a competitive environment where new ideas can be tested or old paradigms moved away from, and different programming styles or needs can be catered to. If you're working with a language community for which there is only one canonically accepted framework that someone decided was 'the best', well, you're just kind of stuck with that.
Granted, since pretty much anyone can hack together a basic framework in PHP (I have one that will never see the light of day) most of them are likely to be pretty bad. But it also stands to reason that most of the ones that get used aren't, because there are always alternatives.
Now it's nearly 10 years later and at some point I crossed over into being a professional. Now things like code quality and security matter. When I started out, it didn't.
Also on a side note nowadays search results almost always result in Stack Overflow answers - and while those aren't always quality answers either, they are far better than the random blog links you used to get.
Most recently I've been developing in Python with a light touch of Go on the side (for some of our more specialized services that require first class concurrency). The communities of both Python and Go are much more professional and helpful (to me anyway) on average than what I experienced from the PHP community. This is anecdotal of course, but I think a lot of other developers have had similar experiences.
I think PHP makes some developers frown because it represents an entry point for what they may consider the riffraff of developers. "Anyone can code now - if only a little!" <insert snobbish sniff here>
So developers chase off to increasingly intimidating technologies and languages not necessarily because they have SO much more to offer but because the culture represents a return to The Priesthood of days of yore.
A few centuries ago, "Don't know Latin? Get out!" and nowadays "Don't know Erlang? Get out!"
PHP is somewhat easier to deploy due to the elegance of mod_php and the Apache based LAMP stack. That's one of the things that has driven the proliferation of PHP. Mostly we're just dealing with history and inertia though. PHP offered a streamlined, relatively modern way to program web applications several years before good solutions became widely available in different languages.
PHP is almost like a framework in itself, with built in HTML templating, database integration, and HTTP libraries. The builtins in PHP absolutely suck compared to alternatives (including more sophisticated versions of these same things implemented in PHP in frameworks) but that's besides the point. Its possible to build stuff even with shitty tools.
The problem is that PHP has a large segment of its community that suffers from something that is almost like the inverse of elitism. Its a kind of willful ignorance or embrace of amateurism. A culture of mediocrity, basically. This is not a good thing for anyone. There are historical reasons behind it in PHP and they are vexing and difficult to overcome, but really they should be overcome, for the good of the future of the web.
When you treat learning some tech stack as a pinnacle of intellectual achievement, your sense of identity becomes involved and you get this kind of nonsense.
Most web developers are doing CRUD apps. It's a craft requiring technical skills, and I still enjoy it, but I can still see it for what it is.
It’s not 2004 anymore
His argument is that PHP is better now that is not 2004, but also, you could say the same about PHP usage on big popular sites.I'm tired of the argument of "every big site is written on php" cause it's not 2004 anymore and if those sites were to start today they'd probably be written on other languages.
He fails to mention that there is actually a fairly big amount of people that are horrible programmers and use, love, and preach PHP, they're not using Symfony, or reading Hacker News, or writing tests, still they're professional programmers.
PHP just has bad PR. It unfortunate, but its just the reality of the PHP ecosystem, and if you choose to program mainly in it, then its something that you have to accept and work hard to overcome.
Weirdly enough, I find quite a few startups/tech companies that I wouldn't expect to use PHP actually do. Pocket. Slack. for example then the usual suspects like Facebook and Automattic (wordpress guys). From my experience following Ruby on Rails from the beginning till now ... I think the these using PHP are doing the ecosystem a massive disservice by not blogging more extensively about the awesome things they're doing with it and getting more word out about the right way to do things. Thats the only way I see the perception of PHP changing.
(good article though ... I try to prefix my PHP rage stories these days with 'argh, argh, PHP3' so people realise I'm complaining about the past rather than the present)
Ultimately, what makes people hate a language is how it engineers structures at scale, and ones which don't force the hand, people hate. PHP has recently frowned apon writing massive codebases without frameworks, and when it is a framework, they expect people to take the time to document their frameworks to a point where the community can take over and improve that product. Writing lots of non-domain specific code is a sure-fire way to find haters all day long.
Almost all modern php now is very heavily leveraged in package management & commonly used frameworks & best practice software engineering principles in the underpinning glue to the code.
Even knowing that there are smart people at Facebook and Twitter using PHP, I just can't shake the connotations that those 3 letters have in my mind. I'll try to keep an open mind, but lord it ain't easy.
https://twitter.com/voodooKobra/status/494466665883910144
This is a fairly typical response (usually from C enthusiasts):
Me: "Hey, I'm working on some project. Anyone see any vulns?"
Person: "Yeah, I see a vuln: You're using PHP."
I don't like language arguments. While there's always value in contrasting language features and keeping your horizons ever-expanding, nothing productive comes from them. All it does is foster an environment that promotes Impostor Syndrome and insecurity. As others have said, they believe the people who engage in these "my language/framework is better than your language" diatribes are acting on their own insecurity. If they are correct, it's a vicious cycle that accomplishes nothing.Better idea: Accept that no language is perfect, and if there isn't a way to solve a specific problem (or the existing solution sucks), research and write a (better) solution. Even if it means sending patches to the PHP core (and having to deal with the toxic jerks on the mailing list). This is far more beneficial than arguing with people who don't want to listen.
As PHP accelerates towards its version 7 release and cleans up a lot of the cruft from the 4.x and early 5.x days, a lot of the criticisms of PHP will cease to be applicable.
"Those who can, do. Those who can't, complain."
EDIT: If you're going to downvote me, please at least tell me WHY you are.
Well, if you like PHP, how could you like language arguments? After all, they always end up destroying your beliefs.
You don't even know what my beliefs are.
I am a developer. I develop in multiple languages, using multiple frameworks, with different technologies, to fill different needs.
Why would I care which language I am using for a project? The syntax is different and so are the built-in tools, but in the end, you are doing the same things.
I don't like, say, C++ (let's http://cdn.meme.am/instances/500x/57005651.jpg for a sec...), so I'll stay away from it. This is one of the perks of being a software dev that the job market allows you to pick technologies that appeal to you, the ones you enjoy learning and using.
Unfortunately, PHP has failed in: (1) lack of leadership and the vision -- they need someone like DHH or Linus Torvalds or the support of a major corporation such as Google (HHVM from Facebook not withstanding) (2) PHP still suffers from the lack of respect from software engineers and developers, and faced the same fate of VB6 (which I've had fond memories of doing "casual programming"), (3) future of PHP looks grim, despite the upcoming release of PHP 7, with the exception of Hack and HHVM, but Hack is not PHP.
If all you've ever used was PHP and you haven't grown into using the other amazing tools that are available in 2015 (remember, "this isn't 2004"...) that's the bigger issue.
I'm not saying there are no PHP job offers, there are, but they are mostly for maintaining old codebases that have none of the good features that modern PHP has. Or they are for web agency jobs that consist of mass producing cookie cutter web sites.
I think Laravel 5 looks very interesting but I feel I can't afford to explore it because I need to learn Ruby if I want a better job.
Most of the modern day arguments are just bikeshedding arguments. (Function names are inconsistent, etc.) which is, yes, stupid that we've managed to maintain mistakes for decades - in the end it doesn't matter.
What matters is being able to get things done, and that's something PHP developers are fantastic at - even if some of them output the worst code imaginable.
I had a car, once, where the driver's side seatbelt would pop out if I put on the brake, or leaned forward.
But hey, what mattered was that the car got me from point A to point B, therefore it was a perfectly great car!
Thanks to luck more than anything; I used it to regularly commute between Austin and Dallas, a 300 mile drive.
The thing is, I didn't have to commute, and I was living in Austin at the time - and I worked from home. I could have elected to get around town via bus (slow, but doable) or bike (with a helmet, almost certainly safer than a seatbelt-less car).
I should have sold that damned thing much sooner and replaced it with a moped.
PHP is not well known for language-level security issues. It's well known for logic-level security issues.
Also, I suspect some people do not get it when we say "it is not 2004 anymore". It REALLY isn't. We see and write this kind of code on daily basis:
https://github.com/symfony/FrameworkBundle/blob/master/Comma...
We do not deal with nightmare cases like this anymore: https://github.com/2b3ez/FileManager4TinyMCE/blob/master/tin...
So, please do not pity us. We know what we use and why.
Even with the RFC process, php-internals still resists adding language features useful only to advanced developers.
The standard library is full of warts, including odd spelling, inconsistent argument order, etc.
The killer though, as mentioned in the article, it has a low barrier to entry, so lots of neophytes write lots of bad code in it. There's also a tremendous amount of horrid, obsolete code out there, written by people that didn't know any better at the time, and kept up because the internet never forgets.
PHP is far less of a joke than it used to be, but people will continue to hate on it and look down on people that make a living writing it.
PHP is not trendy, and there's pretty much no hype around any PHP project.
For my start up, I can't see a single reason why we'd use PHP, try to not think of it as me saying PHP is bad, it's just other languages and frameworks offer us more value.
So this also leads to using node.js (for early development and testing).
This isn't even getting into problems with the runtime itself. PHP's treatment of every new request by giving it a brand new instance to run in slows things down considerably, because it has to do so much startup work -- creating database connections, etc -- before it can get going. Personally, PHP's ugliness is a death from a thousand papercuts sort of situation. Yes, no one feature is a killer, but all the little quirks add up to a language that is less useful and productive after a while.
Nope. PHP has no problem with running jobs. Mixing code-bases for this kind of thing would be a bad idea.
> because PHP the language is so slow.
That is definitely true but you're still waiting more on IO than the language itself. So really, most people aren't use C extensions.
> PHP's treatment of every new request by giving it a brand new instance to run in slows things down considerably, because it has to do so much startup work -- creating database connections, etc -- before it can get going.
Database connections are pooled, of course. Byte code is cached. In my case, PHP doesn't even touch the disk when it loads -- all the compiled byte code is in RAM. Instances of PHP are pooled with Apache children as well. And, of course, you can run PHP just like you run Ruby and Python without about the same amount of configuration of the web server.
> Personally, PHP's ugliness is a death from a thousand papercuts sort of situation.
Most of PHP's ugliness is legacy stuff (badly named functions, etc) that are pretty much old news and hardly restricting.
If that doesn't convince someone that PHP isn't a pleasant language I don't think anything will.
(Its business value is another matter - that McDonald's is extremely successful doesn't mean their food is top quality...)