Live data from Hacker News

PHP is much better than what you think

fabien.potencier.org

161–170 of 346 posts

Re: PHP is much better than what you think

#161
post #65

Earlier quoted context omitted.

Reducing the cost of your project is a pretty good reason to choose something. Which template language would you choose for those other platforms? One of 200 half-baked templating languages, or something more complete like php? PHP has better documentation than all of those platforms, so that could be another reason. It has more advanced, popular, and featureful Content Management Systems than all of those platforms.

> "Half baked" Meh. jinja.pocoo.org > "better documentation" By what measure? docs.python.org is just as good (if not better.)

Python docs are way better on a technical level IMO (more detailed, more accurate - if you want to know what a function does in PHP you need to spend hours reading through the massive comment threads to find the corrections, and then ignore the comments from years ago since the API changed and the comments didn't, etc etc); but much like the rest of PHP, the PHP docs are incredibly convenient - php.net/function_name will go direct to the docs for that function if it's unique, or search for function_name in all libraries if not.

This is really useful when your standard library is an incredible cockup of str_pos vs strpos vs string_pos vs sposition vs StrLib::Position vs ($haystack, $needle) vs ($needle, $haystack) - it means you only need to spend a few seconds double-checking the docs every time you use a standard library function.

Sure, a library which was consistent and thus needed no lookups at all would be better, but if you abandon all hope of making sense of it and understand that you'll need to use the documentation several times per line of code, the convenience of the docs makes it not quite so painful.

Re: PHP is much better than what you think

#162
post #110

I am not convinced. My argument is not that PHP sucks or that anything else. It is rather that PHP is lexically tied to corner-case development. In that case PHP is very good at some things but not really all that great for others. PHP started out as being a pre-processor for SGML documents. All PHP code is contained inside SGML program instruction tags. PHP has never changed this, so however it has developed it is s…

You've heard of PHP SAPIs right? You can most defiantly use PHP outside of a "web environment". I have PHP daemons managing the sending of email and sms, and another used to manage incoming data that is fed into our local database. These have all ran for years (7+) with no issues.

Yes, the daemon. The actual interpreter is still thrown away every few requests, because it is leaking memory like hell.

Re: PHP is much better than what you think

#163
post #162
post #110

Earlier quoted context omitted.

You've heard of PHP SAPIs right? You can most defiantly use PHP outside of a "web environment". I have PHP daemons managing the sending of email and sms, and another used to manage incoming data that is fed into our local database. These have all ran for years (7+) with no issues.

Yes, the daemon. The actual interpreter is still thrown away every few requests, because it is leaking memory like hell.

"Yes, the daemon. The actual interpreter is still thrown away every few requests, because it is leaking memory like hell."

I'm talking about the CLI SAPI, NOT the Apache SAPI.

Re: PHP is much better than what you think

#164
PHP is big because 10 years ago, it was the best choice. Back then, the non-microsoft options were Perl, ColdFusion, Java, and PHP. PHP was the best for web development out of that.

This isn't the case anymore. PHP has been far surpassed by Python and Ruby.

PHP is a wonderful templating language.

Where does my opinion come from? I switch us from PHP to Python after writing a large CMS in PHP.

Re: PHP is much better than what you think

#165
post #131
post #83

Earlier quoted context omitted.

Never heard of them.

You are deliberately trying to miss the point. But in the off chance that you don't really get it, the point is quora, asana were started by early facebook programmers, and they didn't use PHP. If they liked PHP so much, they would have used it. I can't find a citation, but there was a thread where a fb engineer claimed fb's internal PHP wiki starts with "There are two kind of people. People who hate PHP, and people…

[deleted]

Re: PHP is much better than what you think

#166
post #131
post #83

Earlier quoted context omitted.

Never heard of them.

You are deliberately trying to miss the point. But in the off chance that you don't really get it, the point is quora, asana were started by early facebook programmers, and they didn't use PHP. If they liked PHP so much, they would have used it. I can't find a citation, but there was a thread where a fb engineer claimed fb's internal PHP wiki starts with "There are two kind of people. People who hate PHP, and people…

Quora founder talking about they went with Python: http://www.quora.com/Quora-Infrastructure/Why-did-Quora-choo...

"PHP was out of the question. Facebook is stuck on that for legacy reasons, not because it's the best choice right now."

Re: PHP is much better than what you think

#167
post #133

Funny. People criticize PHP the language and the PHP fanboys retort by praising PHP the platform. Jeff Atwood more or less said that we should provide the platform advantages of PHP in other languages in order to steer new developers there.

You can't provide the platform advantages of PHP in other languages because either there aren't enough programmers in that language (Ruby, Python) or that language is fundamentally much more difficult to work with (Java).

So create something new.

Re: PHP is much better than what you think

#168

I am so sick of this kind of talk. What language do you like to code in? Really? That's great. Now shut up and go code in it. What difference does it make to you that I use PHP, Ruby or original ASP? My website achieves the result I desire. I chose the programming language I use because of reasons that made sense to me and my project, not because I want the approval of a bunch of hipster start-up kids.

The difference it makes is that with PHP being so popular, it gets a lot of support from cheap web hosts (often being the /only/ language supported), and thus if you write software to be deployed, PHP is the only option, thus it gains popularity, thus nothing else gets supported.

I've been working with PHP for ~8 years, having it as my main source for income, and I'm /still/ finding new and interesting things to hate about it on an almost daily basis. I wish I could go and code in a better language, but that's not an option, because cheap shared hosts don't support any better language, because of people like you keeping the PHP ecosystem limping on.

Re: PHP is much better than what you think

#169
Does PHP have a function to generate a new URL that is the current URL with one of the GET parameters changed yet?

After working with PHP for years, I've taken a look at rails and a few python frameworks, and looking back to PHP it makes me sad that I have to keep using a "web oriented language" that doesn't come with basic web features :-(

Re: PHP is much better than what you think

#170

Earlier quoted context omitted.

You can't provide the platform advantages of PHP in other languages because either there aren't enough programmers in that language (Ruby, Python) or that language is fundamentally much more difficult to work with (Java).

So create something new.

But I like PHP. Even with its numerous warts, it's the easiest language I've ever written.
Post reply on HN