Hacker News new | past | comments | ask | show | jobs | submit login
The Life of a PHP Developer (jonkuperman.com)
73 points by growthape on Feb 6, 2015 | hide | past | favorite | 75 comments



this article didn't even address by far the biggest issue with PHP: there is a massive and divided community that is split between real professionals (the guys who build Facebook, for example) and total amateurs who don't know what they're doing.

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.


The signal:noise ratio is better in Javascript, Perl, and Java? I can't possibly agree with you there. There's a lot of bad PHP out there. But that's also because there's a lot of PHP out there. I wouldn't say the ratio is any worse. 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.

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.


But there's a culture thing, too.

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)


It's just your idea, it's not "idea behind PHP". Almost all of my PHP code is covered by tests, for example - it's far from "just works".

And PHP is very far from ugly initial creature of Lerdorf.


Answering in the same spirit: it's just your code... :)


so PHP culture is lean basically?


Amassing debt (either technical or financial) is not a part of any lean methodology.


so what is the concierge mvp if not specifically taking on debt to get something out there and validated?


You're getting down-voted because people probably disagree. (don't worry I threw you a bone...but for the future, pls don't ask why you're getting downvoted)

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.


The chutzpah of telling someone what not to ask.


It was merely a reminder of this portion of the site guidelines[0]:

"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".

[0]: https://news.ycombinator.com/newsguidelines.html


> Any respectable PHP developer nowadays uses a decent framework, and there are many.

"There are many" equals "almost all are bad".


Not necessarily, because there's no objective way to define 'bad' here.

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.


yeah, you're right that its pretty easy to discern who's legit. its just more work getting to them in the first place.


That I can certainly concur with. It's a sea of crap, for sure. In my mind, it makes the good ones all the more valuable.


It's a problem, but it's the very reason the language is as popular as it is. I started out as the total amateur copy and pasting terrible code to bring ideas that I had to life. I didn't care about code quality or security vulnerability. Having a broken app was, to me at that time, better than having no app at all.

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.


There was a time where computers was available only to "the priesthood of computing." You had to be in a special group in a very big company (or military research setting). Because no one else understood these so-called electronic-brains, few could question you for anything involving The Computer.

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!"


I disagree with you here. You're discussing a different issue. There is not that much more difficulty in learning computing with any other modern programming language. This isn't about snobbishness or elitism. Its just about the real practical problems that exist with PHP but do not exist (or do, but to a lesser extent) with other modern languages.

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.


While at a PHP conference last year, which is the first I'd ever been to, someone did a presentation on abstract machines. At the end, there was a long applause, with many people commenting that the presenter was a genius for understanding these advanced topics. I was dumbfounded since these are topics which even a minimal CS education would cover.


That divide exists in all programming languages - good devlopers can move from the clueless side to the profesionsal


yes, it does, but it is more pronounced and more problematic in PHP. the only other language I've ever developed in that had a similar problem was Java, mostly because there are many undergrad CS programs that teach primarily in Java so sifting through the clueless CompSci undergrads asking for homework help got kinda tedious.

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.


Honestly PHP could improve matters a lot by just removing the community comments on php.net.


They recently (within the past two years or so) added voting features and are actively removing harmful, obsolete, or otherwise unworthy comments.


Perhaps you would not have these problems if you accepted web development as a blue-collar trade that it is.

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.


Programming in general has a lot of corollary to blue collar work, in that it is where the actual work gets done after all the fussing about has been done. That this is somehow meant to be a negative thing or a slight on the intellect of programmers is telling about how misaligned the priorities of our society often are.


How do you figure that web development is blue-collar work? Even for hyperbole, this is quite a stretch. Whatever your intent was, it just comes off as elitist.


Web development involves a little creative effort and a great deal of repetitive, tedious work. While sedentary, it requires heavy physical exertion to sit still the whole day. It is usually a low-prestige, low-power role within an organization. It does not require much academic education. I would like to be elitist, but what drives me is despair.


Honestly I kind of agree with the sentiment - and I am a web developer.

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.


There is a lot of development that I think can be categorized this way. Someone learned a skill 5 or 10 or even 15 years ago, and goes to work everyday and essentially punches a clock. Having done ColdFusion for a large part of my career, I see this pattern in that community.


as opposed to the average GP (familiy doctor) or lawyer :-)


It does come off as elitist, and I think he could have communicated a great deal better. I agree that your identity shouldn't be wrapped up in some particular technology you use, but you also shouldn't have to prop up your identity by trying to insult others.


Construction is a popular programming metaphor.


And calling a lot of prefesional developers "blue collar" will get you a nasty look at best if not a whack upside the head.


  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.


I did PHP for many years before moving to Ruby and Rails and never looked back ... doing Ruby made me a much much better software Engineer and gave me a better understanding of Computer Science as a whole. Its not impossible to get this with PHP, but the fact is that the low barrier to entry actually works against it. There are way more amateurs screwing around and writing really bad code with PHP than you'd find doing Ruby, Python and (more recently) Javascript (wasn't always the case though)

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.


Hey all, author here. You all are amazing and took down my website! If it's not loading for you, I put the post in a gist which can be found here: https://gist.github.com/jkup/dcaa56f1d066409d17f5


Maybe you need to restart apache every 10 requests?

(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)


What I hate the most about all these arguments is people always say that php people don't know shit about computer science. C.S. is important, but it's not what makes you a good programmer. Ultimately all systems have theory behind the underpinning technologies, but what makes a system powerful is how it's engineered at scale, and how code is maintained at scale. A house is about making sure all materials to build it are strong enough via scientific measurements & standards. You don't need to be a rocket scientist to know that if you don't use proper materials, everything falls apart. That is why if you write in langauges like php, they improve the C.S. part from the community, but also build frameworks which are the Software Engineering Technics encoded in documentation.

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.


