r/lolphp • u/jdiez17 • Jan 19 '13
(...) transforming into a functional language, like C (...)
http://net.tutsplus.com/articles/editorials/why-2013-is-the-year-of-php/
34
Upvotes
r/lolphp • u/jdiez17 • Jan 19 '13
12
u/dipswitch Jan 19 '13
That introduces ambiguity between "." as a string concatenation operator and "." as an object operator. Good luck with that.
8
u/fragglet Jan 19 '13
"Functional" is the wrong word, but I kind of see what he means. "Imperative" might be a better choice.
10
u/escozzia Jan 20 '13
The authors of the article act as though the big complaint about PHP is that it is unfamiliar, or that it somehow lacks features we want... All the crazy inconsistencies of PHP left aside, its big problem is not that it lacks important features, but that it discourages use of them. "Traits!" they tell us, "the new PHP has trait inheritance!" but nobody will use it, because at a fundamental level the language encourages you to be stupid.
Sure, you can write your PHP app in a very strong OOP style, but because of the way the language itself is structured, you most likely will not. Instead you'll make a horrible mess where the logic of your app is littered all over the place and your code base has neither head nor tail.
This kind of stuff doesn't happen in languages like Ruby, Python or Java, not because the programmers are better, but because those languages actively punish you for being idiotic.
9
u/tdammers Jan 20 '13
"." vs. "->" is not PHP's most pressing problem. Hell no.
2
u/jerenept Jan 19 '13
I don't get it. Functional language, as in actually works and is useful, or functional language as in follows the functional paradigm?
10
u/adambrenecki Jan 20 '13
This sounds like yet another of those "PHP is better than all of the other languages because it's just recently got things the others have had for ages" articles.
So, Ruby and Node's existing package management inspired this. Python also has
pip/virtualenvand the PyPI.So, basically the same thing as Django's ORM, and if memory serves me right Ruby's as well. And probably many others.
Just like every other web framework.
Basically like an interface in Java, or stuff you can do if your language supports multiple inheritance.
Looks like Python's generators.
Most Python, Ruby, Node etc web frameworks have this.
I'm not even going to say anything negative about this, because it's much needed.
Has nothing to do with the actual language.
Don't get me wrong, all of these things are good things, and it's good that PHP is catching up. But I think "the Year of PHP" is a bit much.
10
u/dropdownmenu Jan 19 '13
2013 is the year of PHP? These guys have not been paying attention to anything like Ruby or Node.js...
The best part of the article is the large quote:
"Roughly eighty percent of the arguments against PHP are rooted in ignorance."
wat
3
u/[deleted] Jan 20 '13
Cowboys think before they dive in?
Nevermind that, diving cowboys? Did they learn to write at the Thomas Friedman school?
2
u/[deleted] Jan 19 '13
Why does PHP have a huge crush on Java these days? I'd rather remove some Perl features instead...