Re: Why PHP sucks - farce or is there a bit of truth?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Clearly you haven't read the whole thread. The subject line asks the
question:
"Why PHP sucks - farce or is there a bit of truth?" - and there is a link
to the article of which I found many more btw.
I am not dissing PHP at all. In fact, as I said, I have been a PHP
programmer for many years...
It was just one thing that puzzled me and that I followed up on. I even
asked: "Is it faster to execute/implement if evaluated left-to-right?"
which would be an argument for this.

I've heard many people moan about lots of languages and there are
weaknesses in most if not all of them.

All I'm trying to do here is improving the language by raising issues (one
at a time) on this list to better understand the language and get people
thinking.

Another issue I found is:
Not so useful return values:

<?php
$b = false;
$c = "orange";
$a = $b || $c;
echo $a;

outputs:
1

JS seems more convenient here. As a scripting language it also has the
notion of truthy but returns the default value "orange".

:-)

Cheers,
Tim

Tim-Hinnerk Heuer

Twitter: @geekdenz
Blog: http://www.thheuer.com


On 18 October 2013 16:45, Robert Cummings <robert@xxxxxxxxxxxxx> wrote:

> On 13-10-17 09:05 PM, Tim-Hinnerk Heuer wrote:
>
>> a - b = (+a) + (-b) = (-b) + (+a)
>>
>> The argument is about the ternary operator though:
>> #include<stdio.h>
>>
>> main()
>> {
>>      int a = 1;
>>      printf("%s", (a == 1) ? "one" : (a == 2) ? "two" : "three");
>>
>> }
>>
>> in C outputs:
>>
>>> one
>>>>
>>>
>> So, why is PHP different?
>>
>
> Why not? Both are valid interpretations. if you don't want ambiguity,
> clarify the expression with parenthesis (as you've shown in a subsequent
> post). One can't hinge the entire argument of whether PHP sucks on a
> right-left/left-right interpretation of the ternary operator, yet this is
> what you've chosen to focus on.
>
> Let's also put things in perspective, when a language reaches an audience
> in the millions SOMEONE will have something to whine about... and it just
> so happens some people like to whine loudly like a baby with a soiled
> nappie.
>
> :)
>
> Cheers,
> Rob.
> --
> E-Mail Disclaimer: Information contained in this message and any
> attached documents is considered confidential and legally protected.
> This message is intended solely for the addressee(s). Disclosure,
> copying, and distribution are prohibited unless authorized.
>

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux