You might even be more focused in your learning and select specific frameworks for each language - great exposure for you.
Ask HN: Why not PHP?
11–20 of 33 posts
Re: Ask HN: Why not PHP?
#12The standard gripes about PHP: - PHP's syntax is very random. There are over 5000 builtins and no consistency among them. - PHP lacks (or lacked until relatively recently) many programming niceties such as objects, types, closures, lambdas, and namespaces. To do anything interesting, PHP developers rely on globals or dubious innovations such as using a string as a function name. - PHP relies on a web-serving model wh…
>PHP is fast. Really fast Compared to WHAT? Ruby and Perl? Cause I hope you're not saying it's C fast, or even java or C# fast...
Re: Ask HN: Why not PHP?
#13The standard gripes about PHP: - PHP's syntax is very random. There are over 5000 builtins and no consistency among them. - PHP lacks (or lacked until relatively recently) many programming niceties such as objects, types, closures, lambdas, and namespaces. To do anything interesting, PHP developers rely on globals or dubious innovations such as using a string as a function name. - PHP relies on a web-serving model wh…
if by recently you mean 6 years. almost everything else you said is also wrong.
op - use what you are most comfortable with and don't force yourself into whatever is cool or latest groupthink
(Edit: ok you got me.:
* PHP's syntax is very random
you are confusing syntax with the standard lib, which was inherited from C func for func (which if you come from an OO stdlib can seem 'random' - but it makes elegant sense in the old unix world where CamelCase object names didn't exist)
* PHP lacks (or lacked until relatively recently) many programming niceties such as objects, types, closures, lambdas, and namespaces
see php5 - 2004.
* Even if you can (with difficulty) use PHP libraries in command line programs
tons of daemon scripts run php - you are talking about a php3/4 problem (set_script_timeout etc.) see mailchimp post
* Although it is almost always built into a web server, PHP doesn't make it easy for you to do anything useful with web requests
this is what PHP excels at. want a function to retrieve the hostname from a URL? done. want to send a HTTP header? done. want to parse basic auth? done.
php.net/parse_url
$_SERVER
php.net/header
PHP was probably the first http/web aware language, you picked its strength as a weakness.
* Since it's a web templating language at heart, PHP practically begs you to do the wrong thing and mix presentation and data.
you can say that of any language, implementation-dependent. python and ruby also print to stdout which is just the web process as well. you think this because you have seen more php scripts that mix presentation and logic.
* Due to its ubiquity, PHP is the choice of script kiddies who can't program.
sigh
Re: Ask HN: Why not PHP?
#14The standard gripes about PHP: - PHP's syntax is very random. There are over 5000 builtins and no consistency among them. - PHP lacks (or lacked until relatively recently) many programming niceties such as objects, types, closures, lambdas, and namespaces. To do anything interesting, PHP developers rely on globals or dubious innovations such as using a string as a function name. - PHP relies on a web-serving model wh…
I also think there's a fundamental problem with this question. I think one must make the comparison between web development frameworks, rather than saying PHP/Ruby/Python - you need to say Symfony (or PHP framework X - I just happen to like Symfony), Rails or Django (or Spring or Grails or whatever).
In that case: the comparison is simple and personal. Go to the Symfony tutorial, go do the Django tutorial, go do the Rails tutorial. See which one clicks the best.
I personally find PHP enjoyable to use because I've used it for a while and I'm used to it's idiosynchracies. I've used it for web development but I've also used it for command line daemon processes that have run, without fail, for the past 3 years.
I've never had cause to benchmark those processes in terms of performance with any other language because I've never run into performance problems, but your mileage may vary.
In short: I think PHP gets a lot of bad press - but PHP also gets a lot of things done.
Re: Ask HN: Why not PHP?
#15The standard gripes about PHP: - PHP's syntax is very random. There are over 5000 builtins and no consistency among them. - PHP lacks (or lacked until relatively recently) many programming niceties such as objects, types, closures, lambdas, and namespaces. To do anything interesting, PHP developers rely on globals or dubious innovations such as using a string as a function name. - PHP relies on a web-serving model wh…
This is one thing that really annoys me about PHP...for example there is stripslashes() to remove slashes but strip_tags() to remove html tags. Why couldn't they be consistent about using the underscore or not using it. Another one is array_push($array,$var) which takes the array as the first argument and the $var to push as the second, whereas array_search($var,$array) has it in reverse.
Re: Ask HN: Why not PHP?
#16The standard gripes about PHP: - PHP's syntax is very random. There are over 5000 builtins and no consistency among them. - PHP lacks (or lacked until relatively recently) many programming niceties such as objects, types, closures, lambdas, and namespaces. To do anything interesting, PHP developers rely on globals or dubious innovations such as using a string as a function name. - PHP relies on a web-serving model wh…
"until relatively recently" if by recently you mean 6 years. almost everything else you said is also wrong. op - use what you are most comfortable with and don't force yourself into whatever is cool or latest groupthink (Edit: ok you got me.: * PHP's syntax is very random you are confusing syntax with the standard lib, which was inherited from C func for func (which if you come from an OO stdlib can seem 'random' - b…
Re: Ask HN: Why not PHP?
#17No one is perfect but some are better than others.
Re: Ask HN: Why not PHP?
#18why is PHP considered so inferior to Ruby/Python? When I studied English in college, I discovered that the English language is a very poor choice for writing poetry because it is a very rhyme-poor language. For that, look to French or Italian. English is such a mess of a language, with irregular forms and inconsistent pronunciation. But if you're not writing poetry, English is your best bet, because more people speak…
Re: Ask HN: Why not PHP?
#19Earlier quoted context omitted.
"until relatively recently" if by recently you mean 6 years. almost everything else you said is also wrong. op - use what you are most comfortable with and don't force yourself into whatever is cool or latest groupthink (Edit: ok you got me.: * PHP's syntax is very random you are confusing syntax with the standard lib, which was inherited from C func for func (which if you come from an OO stdlib can seem 'random' - b…
As far as I'm concerned, php5 was still broken until 5.3. http://php.net/manual/en/language.oop5.late-static-bindings....
Re: Ask HN: Why not PHP?
#20The standard gripes about PHP: - PHP's syntax is very random. There are over 5000 builtins and no consistency among them. - PHP lacks (or lacked until relatively recently) many programming niceties such as objects, types, closures, lambdas, and namespaces. To do anything interesting, PHP developers rely on globals or dubious innovations such as using a string as a function name. - PHP relies on a web-serving model wh…
PHP's syntax is very random. There are over 5000 builtins and no consistency among them. This is one thing that really annoys me about PHP...for example there is stripslashes() to remove slashes but strip_tags() to remove html tags. Why couldn't they be consistent about using the underscore or not using it. Another one is array_push($array,$var) which takes the array as the first argument and the $var to push as the…