Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The early PHP releases indeed weren't thought through fully, but recent versions are taken quite good care of.

The are emergent (PSR) standards nicely backed by all the leaders in the community (Symfony, Laravel, Silex, Drupal 8.) The Doctrine ORM is also an extremely pleasant way to interact with a relational DB (on par with Python's SQLAlchemy.) I very deeply hated PHP but nowadays I find it fun to develop and ship software written in PHP.

As for JavaScript, 1 week is nowhere near enough what I'd call "designing a language." It has quite the same evolutionary history as PHP, except for being rediscovered a year or two ago.



No dude. Sorry, your opinion is wrong. If recent versions were indeed "taken quite good care of", there wouldn't be >5000 functions all existing in the global scope, with completely inconsistent naming and arity patterns. There wouldn't be exactly one non-scalar data type, the so-called "associative array" monstrosity. I could go on. I don't think you'd care.

It's also funny that you listed 4 actors as "all the leaders" when Laravel uses mostly Symfony code, Silex is made by Symfony, and Drupal is known to be terrible.

The last time I had to program something real in PHP, I got caught trying to debug network calls (all PHP debugging is an exercise in futility, you just never know, am I going to throw an error, return 0, return -1/false/something else, is it something that gets swallowed by the interpreter?) and tried to use a try/catch to catch all exceptions. So pretty much "catch (Exception $e)". Except that, since I was trying to be good and use PSR, I was using namespaces, and PHP does not search the root namespace unless you are in the root namespace. Which is ridiculous and the only language I know to do that. The really infuriating part however was that the interpreter gave no indication whatsoever that something was wrong, it just silently failed. Making it ironic that by dint of using an error construct, I was prevented from seeing compile errors in my code.

Congratulations on knowing that JavaScript was written in a week, however if you had actually dug deeper, you would have known that the creator was a bit of a language nerd and was concepting something different but was forced to shoehorn it into a more Java-esque paradigm at the eleventh hour. When I use JavaScript, I don't have to RTFM to find out what order str_replace takes its arguments in for the 3000th time (and don't give me the string functions/array functions bit because it isn't actually true). Nope, I can just "string".replace(find, replace) because the language was designed. Whereas PHP to this day seems to be a slipshod cadre of hackers (and not in the elite FBI break-in sense, but in the duct tape and baling twine sense) blithely adding whatever feature scratches their particular itch with no care or concern for the rest of the ecosystem.

I don't think JavaScript is a great language. But it is an understandable language, a predictable language. When I have to use PHP it makes me want to quit my job. When I have to use PHP it makes me want to quit being a software developer.




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

Search: