Ewww, You Use PHP? - <AUTHOR> http://www.mailchimp.com/blog/ http://www.mailchimp.com/blog/ewww-you-use-php/ <comment><USER2> What you need to understand (and most of us hackers too) is that there is a difference between the 'hacker' and 'get shit done' mentality.

Programming is something I've done for the last 10 or so years (in various forms). It is essentially the only activity (in terms of 'work' or career) that I enjoy. The engineer in me just enjoys making things 'perfect' (where perfect is a definition perhaps only I understand, but generally its something built on solid engineering principles. Well-tested, reliable, modular, efficient, etc). When code looks 'just right', I enjoy the code regardless of whether it is bringing me any $$$. In that sense, for me, engineering is a fun activity, and not 'work'.

The hacker in me will enjoy a well built piece of software for its engineering brilliance regardless of whether the software got anything done at all.

In the last year or so I've been able to isolate these personalities and perhaps merge them. I do not scold the hacker just because he wants to try out new languages every month and is opinionated about his favorite ones. I get pissed off when this stops him from getting shit done.

I'm glad for the hacker in me who cares deeply about the tools (languages, IDEs etc) that he uses. Its this hacker that makes my job 'fun'. It is this hacker that has helped improve the quality of my code and my thought process for building good software. The 'getting shit done' would never have been enjoyment enough if it were not for the hacker.

</comment><comment><USER3> I think you can write good software in any language. Moreover, PHP is a powerful language, in its last versions at least, it's just that the way it has been developped would make anyone serious about programming language developpment vomit.

But that's not really a problem.

I guess the problem is not that good devs can't code in PHP. And when they focus on the task at hand, they might not even notice. Because PHP has everything you need. I'd prefer coding a website in PHP than in Java, C, or C++, because PHP is dynamic, has first class functions and the kind of stuff you need to be expressive.

One of the problems is that if you think too hard about the fact that the language you use is suboptimal, it will affect the pleasure you take from doing your job.

The other problem is that a lot of PHP code is really horrible, so people have grown to associate PHP with bad code.

</comment><comment><USER4> PHP's warts are shallow — syntactical quirks, disorganized standard library, idiotic config options.

In practice you disable stupid options, don't use quirky parts of the language, set up your IDE to autocomplete functions, and PHP stops getting in the way.

What you're left with is a decent OO language, which recently got namespaces and closures.

It's OK speed-wise (with APC) and has got stable implementation.

<comment><USER5> If you have to go learn what things are dangerous and must be shut off, and what parts of the language to avoid, surely it would be better to just use a system that doesn't have these kinds of issues?

Imagine buying a car where the salesmen was saying "this is a great car, it will get you where you want to go cheaper and faster than anything else out there. The only thing you have to remember is; 40% of the buttons, pedals and handles in the car will actually make it explode into a rolling fireball if used. Don't do that. You'll also need to open the hood and physically remove 2 or 3 things that are even _more_ dangerous. Oh yea, don't ever put anyone or anything in the back seat. If you remember all that, this car will be a dream!". Would you use such a car? I wouldn't and I wouldn't use a language like that either.

<comment><USER4> Are you talking about C++ perhaps? ;)

There's php.ini-recommended in the distribution and it's well-commented.

Not using variable-variables, undeclared variables, globals, unsanitised variables in paths, SQL without prepared statements, etc. is common sense and applies to other languages too. PHP might just bite harder if you lack that common sense.

<comment><USER5> >Are you talking about C++ perhaps? ;)

C++ very much applies. :)

>Not using variable-variables, undeclared variables, globals, unsanitised variables in paths, SQL without prepared statements, etc. is common sense and applies to other languages too.

This is a subset of what you have to avoid in PHP. Further, things like globals _can_ have uses. That's the difference with a really poorly designed language: there are things in there that have no good use case. Not things that are only used in rare cases, things that should never be used.

</comment></comment></comment></comment><comment><USER6> "Despite its popularity, PHP is considered by the programming elite, almost without exception, as one of the worst languages currently in use today"

I would say, the blogging-about-programming elite, rather than the actual _programming_ elite. I haven't coded PHP in years, but some of the most brilliant devs I know use it when it fits the task.

<comment><USER7> Ok, I'll admit, this may sound a bit trollish, but if PHP is not one of the worst languages, then what languages do you rank below PHP? C comes to mind, not as a bad language itself, but lack of web libraries, but that's about it.

<comment><USER8> I wouldn't call C a worse "language" than PHP by far.

<comment><USER4> It has messy stdlib (gets()!) and lots of features that you can shoot yourself in the foot with (software security would look very different if it had arrays like D).

<comment><USER9> The C standard library is very clean. gets is left in the C89 and C99 standards for backward compatibility an deprecated right now. Nobody uses gets nowadays.

</comment></comment></comment></comment></comment><comment><USER10> Someone else may have mentioned something like this, but I can't find it, so I'll chime in.

Transitioning to Ruby or Python or Scala or anything else will not make anything magically better. I recently converted a Rails project to Grails (actually, I'm in the middle of the conversion). I'd thought "it's Rails - we'll just go in and fix the current issues". It was a horrid nightmare of undocumented crap. It was started in 2006 - Rails 1, and had been added on to for nearly 4 years, and was still Rails 1 (1.2). No useful inline comments, no unit tests, undocumented magic method overrides for basic stuff that wasn't compatible with future Rails versions, and so on. It was horrid. But hey, it's Rails, right? Must be magically better than PHP!

I went back and forth on whether to rewrite in PHP or Grails, and either would have been fine. Why? Because part of the rewrite process is to use modern techniques - with a big helping of TDD tempering the process. Oh, and version control. Yeah - 4 years of a project with 0 version control is not fun to deal with.

So... I'll take PHP with a team of people using sane schedules, TDD/testing, version control, internal and external documentation, and other niceties, over Ruby for the sake of Ruby. Now, modern Ruby/Rails with all those niceties vs PHP with same niceties? Probably a more even draw, with no clear cut choice. But that doesn't seem to be brought up in these discussions.

Frankly, most of the stuff people point to as awesome about Ruby (or Groovy, in my case) in isolation can be detriment - metaprogramming in general can be confusing to someone new to the code without proper documentation as to what's being done. Whether those docs are in tests, inline or external is beside the point. Typically when I come in to a new code base in any language the documentation just doesn't exist (or, better yet, it's "self-documenting"... right...).

End of rant - PHP really is fine when used with proper development techniques. Most languages are. In my experience problems start (and get worse over time) when people rely exclusively on the _language_ alone, rather than language + commonly accepted dev techniques.

<comment><USER11> You'll take language X with team A and process 1 over language Y with team B and process 0? Help me understand what, if anything, this says about languages X and Y?

<comment><USER10> In some ways it doesn't, which was the metapoint. People get _extremely_ hung up on "php sucks" or "python rules" or "C# kicks ass", but the language is only one portion of the equation. How the language fits in to the bigger process of development is a _huge_ factor that is often/usually ignored in these discussions.

No, actually, the teams (people) could be the same. It comes down to lang X with sane processes (testing, documentation, version control, etc) vs lang Y with no (not enforced, standardized, adhered to) processes.

<comment><USER11> That isn't a strong meta-point, it's like saying it isn't the bike, it's the cyclist. Sure Lance can beat me on a junker bike. But he can't win the Tour on a junker.

So if you want to succeed, and you have a choice about language, you still need to pick the best language for your circumstances. The importance of people and process doesn't invalidate that any more than the importance of Lance Armstrong invalidates the importance of bicycle engineering in the Tour.

All that being said, I agree with the last sentence of your comment. It's just that I don't meet many people who say that with the right language they don't need anything else, so I'm not sure who you're debating. For example, all of the Rubyists I know fetishizes testing. None of them have ever said to me that thanks to Ruby, they no longer need tests. What they actually say is that Ruby makes testing easier, which is your point.

So yes, process and people are important, we all agree. So who, exactly, says anything to the contrary?

<comment><USER10> I see where you're going, and I'm probably not as clear as I wanted to be (and probably don't have time to be!)

The ruby community is interesting because of the testing focus, which possibly negates my point a bit. However, I meet plenty of Rubyists who are _so_ focused on tests (which are easy to do because of the language) that they eschew documentation, of any kind.

I've talked to more than a few Rubyists who are now in the 'my code is self- documenting because Ruby is so elegant and my method names and variables are so awesome and I can metaprogram anything I need that there's 0 need to have any comments or documentation - just read my code and the awesomeness of Ruby will overtake you'.

I don't particularly care how elegant your code is, having some inline comments will not hurt. Having external documentation, and sane commit log comments, and so on, are vital in my view. I'm not picking on Rubyists here specifically, that's just the few that spring to mind.

<comment><USER11> You know what? I need a browser plugin that delays posting all comments until I've finished my second coffee. You make some good points, I suspect we agree on almost everything.

In a way, good languages are interesting because they make good practices so easy they're invisible.

Which makes me very interested in the question of documentation. Throwing tests out the window as documentation for the purposes of this discussion, how do you feel about DSLs as one form of self-documenting code?

<comment><USER10> Not opposed to them, and probably have some good points (javadoc/phpdoc is probably, at a stretch, an example of that.

I've got to run now, but email me at email@example.com to carry on :)

</comment></comment></comment></comment></comment></comment></comment><comment><USER12> I use PHP at work for creating not only web applications but, also to do a lot of non-user facing backend stuff. It's great to know that someone out there is using PHP at a much bigger scale for backend stuff.I hope he shares more technical details. If you don't like PHP, fine, but, don't think all PHP programmers are stupid.

I once had a Python programmer looking at the kind of stuff that I was doing with PHP and he was surprised that such things could be done in PHP.

This is an actual conversation that I had in a meetup:

 _Guy1: If PHP were to disappear, it would bring down a lot of the web with it, wouldn't it?

Guy2: Nah, but, that would be the case if Java or .net were to disappear.

Me: (to myself)Wtf!

Guy1: But, most of the links that I click on the web end with .php.

Guy2: um.....

Me: (to myself)pwn3d!_

<comment><USER13> I wouldn't say that anyone has the impression that "all PHP programmers are stupid." Rather, it's more that PHP, on top of attracting O(N) competent developers like any other language, also attracts O(k >> N) _marginal developers_ who barely know enough to get off the ground, and couldn't really manage to code in any other language. When you randomly select a "representative" PHP coder (such as by listing "knows PHP" as a criterion for resume submissions), you get a marginal one.

<comment><USER12> Stupid was a bit too strong, but, I stand by what I said based on my experience. Articles like these exist partly because of the belief that PHP programmers in general are not competent. You do not hear such frequent rumbling on Python and it's practitioners. One could apply the same O(N)and O(k>>N) logic there as IMO, Python is not harder to learn/program in compared with PHP.

</comment></comment></comment><comment><USER14> I really don't understand why a language is so important. Since you have your own VPS or dedicated server, you can use C or any other programming language, create executables that do complex and targeted work and send the result to PHP, rails, python... You can use all of the languages at the same time. It really doesn't matter what main language you are using for routing your websites.

PHP is cool. I have found (<http://fatfree.sourceforge.net/>) and I couldn't be happier. It's similar to Sinatra and has everything a small app needs. It's simple and make separation easier. But if I need that complicated data structure processing that can be done with python or perl, I'll just write down that script and run it through php and get the results.

Between, this statement makes no sense for me

>> This is just going to get bigger and bigger as we grow by 500% or more _every year_

<comment><USER15> Thanks for this, this framework looks real interesting!

<comment><USER16> Agreed! This one snippet from the fatfree docs dispelled a good bit of my lingering hesitance to revisit PHP after a good while away:

      F3::route('GET /about',
      	function() {
      		echo 'No subliminal messages here...';
      	}
      );

<comment><USER17> The problems is that many popular hosts have not deployed PHP 5.3 yet. So, if you're planning on using this framework, you need to make sure your host and anyone you distribute it to are using at least 5.3. This nullifies one of the common reasons for using PHP ("it's supported everywhere").

<comment><USER18> this is fast becoming a myth. a lot of hosting companies are moving up. godaddy already offers php 5.3 shared hosting.

<comment><USER17> That just means the situation changing as time goes on, not anything about a myth. Of course at some point everyone will be running >=5.3, but I still hear about PHP 4 after all...

</comment></comment></comment></comment></comment></comment><comment><USER19> Link to the actual blog entry: <http://www.mailchimp.com/blog/ewww-you-use- php/>

<comment><AUTHOR> Thanks, it was not possible to edit the URL once I submitted.

<comment><USER20> <http://news.ycombinator.com/item?id=1819050>

</comment></comment></comment><comment><USER21> The web stack at Last.fm is PHP, for better or worse. It's certainly not a pretty language. Or consistent. Or advanced. I've got a theory on why so many large websites use PHP though - from Facebook, through Flickr, Yahoo and Last.fm. I think it's a combination of PHP being the best option available at the time many of these large websites were set up, and it being a very simple language. Yes, I actually think that can be an advantage. In PHP you don't spend any time beautifying things. You don't bother writing "clever" code because you can't, really. Writing in PHP pushes you towards making "the simplest thing that could possibly work" - which is so in sync with the most fruitful startup mentality.

It doesn't mean I like it though. It's still as ugly as sin. After all these years programming it I still get thrown by ($needle, $haystack) ($haystack, $needle) and have to look up which variant this particular function uses. I'd much rather be doing it all in Ruby. Or Lisp.

<comment><USER22> The string functions are (haystack, needle), the array functions are (needle, haystack). And, no, knowing that doesn't actually help me because I always seem to mix them up anyway during coding.

</comment></comment><comment><USER23> Why not transition to a different language over time? One that more great programmers want to use?

There's no reason they couldn't (over the course of years) move to another language. I'm not suggesting a total rewrite, but they could start writing entirely new subsystems in a new language. It's very rare to have 100% of your code in one language anyway.

Recruiting great programmers is one of the most important things in a software startup. Why stick with PHP if it makes that far more difficult?

<comment><USER24> Probably because you overestimate the added value of Python and Ruby over PHP and underestimate the cost of language migration.

Language is not that important. Your engineers are. They will easily compensate for suboptimal tools.

The best hint for this is that most (>70%) of the money goes into salaries. Not software. Not hardware. Not office space. Salaries.

<comment><USER25> and if an engineer moans and moans about his tools, and refuses to work in anything but his favorite language, I would say he's an absolutely terrible engineer.

Great programmers can make great stuff using anything.

<comment><USER26> _Great programmers can make great stuff using anything._

Just because I _can_ doesn't mean that I _want to_.

I'm willing to work in lots of environments. In the last 2 years I have done projects for pay in Perl, PHP, Java, C++, Python and various in house languages you probably haven't heard of. However I have to be paid a healthy premium for the displeasure of working with PHP. And if I was asked to do it all the time, eventually I'd leave and find a better job working in something else.

<comment><USER27> I thought the actual programming problems also mattered to great programmers.

Would you rather do something boring in a beautiful language vs. something interesting in an ugly language?

<comment><USER28> That's a false dichotomy. There are plenty of interesting problems to be solved out there offering the use of better tools than PHP.

<comment><USER27> Only if they're greenfield projects. But if you're a job hunter, and there's a really interesting project using legacy code in a language you don't like, are you going to turn down a job offer because of that?

</comment></comment></comment></comment></comment></comment></comment><comment><USER29> What's so bad about PHP? I'd assume the goal in web development is the end product or service and not the means to it. It seems easy to miss the forest for trees, and delve into cult-like arguments of whatever software stack is hip.

<comment><USER30> > I'd assume the goal in web development is the end product or service and not > the means to it.

I don't think I agree. The end product's possibility to be exist at all depends on the mental health of your employees, how efficient they are, and what tools they use. Someone who is unmotivated due to using a language or a tool that is horrible will work only on work morale as a resource for motivation, and it's only a matter of time before that resource runs out, and they'll start feeling miserable and perform sub-optimally.

I don't have an opinion on PHP, although I've made a few cool things with it and enjoyed coding in it, so I don't think it's necessarily that bad.

</comment></comment><comment><USER31> I used to be in the "eww, PHP" crowd, but only until I _really_ started using it.

It doesn't have to be the security blackhole or spaghetti monster it's made out to be.

<comment><USER32> I agree. Every language is as good as the programmer that uses it.

</comment></comment><comment><USER33> I'm maintaining a huge web application mostly written in PHP. We (well. back then it was just me) began doing this back in 2004.

Back in 2004, PHP was a very sensible solution: It was the language I knew best (we had little time for the project, so going with a language I knew felt sensible), it was easy to deploy and back then, there weren't that many alternatives anyways:

Ruby was in its infancy, for Python you had thread safety issues with mod_python or you went CGI, Java was and continues to be just ugly. JavaScript back then was still just a toy language. No Node.js or anything.

That would have left me with mod_perl, but looking at where we are today, that would have been an even worse decision it seems.

Fast forward 6 years.

The application consists of over 100'000 lines of PHP code alone now. It's in production use for many customers which serve tens of thousands of end users. It's not only a traditional web application, it also serves as an API for custom-made tablet pc applications (before we had the iPad), for GPRS- connected barcode scanners and last, but not least, for native Windows Clients (all developed by our company, using various languages).

While I really hate some aspects of PHP by now and I would love to have a Ruby or Python codebase to work with instead, rewriting all of this is out of the question.

Customers depend on this to work exactly the way it works now (they panic even if a link is two pixels off - welcome to the enterprise).

While I might be able to exchange some components with something else, I don't see the benefit it would provide - it would do nothing but make maintenance harder because I'd add another dependency to keep track of.

The only thing I could do is rewrite the thing. But by now, there's more than 30 man-years of work that went into this.

Sure. Redoing it wouldn't take the same amount of time, but considering it would have to look exactly the same (probably I couldn't even get customers to accept different URLs), where's the point in that?

OTOH, despite being done in PHP and tailored to sometimes crazy customer requirements, the code base is sufficiently clean to work with and it's constantly improving. Bad parts get factored out, good parts arrive, so it's not all-bad.

We are embracing new technologies as they become available and fit our product. Our CSS is now written in SASS, we moved from pure DOM scripting to Prototype to jQuery, we make use of the latest features of PHP (now Closures and anonymous functions from 5.3) and of our database (constantly running latest Postgres).

Even though it's PHP, it can still be fun.

Considering recruitment: Granted. It might be harder to convince a good programmer to work on this "ugly" PHP project. But a) we are not just doing PHP (just mainly), b) the code base is, as I said, quite clean and c) even though the code base might be in a language you don't like, the basic concepts of our profession still apply.

You can still discuss and solve interesting problems and you can still create great solutions to these problems.

If you don't want to take part in this adventure just because you don't like the language this is done in, then, frankly, you are not the person I want to hire.

Even though programming is the coolest thing you can do on this world, it's _still_ a job and not everything can always be unicorns and rainbows. If you can't see this, then I don't need you.

<comment><USER34> I hate to say this and I know I will be downvoted by "hackers" but I really don't understand why people (who know limited or nothing about Java & blindly follow the norm) always pick the word "ugly", "stupid" for Java? What superior of PHP to Java when with Java I can program from a stand-alone app to webapp, from client side to server side, from desktop to mobile app?... If you are a coder, you must pick a language & a standard lib to be master, and I would say that picking a language that only sticks to a very specific application platform (web-only, desktop-only...) is a very bad choice. I started from C/C++ and moved to Java and I feel very comfortable to use/study Python, C#, Scala & Ruby.. but PHP, get off, never & never ever!

One last thing (to convince more PHP people to downvote me) is, if you are spending most of your time on PHP or a web-only-language, you will never see the beauty of asynchronous I/O, socket programming, threading, hooking...

Update: When I mentioned "web-only-language", I was thinking of people who use & only use Ruby with RoR for web apps. I don't know how many developers who can't distinguish between Ruby & RoR but I guess it's not a small number. And of course, what I said is toward to those who aren't willing to learn new things. They always think about web & only web.

<comment><USER33> beauty of threading? _shudder_

anyways. I have some reasons for my strong dislike of Java: a) checked exceptions, b) no method pointers or something similar and c) lots of the code produced by the community out there (and in the standard library itself) is full of FactoryFactoryFactories and other typing intensive, mind-bending and ultimately useless abstractions (most of them not DRY at all either).

Back in 2004 I did strongly consider Java though, but ultimately, I didn't have time to implement this web application AND learn a new library (learning the language is easy. learning the library is what makes you slow in the beginning).

As a side note: Said web application also accesses locally connected barcode scanners over the local serial port. Unfortunately the only way to do this (aside of a locally installed client) is _still_ using a Java Applet which I've also written back in 2004. So I do have the Java experience to know that I don't quite like it :-)

<comment> brown9-2 _lots of the code produced by the community out there is full of FactoryFactoryFactories and other typing intensive, mind-bending and ultimately useless abstractions (most of them not DRY at all either_

So what? Why does the code produced by others in "the community" affect your perception of the language and/or tools, if you aren't using their code?

<comment><USER11> Whether you fall in line or not, the culture around Java is around writing code to a certain style. Agree or disagree, there's an argument that by writing in a style that is familiar to Java programmers, your code is easier to read and maintain.

If you're one guy off in a corner, write however you want. But if you're not, you have to take the culture into consideration. And if you are one guy in a corner, why are you using Java?

<comment><USER35> I just started working for a large enterprise corporation (one of the biggest financial companies in the world). We have a lot of old code written in Java that needs to be maintained. I've been trying to advocate new ways of doing things, but almost every time the other developers will respond with, "that's just not how we do things here."

Java has a very strong culture around it. I worked in academia and startups previously and I didn't realize that there is a huge number Java programmers who do nothing but program in Java. They aren't interested in learning new languages and will only grudgingly learn a new framework. Their biggest concern making sure the lowest common denominator can still maintain the (unmaintainable) code.

An example is unit testing. Our current "unit" tests start up a JBoss instance, connect to the development databases, and take ~5 minutes to run just one test. But I've been told not to waste my time working on anything more modular and that if I'm going to put in any time working on unit tests, I should contribute to the framework everyone else is already using.

It can be quite soul crushing.

<comment><USER36> Where do you sit? I'm on the 5th floor, by the stairwell.

<comment><USER11> I was on two, but Lumburgh asked me to go ahead and move my desk downstairs into the storage locker.

<comment><USER37> Did you find the can of pesticide I left down there for you?

</comment></comment></comment></comment></comment></comment></comment></comment></comment><comment><USER38> "So before you jump on that bandwagon thinking nothing interesting could possibly be done with PHP"

The problem is not that nothing interesting can be done in PHP. Lots of interesting can be done in any Turing complete language. It would be just 'plus points' if you would use for example Scala for the kind of task you described. I just cannot see why to use a dynamic language in a task where performance is important when there is a statically typed fast language which is as good and as concise as Scala. It is not that it is impossible that I would join a company developing in PHP. We have to make compromises all the time. It is just that developers evaluate companies, and join the one with the most 'plus points'.

</comment><comment><USER39> In this context I'd like to quote Peter Norvig talking directly here on HN just a few days ago (in this case about Lisp vs Python):

 _In terms of programming-in-the-large, at Google and elsewhere, I think that language choice is not as important as all the other choices: if you have the right overall architecture, the right team of programmers, the right development process that allows for rapid development with continuous improvement, then many languages will work for you; if you don't have those things you're in trouble regardless of your language choice._

<http://news.ycombinator.com/item?id=1803815>

</comment><comment><USER40> Is it good software thanks to PHP, or in spite of PHP?

<comment><USER41> Because rewriting it in a different language automatically makes it better software..? I don't think the language really matters.

<comment><USER40> When I first wanted to build a website, I wanted to use C, because that was the language I knew best at the time. I'm glad I decided against idea as time went on.

<comment><USER42> Heh. I have written precisely one CGI. It's in C. It also does precisely what I needed it to do.

</comment></comment></comment></comment><comment><USER43> I have no doubts that complicated things can be done in PHP. Complicated things can and were being done in Assembler, too.

It just is a red flag and makes me wonder about the sense of taste the developers at a PHP company have. Therefore it would take a lot to convince me that working for them is "alright". If they have bad taste, how are they supposed to write nice code?

Having to learn their proprietary solution to scaling issues only is not as tempting as it sounds. Yes, I am interested in working with scaling problems. But learning a proprietary PHP hack is not going to help my CV that much.

</comment><comment><USER44> I am a Ruby on Rails programmer from the early days. It is my platform of choice. And yet, I still have massive respect for PHP. For me, it's the next best option.

I worked in PHP for five years before I worked in Rails, and I think PHP is a great language for web development.

<comment><USER45> "I think Rails is a more modern platform. I think PHP is not the ideal choice. But I think PHP is a great platform."

Yeah but here's the rub. You can't compare Rails with PHP. You need to compare Ruby to PHP, and ask if the switching costs will outweigh any deficiencies; and you need to compare Rails to e.g. Cake or Symfony or similar, and ask if one language provides a framework whose advantages are so compelling that they too will outweigh those switching costs. I have yet to be convinced.

(weighting factors may apply for dev experience with one or the other, legacy code, hosting/infrastructure support, etc.)

<comment><USER44> I don't think something like Cake is a good comparison for Rails, and it's honestly not how I think of PHP. Developing in PHP is making a collection of functions and custom made classes hacked together, in my mind. I know there are frameworks, but if you're going to use a fancy framework, you'd might as well use Rails.

I wouldn't develop in Ruby without Rails, but I wouldn't develop in PHP with a framework.

<comment><USER46> I don't like rails. When I do web development, I do it in PHP, and I avoid PHP rails-like frameworks as well. I prefer more control and most of projects don't fit into a nice box for rails.

</comment></comment></comment></comment><comment><USER8> In this day and age the only real reasons to use php is because you're either stuck with it and changing the code base makes no sense since you already have a product built, because you're new and don't know any better, or because you've been doing it for such a long time that you're so used to it you don't see the languages faults anymore.

One of the applications I maintain is a convoluted machine made of half java half php on top of Quercus, and if freaking drives me crazy. I think the only thing I hate more than that is working in ASP.

</comment><comment><USER47> Well, I experienced a reverse ewww when I was interviewing at Amazon for an Imdb job. As soon as I mentioned that my previous employer used PHP, I had a very short and quite frank answer: Oh, what for? PHP is such a bad language. So bad, that nobody should use it.

I was kind of floored since I didn't exude a fan-boy mentality, I was simply answering the questions. That was more of an inner chuckle, but I wasn't surprised by his answer at the end of the day. By the time the interviews ended, I realized that PHP might be the last thing these guys will look at.

Coincidentally, I took another offer where the core is PHP + Symfony + Doctrine. I was very impressed at how well behaved, structured and developer friendly a good source base can be, no matter the language.

</comment><comment><USER48> The trend I've noticed n recent years is that the PHP developer has to defend himself when talking about language choice, much like someone who decides to use .NET.

People never see the same need when starting a project in rails, even if it isn't that great a fit. One advantage PHP has for me is that nothing is abstracted away in a way that I don't understand the underlying components because I'm writing my own framework. Sure certain aspects I'll grab some cade as necessary but in general everything I'm doing I've either written it or parts of it myself.

I get all the semantic language arguments against PHP and largely agree, this has become less of a problem for me though with experience.

</comment><comment><USER49> My bank supports billions of dollars of transactions per day. But they use COBOL, so I will never work there.

</comment><comment><USER50> These quotes from PHP's creator are very enlightening:

<http://en.wikiquote.org/wiki/Rasmus_Lerdorf>

</comment><comment><USER51> Can someone fix the link? It's pointing to the front page for the blog, the blog post is here: <http://www.mailchimp.com/blog/ewww-you-use-php/>

</comment><comment><USER17> We always hear about Facebook using PHP as a justification for it.

Unfortunately for this line of thought, Facebook wanted to move away from PHP 3-4 years back, specifically to Python I believe, and realized it would be too much work to rewrite their entire front end. So, they're trapped in PHP, not using PHP because they think it's the best choice.

This was mentioned in the article announcing HipHop.

</comment><comment><USER52> I used to be a PHP programmer, and now I'm a Ruby programmer. A lot of great things have been built on PHP, I just don't like coding with it. To the folks who build great things on PHP, more power to them.

<comment><USER27> You've got the right attitude. You just say you don't like it and move on. Different strokes for different folks.

No point in being condescending about someone else's choice of language.

</comment></comment><comment><USER53> I work as a developer at a stock exchange. My department wrote and maintains several business apps in PHP, including a report generation framework and several realtime clinet/server apps.

I find it reliable, reasonably powerful and easy to use. It's major strength is brilliant documentation on the official web site (this is a major downside to Python in my experience).

</comment><comment><USER54> As someone who's written tons of Java/J2EE etc... and who's been writing PHP for several years, I don't get all the PHP bashing. I've seen tons of garbage code in Java, and in PHP. And I've seen amazing things done with both. It's a poor carpenter that blames his tools. And yes, for many tasks I opt for PHP, because it is fast for both implementation and performance. It's fun and it works really well, as long as you know what you are doing. How's that different from Java, Python, Ruby etc...? One more thing, if you want to judge a language based on how much trouble you can into, what about C? Or what about the threading and memory leak issues you can run into in Java? I mean, all of these languages have massive pitfalls and none of them can effectively stop a bad programmer from doing bad things.

</comment><comment><USER55> "So before you jump on that bandwagon thinking nothing interesting could possibly be done with PHP, think of us (or Facebook)."

Before I jump on this bandwagon I think I'll forget all about mailchimp, and think about all the many, many, _many_ great companies (such as Facebook) that use PHP.

</comment><comment><USER56> "Email marketing" + "I thought you were cool" = cognitive dissonance

</comment><comment><USER57> PHP is fast and just about everybody "knows" it (which is a curse as much as a gift). But as someone who made a living writing PHP and made the jump to another language:

a) I find it more enjoyable to program in other languages.

b) I can generally get things done more quickly in other languages (feel free to ignore this point if you're the opposite :P).

c) Aside from speed, ubiquity, and the docs on php.net (which are _awesome_ ), I don't really get anything out of using PHP.

d) People will pay me more to program in other languages.

So yeah, I suppose my first reaction on reading "PHP" in any job description is "Eww". It's not really because I think PHP is wholly unsuited for programming, though. It's just not optimal for me, personally.

</comment><comment><USER58> The "cool factor" of a language is inversely proportional to its popularity.

<comment><USER59> Just like with everything else...

<comment><USER18> human progress was never a result of religious fanaticism. sticking to one language because it is the "one true language" is a lot of crap.

</comment></comment></comment><comment><USER60> "Get out of languages, platforms that's the important thing" - Zed Shaw said something like that a while ago

</comment><comment><USER61> As opposed to its peers (eg. Ruby, Python), the original PHP was not a programming language but just a collection of tools for HTML preprocessing. Although the current PHP has nothing to do with the original one, and PHP 5.3 actually has pretty nice feature set with namespaces (finally!) and anonymous functions, its "non-academic" roots still show off as general ugliness. That's why I wouldn't recommend PHP to anyone as their first programming language (been there, done that, nowadays a Pythonista).

</comment><comment><USER62> PHP devs are the silent majority.

