6 ms·
> I'm not sure how anyone can claim that ... could be considered easy. PHP is Easy, and it's easier than Perl, I'd be surprised if you argue with me on that. P
by anc2020 18y ago
> I'm not sure how anyone can claim that ... could be considered easy.
PHP is Easy, and it's easier than Perl, I'd be surprised if you argue with me on that. PHP has very little to trip you up mentally (or at least that was definitely the case when it started winning). No closures, "arrays" are just hashes etc.
PHP is not hard. Actually the hardest thing about PHP could well be its dynamic variable names, like $$foo.
Neither is PHP powerful, it is extremely un-expressive when compared with just about any other modern programming language.
With PHP you _just_ use the clean wrappers on the C API, and that is also easy to do, no knowledge of C required at all. It's so easy you can pretty much write PHP apps without knowing that "4" is any different from 4.
I don't know if I've convinced you, but honestly, I would have a hard time making a language that was any easier.
- wvenable 18y agoPHP is a simple language, but that doesn't make it easy. PHP does give you enough rope to hang yourself, and unlike most other languages with a similar property (like C, C++, and Perl) PHP gets too much blame for that. I think Python is a far easier language. No $'s, much greater consistency, more available abstractions. You can pretty much handle most of the common complaints of PHP and build very large complex code bases, however, you have to put in the work. Other languages have that work already included.
- anc2020 18y agoAh, well this is where we differ, I'd say PHP is easy, not simple, and that Python is simple not easy. My reason for feeling that way hinges upon Python having more available abstractions. Scheme is an exagerated example of this. Continuations are a very simple idea, you can describe call/cc to someone without much hassle. But the implications of call/cc can be very difficult to grasp. The closure is a lesser example of a simple, pure abstraction which allows complex code through this devious form of simplicity. So that is (pretty much) why it is very easy to reach expert level in PHP but very very hard in Scheme. At the end of the day, what's easier to learn: closures, or the fact that a callback (in PHP) is supplied by giving its name as a string? Its easier to not learn something than it is to learn it :)
- wvenable 18y agoI think I can explain the problem. I taught PHP for a semester at the college level to Web designers. I had 3 months (1 class a week) to get them from no programming experience at all to having a small web application (a contact list). Mostly they all managed to accomplish the task but obviously there's only time to cover the minimum functionality necessary. In that sense, PHP is easy. Now, here's the problem, absolutely nothing they learned is useful for building a reasonable-sized long-lasting web application. They didn't use any classes. They didn't use a template engine. They didn't use a database abstraction. They learned PHP but they didn't learn to use PHP to build real applications. So all that easiness of PHP is all wrong. If you want to do it right, it's not easy.
- randallsquared 18y ago"So all that easiness of PHP is all wrong. If you want to do it right, it's not easy." However, much of the time getting people to do it at all is harder than getting them to do it right after they're doing something. PHP makes it easy to start doing something and see results, and that immediate reward prompts those who wouldn't otherwise get that far. A coupla weeks ago, tptacek made this point, and I think it applies here: http://news.ycombinator.com/item?id=418157 http://news.ycombinator.com/item?id=418157 [Edit: to be clear, tptacek may not have specifically been talking about PHP, but about the fact that writing lots of code is an indicator of total usefulness even if the code is currently bad or inappropriate.]
- habibur 18y ago> They didn't use a template engine. PHP is a templating engine. Writing a templating language for PHP, like Smarty, is like writing a second templating language running on the first templating language.
- wvenable 18y agoPHP is a crappy template engine. Inlining code into an HTML document requires a lot of discipline, a lot of code to write, and is error prone. Why not let software handle that task for you? You want to create more work for yourself?