Live data from Hacker News

Ask HN: Why no love for PHP?

news.ycombinator.com

91–100 of 150 posts

Re: Ask HN: Why no love for PHP?

#92
post #83

Earlier quoted context omitted.

Great argument, nice analogy, makes a lot of sense, and I completely (and respectfully) disagree. Your analogy reminds me of the greatest cook ever, my grandmother. She used no technology whatsoever. All of her tools had been her mother's which were probably manufactured in the 1800s. She chopped everything by hand in a wooden bowl. (If anyone else helped her with the chopping, everyone at dinner could tell.) She nev…

I don't think your story is incompatible with my analogy, in fact I think it's totally in-line with my analogy. Many hobbyists who have reached the utmost peak level in their art go totally primitive. Cooks grow their own food. Carpenters make hand-made furniture, people really serious about clothes go bespoke. Just because we spend more time agonizing over things doesn't mean we have to spend more money on them. Mor…

Agreed. You have a nice way of putting these things.

I said "I disagree" when I meant "This just doesn't apply to me". Sorry.

Re: Ask HN: Why no love for PHP?

#93

People who are really good at their jobs obsess about their tools- artists obsess over their paint, carpenters obsess over their power tools, cooks obsess over their knives. PHP is like buying a chef's knife at Wal-Mart. You can create a 5 star dish with it, it cuts perfectly fine, but it doesn't inspire the same passion that a Shun knife does. Most restaurants in fact, don't use fancy-knives, they use just regular k…

I think your analogy is great. While I agree that "most" tools will accomplish the same goal or job (Walmart knife vs Shun). I don't agree that the tool determines passion or commitment. I'm a PHP developer (just started learning python!). I work full time for a big website that is coded in PHP. I have a startup that is written in PHP. If you had a conversation about PHP with me, I'm super passionate about what I hav…

I agree with you wholeheartedly. Passionate people love to communicate with other passionate people, PHP as, you said, has a lower barrier to entry- it's like the Java of web languages. There's too many people and companies that just churn out php and java code as a job. It's not an ethos to them.

Just because you use PHP doesn't make you passionless, but because it's gone "mainstream", it becomes a filter of some sorts- just like the Shun is getting too popular right now.

It's not about the specific tool you use- instead it's about the passion and ideas that the tool conveys. In the end, the tools are meaningless. It's the ideas and messages around the end product that people remember.

Re: Ask HN: Why no love for PHP?

#94
post #46

If you can develop as quickly in PHP as you can with RoR, then you are not using RoR to it's full potential.

I disagree based solely on the fact that there are multiple fully featured Open Source CMS's currently available that use PHP. No way anyone's coding (for example) a CMS faster than I can download and install a copy of Drupal, Joomla, or Wordpress.

Re: Ask HN: Why no love for PHP?

#95
post #42
post #19

Earlier quoted context omitted.

I don't see too much similarity between Perl and PHP. Perl has a the syntax of a loose cannon. PHP's syntax is very Java like. * PHP doesn't have special variables that change things about the language like, the starting index of an array. * Out of the box, Perl requires you to import modules to get functionality that PHP has with a simple function call. * Perl has support for classes, but you feel like it's a hack e…

>>* Perl has support for classes, but you feel like it's a hack every time you write one. Check out Moose for Perl. Then name an OO system in production that is better. (-: If you can give an example, I'll immediately buy a book on it. :-) Edit: Syntax.

I've seen Moose, but haven't actually used it. The codebase I work with at work uses the ole Perl blessed hashes, and we won't be switching any time soon.

Re: Ask HN: Why no love for PHP?

#96