</comment><comment><USER63> Can an admin update the link to: <http://www.mailchimp.com/blog/ewww-you-use- php/>

The submitted link requires clicking a "More" link in order to read the full entry. (And it will be out of date once they post another entry on the blog.)

</comment><comment><USER64> I picked up PHP because it was like C (which I use since I was born) with training wheels and some quirks.

It gets the job done, sometimes spectacularly, sometimes not so very much - depending on who did the work. It's a workhorse, and has been demonstrated as such millions of times so far. Performance depends a lot on deployment strategy, but it can be fast.

I really see no point in bashing PHP. It's a tool, it has tons of documentation, libraries and available helpful people. Sure, I'd like to have some tweaks here and there, but with what tool wouldn't you?

There is a saying around here, roughly translated: Rusty cock minds every(single) pube.

</comment><comment><USER65> I have been contracting for a company that has an in-house version of this tool. We are able to push about 10 million emails a day, including processing bounces, click, unsubs, etc, with a fairly straightforward set of python scripts. Its not about the custom logic, its about choosing the right basic building blocks.

Based on my experience, I doubt they need their "highly sophisticated" PHP to do this -- plain old normal PHP would probably be fine so long as they choose the right out-of-the-box software to pair it with. (nginx, postfix, certain non-sql databases, and the right mysql setup)

