3 ms·
"Some developers think it's too easy of a language" Good lord, who thinks that? PHP is a terrifyingly complex and difficult language. I'm not saying it's bad,
by SwellJoe 8y ago
"Some developers think it's too easy of a language"
Good lord, who thinks that? PHP is a terrifyingly complex and difficult language. I'm not saying it's bad, it's been very successful for its intended purpose. But, it is definitely not an easy language.
It's got thousands of standard functions in the global name space (admittedly, it has been recognized that this was a mistake, but it's all still in there), quite a lot of syntax, and some weird syntax that's unlike any other language, a high level of verbosity in many places (due, in part, to that whole thousands of functions in the global namespace thing, but also due to an apparent admiration for Java during a critical period in PHP development), a variety of quirks and inconsistencies, etc. PHP is a very big, very complex, language, that takes years to master. I can't see how it can be called "easy". Many other languages are much better teaching/learning languages. PHP is popular and widely discussed, which helps with learning it. PHP is also very easy to deploy, because it is the "standard" web language...you just upload your files to the right directory on most hosting platforms and you're done. That's great, but doesn't really make the language easy.
- ars 8y ago> It's got thousands of standard functions in the global name space There is exactly 0 difference between prefixing a function, and putting it in a different namespace. All those functions have prefixes and are very easy to locate and understand. It's literally the difference between \foo\bar and foo_bar. It makes no difference for understanding the function. The only advantage of a formal namespace is you can "own" it, and other code can't put things in there. Not having it does not making the core language harder to understand. > quite a lot of syntax It's basically the syntax of C. The most complicated parts are lambda functions and references. And that's nothing. Where are you getting "quite a lot of syntax" from? Classes have a bit of syntax, but it's hardly "quite a lot", and the nice this is you don't have to learn any of it to get started. > a high level of verbosity in many places Where? PHP is not especially verbose. Examples? > a variety of quirks and inconsistencies, etc. There's basically just two: Comparing an empty string and the mistake with precedence on the ternary operator. Everything else confusing is the difference between arrays and Key/Value structures, and it's not really not that hard to figure out. > PHP is a very big, very complex, language, that takes years to master. It is not very big. The core language can be learned in a week. It's not very complex either - it's among the easiest languages out there. > Many other languages are much better teaching/learning languages. Not because they are easier - because they are harder!! They are more structured and you have to understand more - that makes them good to teach concepts. PHP was never intended as a teaching language.
- SwellJoe 8y ago"Not because they are easier - because they are harder!!" That doesn't make sense. I think we'll just have to agree to disagree. I believe there are many languages, including some often used for web development, that are easier (and better teaching/learning languages) than PHP in several regards. Python is the most obvious but Ruby also fits the bill.