I abandoned PHP about two years back. 8 months ago, after going to a conference and hearing the folks at Flickr talk, specifically Cal Henderson ( http://www.krisjordan.com/2008/09/16/cal-henderson-scalable-... ) I got re-energized to take another stab at making PHP pleasant to work with. The results of my last push evolved into a PHP framework: Recess. ( http://www.recessframework.org ) It's got annotations for a de…

Every language must balance expressivity, performance and utility.

I think PHP strikes a good balance, and Recess definitely has the best performance I've seen out of any ActiveRecord ORM in PHP.

Re: Ask HN: Why no love for PHP?

#97
Maybe I'm a pariah here, but I like PHP. Especially when I have teachers cramming C++ down my throat. But Ruby is a great language, too. I've had my fair share of fun with both.

I think the thing to remember is that as programmers we should be language agnostic. This is because we need to chose the right tool to get the job done. Granted, most times we can just choose our favorite language; however, there are times when, say, PHP would do better than Rails, or vice-versa.

Re: Ask HN: Why no love for PHP?

#98
I don't care for PHP because it's interpreted vs compiled, debugging is a pain and it muddles view and application logic! Separation of concerns is one of the key principles of software engineering. Also, library support is much better in Java and it's generally a more mature language. I really want to write my logic separately and unit test it against mock objects and this is harder with PHP. My preferred stack is Java server talking to jquery front end.

Re: Ask HN: Why no love for PHP?

#99
post #34

There are lots of reasons. * PHP attracts idiots. Partly that's because you don't need to know anything to make simple PHP. So, in the large pool of PHP programmers, there are a ton of idiots. And those idiots produce a lot of verbose code that gets used because it does something. Ruby, Python, Perl, etc. all put up a larger barrier because they don't just come with a session handler or whatnot built in. And that wee…

I can't say I love PHP, but some of your criticisms are a little silly. For example, about typing... your argument is that when you cast a string to an int, it returns 0. What would you have it return, null? Typing is jank in a number of ways, but in most cases I See the logic in the original decision. To a noice, the idea that false == "false" (because "false" casts to 0) but true != "true" just seems broken. But wh…

But what else would you have it do?

Well, to be fair, most programming languages don't have this problem so it isn't actually that hard to overcome. The problem is that PHP attempts to automatically re-cast variables to different type. So, you try to do int(0) == str("apple") and it says "hmm, we have different types here, but if I made them the same type, maybe they'd be equal. Well, strings should just be integer 0 and int(0) == int(0) so that makes true, right?"

Most languages won't automatically re-cast variables. In PHP, "0" == 0 and "1" == 1. In most languages, they are not equal because they are different types. PHP's auto re-cast gets you into a lot of trouble. What would I have it do? Not auto-recast things to different types. I wouldn't call it a silly criticism seeing as though Java, Python, Ruby, C# and I'm sure others lean my direction rather than PHP's direction.

I agree that Python (my language of choice) and even C# (my 2nd fave) seem cleaner. But of course they do. They're new.

Um, Python came on the scene in 1991. PHP's from 1995.

The reason I'd call PHP an "old style language" is that, while it may have new features, many of those new features are poorly implemented in a way that shows a lack of understanding of the value of those features and that none of PHP's library uses those features.

Strings are still primitive data types in PHP. Since strings are primitive data types and not objects in PHP, you can't have the little nice things that you get in ruby, python, java, c# without resorting to functions that take the string as a parameter. $string->match('/pattern/') is much nicer than match($string, '/pattern/') simply because you don't need to memorize the order the arguments are passed in. And, as I pointed out, PHP isn't even consistent about it. Sure, you can say that PHP has OO-capabilities, but it doesn't use them in the library which means that all the library stuff you'd do doesn't leverage any of that. PHP also doesn't support multiple-inheritance or mixins which makes OO a lot less useful.

PHP has added new stuff, but it's just not all that useful because everything is old stuff and most PHP programmers wouldn't know the difference between a reference and a copy even to have an opinion on it. Other languages are a lot nicer to use not just because of features, but because you actually get to use those features with the language's and library's built-ins.

It's not that PHP is terrible or anything. It's that it was originally meant for things that didn't require complexity. When people wanted to use it for more complex things, it seems like they said "object orientation, that does complexity" and didn't really know what the term meant or why it was useful when they implemented it. Part of it might be not wanting to break backward compatibility and so one can argue that those who originally created the language made a crappy tool and now the current people have to keep that all alive while other languages were designed better from the start.

And the real question is, what does PHP offer to overcome this crap? And it really doesn't offer (at least me) anything. I'm not going to be using a shared host and so PHP's run-anywhere-ness doesn't help me. Other than that, I can't see a reason to run PHP over a nicer language. It's not that PHP is so terrible. To be a bit of a troll here, PHP's like Windows 95. Awesome when it came out, but now it just looks old. When PHP4 was the in-thing, it was easy to cook up a hack-ish script and get it running on any shared host. Now, other languages have great libraries, much better deployment options, and just a nicer coding experience. I remember the time before other languages took the web seriously. PHP rocked then. It offered everything you needed to make a little web app with built-in functions. And other languages wanted me to jump through all sorts of hoops to do simple things like sessions. PHP was like a language and framework in one. The problem is that people coding in other languages started beating PHP at its own game. Making their frameworks better than what PHP offered and better than what PHP + PHP frameworks offered. And so PHP lost a lot of its appeal as things like mysql_query() and $_SESSION and $_REQUEST no longer held the awesome value that they did in the days of yore.

It's not that PHP's terrible, it's that the other languages have made up their ground and PHP hasn't in the areas that it was weak - it may have added features, but it never integrated them into the language and library and so it just seems old.

Re: Ask HN: Why no love for PHP?

#100

People who are really good at their jobs obsess about their tools- artists obsess over their paint, carpenters obsess over their power tools, cooks obsess over their knives. PHP is like buying a chef's knife at Wal-Mart. You can create a 5 star dish with it, it cuts perfectly fine, but it doesn't inspire the same passion that a Shun knife does. Most restaurants in fact, don't use fancy-knives, they use just regular k…

[deleted]
Post reply on HN