top | item 9981702

(no title)

bite_victim | 10 years ago

> PHP is not the new BASIC. Combine the HTML/CSS/JavaScript arguments above, and throw in setting up Apache and a thoroughly bloated namespace. PHP is a poor candidate.

Yes, we hate PHP. Hurrr! It is so hard to setup Apache to run it especially considering how easy it is for Python. OH, and yes, PHP doesn't have a CLI! PHP is only good for web because I say so.

What? PHP does have a CLI? It is in fact the same process to set it up with Apache (mod_wsgi/mod_php)? It is also possible to build an emulator in PHP?! (http://phspectrum.sourceforge.net/) NOOO! PHP is only good for web and it is used by mindless guys (a certain asian population like it a lot!!!) so all of this is irrelevant!!!

discuss

order

protomyth|10 years ago

This is the one lesson of PHP that seems to be ignored by a lot (most?) new languages. If you want your language to be popular with beginning web programmers, then provide system administrators with a dead simple way to install it. Add package, done. Then make sure it doesn't cause too much trouble or at least upgrades easily.

If it takes almost no effort to install your language and any modules that users might need, then the system administrator will just add it to the list of things to install. PHP is everywhere because its very easy.

tacone|10 years ago

Actually is not just about easiness, rather than safeness.

PHP historically did not come with a disposable webserver, and writing one was hard. All the focus was on stateless applications. So while the smart guys were dealing with the memory leaks of their wonderful engineered systems, PHP monkeys were able to get things done with almost no fear to bring down the server.

I remember reading that Aaron Swartz used to go to bed with his laptop in order to be able to quickly restore Reddit in the case it crashed during the night. [Citation needed]

For hosting companies of the time, the choice of the language was pretty obvious. Most of them have policies of automatically killing long-running processes even nowadays.

mtberatwork|10 years ago

It's really only "easy" if you are using mod_php. If you are using PHP-FPM, FastCGI, etc, as most people do who run production PHP, then things get about as complicated as using uWSGI, mod_wsgi, etc with Python.

On that note though, getting mod_wsgi up and running with Apache is really quite simple.

lectrick|10 years ago

The fact that PHP is hated by anyone who learned PHP and moved onto other, ostensibly better things is the reason why all the hate exists.

Given any programming task, you're just going to end up with better code in pretty much any other language, especially a functional one.

imakesnowflakes|10 years ago

As someone who has worked with php over 9 years, I can confirm this. I think beginners should not be, under any circumstances, suggested to start with PHP.

I shudder when thinking about the damage that showing == vs === stuff (PHP's type coercion rules, in general) to someone new to programming! It is such a waste to force someone new to learn a bunch of edge cases and weird behaviors and an endless list of php lol's that literally have zero value outside the context of PHP.

bite_victim|10 years ago

> Given any programming task, you're just going to end up with better code in pretty much any other language, especially a functional one.

This is the exact bull* that good hearted Haskell and Lisp guys have to face and fix because of arrogant people like you.

First of all, a good PHP programmer is a good programmer. End of story. You can write crystal clear code in PHP that anyone who started with C (how many I wonder?) or a C inspired language can read. Spreading information and knowledge IS FAR MORE IMPORTANT than debating the language.

Let me ask you a question, did you just happen to read that post that was recently on the front page of HN? The one that showed how much awesome is Lisp comparing to Python? How Python's creator seems to hate Lisp (functional programming)? Did you read it and got to the conclusion that since (perhaps) you are using a functional language then you are entitled to spew crap like that since you are the holder of truth?

Congratulation! PHP is worse than a functional language (you can write functional code in Python and PHP btw) and you are the winning lord of programming languages debates!

sigzero|10 years ago

PHP and CLI? Sure it has it. PHP isn't installed by default even in many of the places that Python is. I have never met a Sys Admin that uses PHP as his CLI scripting language and I would shake my head and walk away if one did.

debaserab2|10 years ago

But you find plenty who would choose bash or perl. Or do you shake your head them too?