4 ms·
> PHP is not any worse or better than any other language. I disagree. Consider the following PHP: function inc_all($i, $xs) { array_map($xs, funct
by weavejester 17y ago
> PHP is not any worse or better than any other language.
I disagree. Consider the following PHP:
function inc_all($i, $xs) {
array_map($xs, function($x) use ($i) { return $x + $i; });
}
And compare it to the equivalent in, for instance, Haskell:
inc_all i = map (+ i)
Most languages can express the same concepts as PHP, but can do so much more clearly and concisely. The criticism of PHP is deserved: it's a very badly designed language.
- ars 17y agoHaskell is a functional language, PHP is not. So it's not a valid comparison. Every time I ask people what's wrong with PHP they give me answers from functional languages. I've yet to see anyone give me an example from a procedural language.
- psygnisfive 17y agoYou're right. Let's compare to a more adequate language. Like Ruby. def inc_all(i, xs) xs.map { |x| x + i } end
- jamesbritt 17y ago"PHP is not any worse or better than any other language." Haskell fits as "any other". "Haskell is a functional language, PHP is not. So it's not a valid comparison." So, PHP is not any worse or better than any other language that's just like PHP?
- lhorie 17y ago> PHP is not any worse or better than any other language. I also disagree, but in the sense that PHP is both better and worse than other languages, depending on your metrics. I feel that talking about code terseness is weird if it takes more effort to actually complete whatever project you're working on (due to lack of libraries, less active community, what have you).