</comment><comment><USER66> Everyone has to make his/her choice of technology and MailChimp has chosen PHP. That's perfectly okay.

I know PHP, and I've used it to put food on my table. Luckily that is no more. I'd consider doing PHP again only if my wife and kid were starving.

My advice to people stuck with PHP codebases - start changing the site backend first. Write everything not related to spewing HTML in a real programming language, and slowly limit PHP use as a simple template-processing tool that generates your app's HTML. Which is probably the only thing PHP is good for.

</comment><comment><USER67> I grew up coding in PHP and still love it to this day, so I agree with the basic premises of this article.

The one thing that bothered me was towards the end. In trying to justify PHP's coolness (which I am not arguing against), people continuously bring up Facebook as an example, even though they've repeatedly stated that they wanted to move away from PHP to Python years ago but realized they couldn't after having hundreds of thousands of lines in PHP.

PHP's cool. I love PHP. But, let's stop using Facebook as an example of a company "embracing PHP".

</comment><comment><USER68> PHP is a pretty decent lazy language, it just could give rise to bad habits. It also has a few odd irregularities in the naming of functions/argument order. It's just a massive arsenal of functions for everything. For example if people want to manipulate a string or array, newbies will often not pay any attention to how often it gets iterated through redundantly. They just use a bunch of functions that do what they want magically.

</comment><comment><USER15> I have to say, I code in .NET during the day and have been considering ruby / python for my own projects because the hosting costs are a lot less. I used to do a lot of PHP and I keep thinking I should just stick with that.

Although it feels 'dirty', the only thing I consistently read about ruby & python web apps are deployment issues and exactly the best way to deploy those apps.

With PHP it seems very straight forward and an easy way to avoid all those issues.

<comment><USER69> ASP.NET has always been the cleaner, nicer-to-use alternative to PHP. If you're already good at .NET i see zero advantage to saving the few dollars here and there that PHP would bring.

Your time as a human is far more valuable than the extra cost of an IIS server.

Ruby and Python actually offer some language advantages tho. Personally if I coded .NET in the day I would be looking at F# for webapps.

<comment><USER46> Why F#?

</comment></comment></comment><comment><USER70> I don't understand the "PHP is fast" comments. Whenever I've had major scaling problems with PHP or anything else it's been due to IO rather than a fundamental issue with whatever language I was using.

The things I did to fix the performance problems are generally language agnostic. Improved database architecture, search indexer configuration, clustering, memcache, etc.

<comment><USER46> Yeah, PHP is slow. It's just that the speed of your language doesn't really matter. What is, in my opinion, an advantage with PHP (but not exclusive to it) is the whole share-nothing design philosophy and mod_php.

</comment></comment><comment><USER71> Speaking specifically of mailchimp, I interviewed with the a few years ago. They are a seriously cool company. If you ever get a chance to talk to Chad, ask him to tell you the story of DDoSing Mechanical Turk. Ignore the language they use, mailchimp is an amazing analytics company.

</comment><comment><USER72> Does your customer care which programming language you use? The true test is if the application that was developed meets the requirements of the customer/consumer. I don't develop for other developers; I develop for customers that want the app to work.

</comment><comment><USER73> > thirty million emails sent by tens of thousands of users every day

Damn! Are these all spammers?

</comment><comment><USER26> _I can say without doubt that it is the most sophisticated framework for this environment that I've heard of except for perhaps what Facebook uses._

He hasn't heard of Google? :-P

<comment><USER74> Uh, does Google use PHP? I think that's what he's referring to.

<comment><USER26> Define "this environment". I took it to mean handling large amounts of mail, in which case the gmail team has one of the most sophisticated frameworks, period.

As for using PHP, I'm sure it is used somewhere, but it is not a popular language at Google. Most Google developers have better taste than that.

</comment></comment></comment><comment><USER75> I think this is the money quote in the article

"Once you get to the scale of computing we're at, the language you use is much less important than the platform you build on it."

</comment><comment><USER76> moozeek -

It's 2010 - link the post, not the blog

<comment><USER77> For posterity, the link to the post: <http://www.mailchimp.com/blog/ewww-you- use-php/>

Edit: never mind, <http://news.ycombinator.com/item?id=1819021> already posted it.

</comment></comment><comment><USER78> Oh well, you built your own framework. That changes everything!</comment>


Mediums' new model – why it sucks, and more business model ideas - <AUTHOR> https://medium.com/@neilkakkar/dear-medium-80e5e82b5362 <comment><AUTHOR> A free-for-all link:

[https://medium.com/@neilkakkar/dear- medium-80e5e82b5362?sour...](https://medium.com/@neilkakkar/dear- medium-80e5e82b5362?source=friends_link&sk=1b21a0cae2111abf9f40f7bf70a2ddeb)

</comment><comment><USER2> For those for whom the article doesn't display fully, [https://outline.com/7hVs6S](https://outline.com/7hVs6S)

<comment><AUTHOR> Interesting. I didn't know about this, thanks!

By the way, that article would display fully for everyone :)

<comment><USER2> no, my medium claims that I've reached the member limit.

<comment><AUTHOR> ... Oh damn, my bad. I posted the wrong link.</comment></comment></comment></comment>


The Adams Theory of Content Value - <AUTHOR> http://dilbert.com/blog/entry/the_adams_theory_of__content_value/ <comment><USER2> It is curious that he believes this transformation will be unleashed by the iPad. The reason he gives:

"The iPad has a browsing capability that allows you to see any content on the Internet, legal or not, and consume it from just about anywhere."

is untrue, and not just because there is a large amount of flash content on the Internet. Only a small fraction of illegal content on the Internet is available on the publicly accessible web. I see no reason to think the iPad will ever have bittorrent or filesharing applications, or that a large influx of iPads would allow pirates to overwhelm whatever forces are currently keeping copyrighted material off the web. So how is the iPad supposed to be some sort of game-changing tool for copyright violation?

</comment><comment><USER3> "At some point, I assume, a Google search for any popular book title will return an illegal source at the top of the page."

This is not true. Generally speaking, the easier it is for a 40 year old to find, the easier it is for rightsholders to find and sue. Furthermore Google tends to be pretty cooperative with removing links to egregiously infringing stuff.

</comment><comment><USER4> Even if the acceptable price consumers are willing to pay for content approaches zero, that hardly means the _value_ of content approaches zero. To the contrary, if you're able to search vast amounts of content for what is most interesting to you, the value you receive from that content increases with the size of the search space. It's a clear win for the audience.

But what about the content producers? Already, most "real book" authors don't publish to get rich from royalties, and derive most of their value in the form of personal and professional publicity they receive from their work. If the acquisition of such publicity shifts from big corporate publishing houses who have the business deals in place to get you on The Daily Show to something more democratic, authors benefit from an increasingly meritocratic system, as well.

<comment><USER5> > _... that hardly means the value of content approaches zero. To the > contrary, if you're able to search vast amounts of content for what is most > interesting to you, the value you receive from that content increases ..._

The value of which Mr. Adams speaks is _economic_ \-- i.e. what is exchanged for the content:

> _And so, as our ability to search for media content improves, the economic > value of that content will approach zero._

</comment></comment><comment><USER6> His analysis is too simplistic.

There is no question that the value of each individual piece of content for each user will drop. However there is also no question that we get more utility out of the content we have, and therefore there is no question that the value of all of the content we have is greater.

The important questions are what fraction of that utility gets captured as income by various providers along the way (a smaller slice of a bigger pie can still be more), and how much an individual provider can capture.

Data from the music industry indicates that musicians who share their music freely make more money in the long run from increased concert sales, and memorabilia sales. ( _The Grateful Dead_ are an extreme example.) Data from <http://www.baen.com/library/> shows that putting books online increases sales. So we have two examples where more free content translates into more money.

However for now it appears that the search engines, particularly Google, are in the best position to capture value out of the utility of content. But Google recognizes that it is in trouble without content creators and is actively trying to help. Here is hoping that they succeed.

<comment><USER7> Putting books online increases sales by giving extra exposure to those books which are online, compared to books which are not online. Assuming that it would still boost sales if _all_ books were online is a textbook example of the fallacy of composition.

</comment></comment><comment><USER8> He seems to be mixing-up value and price, or something like those. Is it bad to have more good stuff -- the _choice_ to have good stuff? That seems wrong. What is going to zero is limits on distribution.

Banging on with words like 'illegal', 'criminal', 'stolen' makes it sound like a testy lament that the barbarians are at the gates. Things are changing, and most likely for the better. The fear of diminishing content from loss of incentive is not materialising. Between 2002 and 2007, film, book, and music production are all significantly up ('File-Sharing and Copyright'; Oberholzer- Gee, Strumpf; 2010.)

Not being able to imagine how production might be funded without distribution monopolies (copyright) doesn't mean new ways cannot be developed. The tech that is withering copyright gives us much more than it takes away.

</comment><comment><USER9> What's interesting to me is whether our values will change as this content essentially becomes widely available and free.

Currently, we have a perceived value of something based on its cost (see any web app pricing article). Will this evaporate as almost all content becomes free? Will our perceived value based on cost be replaced by some ranking system that Adams alludes to as "better search"?

This is the second variable that I think many people miss when they talk about the inevitable shift to free content as a negative thing for consumers.

</comment><comment><USER10> I've never heard of books being online for free. I would guess you'd only find maybe the top 100 bestsellers on bittorrent, or limewire. I doubt most of the books people want are shared online.

<comment><USER11> The other day I downloaded a single torrent that had nearly 1500 science fiction novels in it. The intersection between this torrent and the titles in my bookcases was about 75% (40+ year old collection.) I did spot checks for torrents of random non sf titles, not to download, just to check availability, and the hit rate, with minimal searching, was about 50%. A little googling also found Mega-whosis downloads for lots of titles, including a large collection about half the size of the torrent I downloaded previously.

A spot check for technical books, some within the year, turned up about a 40% success rate. The older the book, the more likely I was to find a copy, down to about 5 years or so ago. Older tech books are available, but only titles that are big names in their fields. I did find one rather nice torrent listing older science books.

I would say that the online book piracy movement is rolling along pretty well. And this is in support of people willing to put up with the awfulness of reading on a laptop or desktop screen. IMHO, the iPad is _really_ nice for novels, short stories, comics, and manga. Less good for highly formatted technical and illustrated books; but still better than using a laptop.

</comment></comment><comment><USER12> There will still be authors, its just that their income will come from speaking gigs and merchandising.

</comment><comment><USER13> "As our ability to search for media content improves, the economic value of that content will approach zero."

In simple words, he's just saying:

        Piracy makes your content worth nothing.

I just don't think this is true. Piracy has been rampant in movies, but movies continue to make money in theaters, pay-per-view, netflix, or just good old TV.</comment>


Yahoo Will Shut Down Upcoming, Deals, SMS Alerts, Kids, Some Of Mail - <AUTHOR> http://techcrunch.com/2013/04/19/yahoo-will-shut-down-upcoming-deal-sms-alerts-kids-and-some-versions-of-mail-focus-on-apps-youll-use-daily/

<comment><USER2> sad to see upcoming getting shut down, although for me and where i live it never really worked like i wanted it to. anyone know of such a service that's truly comprehensive? it seems that events per location are all hidden behind obnoxious barriers and no one has done a good job of bringing them together.</comment>


OpenBSD's tame gets a path list parameter - <AUTHOR> http://marc.info/?l=openbsd-cvs&m=144027474117290&w=2

<comment><USER2> Tame is forming up pretty nicely.

The logic here is that most of the time files of certain type are usually in logical locations, whereas with SELinux the logic is that types are intrinsic properties of objects, and saved as metadata their metadata. The difference is that with the latter moving the object does not change the properties (the context comes along), while the first one might lose the properties in case something made moving outside the intended envelope possible.

The approach taken by Tame is technically easier to implement without shooting yourself in the foot, and featured also in Grsecurity fame's RBAC implementation. Jolly good.

The thing just is, the approach taken by SELinux with the external security daemon can and has been extended beyond files. Tracking the information by its properties when it moves from files to database, web servers, etc, is a powerful (but extremely hard for implementors) feature. Also, administratively the security classifications of documents are properties of documents, not the storage containers they are found from.

</comment><comment><USER3> I had no idea what Tame was but this introduction helped:

[https://marc.info/?l=openbsd- tech&m=143725996614627&w=2](https://marc.info/?l=openbsd- tech&m=143725996614627&w=2)

<comment><USER4> Previous HN discussion:

[https://news.ycombinator.com/item?id=9909429](https://news.ycombinator.com/item?id=9909429)

</comment></comment><comment><AUTHOR> I like the idea of making sure my program doesn't go off the rails and become an attack vector. It is an interesting contrast to the external mechanism without input from the program.

</comment><comment><USER5> I would love to see something similar to tame on linux. Just because linux also has SELinux doesn't mean it can't also have tame.

I love the approach.</comment>


Show HN: Accurately transform words e.g. "election" – "elect", "electoral" etc. - <AUTHOR> https://github.com/gutfeeling/word_forms <comment><AUTHOR> I have been working on a NLP project where I needed to identify different forms of the same word. Typically, this is done by Stemming and Lemmatization. These methods are not accurate, and I needed high accuracy in my project. Since I found no libraries/packages that can do this, I decided to write a Python package myself. It works quite well now. Feel free to check it out, I would love to hear your feedback.

<comment><USER2> Thanks for doing this. I wanted to do the same things a few months back. I looked into a lot of dictionary APIs, but as you mention in the repo, they suck at connecting different parts of speeches. It's funny how simple this sounds but how difficult it is to actually do it. Back then, I gave up and went with a Lemmatizer. Will definitely use this.</comment></comment>


The Blue Collar Coder - <AUTHOR> http://dashes.com/anil/2012/10/the-blue-collar-coder.html

<comment><USER2> blue collar wages, not blue collar skills</comment>


Tell PG: "Pending" discourages conversation on older threads no longer on FP - <AUTHOR>

I followed up with a reply answer to someone who, in turn, had asked me a question deep in a thread started a few days ago.
My comment is now in "Pending" mode and if that user doesn't have >1000 karma they are not going to see it and its unlikely anyone is viewing deep into the thread any more.
I'm wondering if this is an implementation oversight or an intended consequence to discourage conversation of staling threads? <comment><USER2> Neither; simply a bug.

<comment><AUTHOR> Awesome to hear, thank you. Often high value conversations occur in threads after they have fallen off the front page.

</comment></comment><comment><USER3> Is this "pending" still a thing? How does it work again?</comment>


Ranking My Favorite Cellphones I've Ever Owned - <AUTHOR> https://adamreport.com/ranking-my-favorite-cell-phones-i-ve-ever-owned-ff6fa88de614#.ea4zjknfn <comment><USER2> My favourite smartphone was/is:

[https://en.m.wikipedia.org/wiki/Nokia_N95](https://en.m.wikipedia.org/wiki/Nokia_N95)

It was such an awesome phone at the time, such quality hardware, and once they patched the firmware (a lot), it was an awesome phone. Loved the dual sliding action, the solid feel in the hand, so many features, and the amazing call quality. Still miss it.</comment>