Hmm, OK, I'm guilty of having the biases and preconceptions that he's describing. However, even after reading through his post and some of the articles he linked to, I didn't see anything that really changed my mind.

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.


I don't think people at Twitter use PHP ... might be wrong on that though. From what I remember they started with Ruby/Rails and are now doing a lot of JVM stuff (Scala)


On Twitter, I'm repeatedly ridiculed for writing PHP.

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.


Cleans up a lot of the cruft, you say. Interesting. Would you mind taking a look at http://phpsadness.com/ and guesstimating how many of the first ten points remain relevant to PHP7?


It is... surprising.. that C programmers, of all people, would have the nerve to make fun of PHP.


"I don't like language arguments."

Well, if you like PHP, how could you like language arguments? After all, they always end up destroying your beliefs.


"After all, they always end up destroying your beliefs."

You don't even know what my beliefs are.


If you base your identity on the language of the day, you are going to have a bad time when things change.

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.


Well, "base your identity" that's an exaggeration of course, but I think it's a mark of an insightful professional to have opinions about various tools of his trade, and some sort of taste. Rather than being the "just punch your card and go home" guy.

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.


I like this viewpoint, but the problem is that it largely doesn't carry over into hiring where job postings are often for uber-specific skill sets, rather than for "somebody who can come and figure out how to do any of the stuff we do and all the stuff we'll eventually do but haven't thought of yet". It's just harder to hire for the latter, so putting "requires PHP / RoR / AngularJS / whatever" on the job posting is the easy road. There seem to be some indications that this trend is changing, so I'm cautiously optimistic.


"There are only two kinds of languages: the ones people complain about and the ones nobody uses" -- Bjarne Stroustrup


PHP had many positives: (1) killer apps like Wordpress and PHPmyadmin, (2) PHP apps are easy to install and run on most stock *nix system, and (3) bare-bone PHP runs fast, compared to Rails or other framework (which is not a fair comparison, though)

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.


I think you are wrong in stating php future looks grim, I think it all depends on what corner of the internet you are reading from. From where I am, I read reddit.com all the time, it's talked about extensively all day long. A language which gains no new features is one which is dead. I think python more than anything else is sort of dying.


If validation is the problem, then remember that most developers aren't on HN, and they aren't building startup apps. Also, I can't imagine a developer only knowing the one languages. Leverage other "cool" projects if you feel you really need some geek cred (Javascript MVC, CSS pre-processor like SASS or LESS, automate your builds using Chef, optimize developer experience using Vagrant, implement search using ElasticSearch, etc)

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.


We use mostly PHP at work but lately I have been using my free time to learning Ruby because most good job offers around here ask for Rails knowledge.

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.


He's right though - most of the arguments about what PHP is lacking are outdated and obsolete by the massive community undertaking.

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.


> 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!


Perhaps apply for a job as a PHP developer. Pay is good, and so you probably will be able to get a new car :)


You joke, but I was working as a PHP developer at the time. :)


That's something that's not talked about often enough. Good developers working at bad companies :) In the sense that those companies don't appreciate their developers in the same ways good tech companies do.


That is what mattered! The programmer (the driver - you) should have fixed the bug when he noticed it. It wasn't a problem with the language, just the implementation.

PHP is not well known for language-level security issues. It's well known for logic-level security issues.


sounds like it was functional, nobody died, and better than any alternatives you had


> nobody died

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.


I think associating yourself to a technology to the point of "end[ing] up in insular micro-communities" is the wrong approach. People shouldn't define themselves as developers based solely on one language (e.g. "I'm a php [only] developer"). I enjoy working with both low level and high level languages, with some more than with others, but they're merely tools. And no tool is the best tool for every problem.


We know why we chose a PHP for a project, how "bad" PHP is and can weight that against advantages it brings. We already know all the jokes and just do our jobs.

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.


Sometimes I really wonder, why everyone hates PHP? Sure, it's not the best language around to do complex calculations but it's very easy to write code there.


It's not a particularly elegant language.

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.


The thing that gets me is that JavaScript has all these same problems yet, because everyone is forced to use it, it doesn't get as much hate.


Another major difference is that Javascript has trendy things with hype machines.

PHP is not trendy, and there's pretty much no hype around any PHP project.


It's not the hype, for me I use JavaScript because I have no choice. I dislike many things about it, but I have no choice, I need my code to run in the web browser, no plug in, no Flash or Silverlight etc.

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.


JavaScript is creeping into more places too; I'm going to be starting a project in JS soon because it needs to run the JavaScript sandbox provided by mobile OS's. And that is specifically to get around platform restrictions involving downloaded code and to make it easily cross-platform. If I had the choice, I'd use something else.

So this also leads to using node.js (for early development and testing).


It's easy to write code until you run into situations where you need more than a web framework. Got to run a job at midnight to pull in a daily dataset? You're probably gonna be heading for the python book, or the ruby book, etc, to actually get the work done. Even in big companies that "use" php, I'd be willing to wager a significant portion of their actual runtime is written in C and the like as extensions, because PHP the language is so slow.

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.


> Got to run a job at midnight to pull in a daily dataset? You're probably gonna be heading for the python book, or the ruby book, etc, to actually get the work done.

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.


That is an evergreen piece that answers your question: http://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/

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...)


I cry. Sad guys are sad.


Hating PHP is like hating Taylor Swift: You can't argue with numbers, and sometimes, despite resisting, you end up singing along.


I guess I should have known defending PHP and mentioning Taylor Swift would get downvoted. I still stand by the comparison.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: