Re: AW: AW: [PHP] PHP is Zero

2013-06-15 Thread Tamara Temple
BUSCHKE Daniel daniel.busc...@nextiraone.eu wrote:
 Why is PHP doing that? I know it works as designed and I know it is
 documented like this but that does not mean that it is a good feature,
 does it? So lets talk about the question: Is that behaviour awaited by
 PHP software developers? Is that really the way PHP should work here?
 May we should change that?!

If you've been using PHP since 2000, you probably well know all the
rants there are about how terrible PHP is as a language; this is one of
the big ones people always mention.

An analog to your statement above is This screwdriver is absolute
*bollux* at pounding in nails! Maybe we should change that!?. (In point
of fact, PHP can be seen as a screwdriver that is *astoundingly* capable
of pounding in nails, so the analogy is in kind only, not in fact. In
real fact, PHP is a programmer's wealthy toolkit; not complete by any
means, but tools that will work for most things, *when you know how to
use them*.)

I don't know the reasons why; it's moot to me. The designers of PHP
chose to go that route, it's up to me as a developer to know how the
language works. If I'm insufficiently able to use it without throwing
errors, or without realizing my code is throwing errors, perhaps it
isn't the language's fault, but mine to learn to adapt to it's
quirks. If I am sufficiently fed up with having to adapt to it's quirks,
Then I will find another language to use.

Now, that said, PHP is often some people's first programming language,
and that, IMO, is a serious problem. PHP is full of these sorts of
things that may not help a newbie learn proper software development
skills. I love that people can teach themselves to program; I wouldn't
want to take that away from anyone. And sometimes that leads to
problems, too. Eventually they'll learn, and get better, or they won't,
and probably not make much of a living at it if that's their desire.

When I came up, I was learning how to program in two languages at the
same time (not mixed in the same program; alternating): Pascal and
Lisp. There really could not be two more different languages (and this
was before anyone thought about OO as an actual thing rather than some
loosely associated concepts.) Pascal being strongly typed, Lisp having
no types and no distinction between code and data. I actually learned a
hella lot more working in Lisp than I did working in Pascal. (Not the
least of which was how to make my TAs scratch their heads in confusion.)
But that may just be me, and since it may just be me, I'm not about to
suggest it to anyone else.

Now, the question here may be merely academic (read: somewhat
interesting, but not really that practical). If it is not, however, this
isn't the right forum. Take your question to -dev and see what they
think. I am personally not interested in such a change to the language
at this point. It's bad enough when they roll to a new major release
breaking backwards compatibility. The anger and invective goes on for
years; people quit using PHP altogether because of such things and hold
grudges for years and years.

 Regards
 Daniel


Cheers,
   tamouse__

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



AW: AW: [PHP] PHP is Zero

2013-06-13 Thread BUSCHKE Daniel
Hi,

 It gives up when it finds a non-numeric character (as the documentation would 
 tell you)

Why is PHP doing that? I know it works as designed and I know it is documented 
like this but that does not mean that it is a good feature, does it? So lets 
talk about the question: Is that behaviour awaited by PHP software developers? 
Is that really the way PHP should work here? May we should change that?!

BTW: I talked to some collegues and friends since my first post. They all 
guessed that 'PHP' == 0 is false within a few seconds. I think the 
weak-typed-PHP is a little to weak at this point.

Regards
Daniel


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



AW: AW: [PHP] PHP is Zero

2013-06-13 Thread BUSCHKE Daniel
To be more technical:

If intval('8315e839da08e2a7afe6dd12ec58245d') would return NULL instead of 8315 
then PHP would be still weak-typed and the developer could know that the 
conversion failed. Good idea? Of course NULL should be transparent in 
operations like +. So 0 + NULL should be still 0.

Regards
Daniel

-Ursprüngliche Nachricht-
Von: BUSCHKE Daniel 
Gesendet: Donnerstag, 13. Juni 2013 13:28
An: 'Pete Ford'; php-general@lists.php.net
Betreff: AW: AW: [PHP] PHP is Zero

Hi,

 It gives up when it finds a non-numeric character (as the documentation would 
 tell you)

Why is PHP doing that? I know it works as designed and I know it is documented 
like this but that does not mean that it is a good feature, does it? So lets 
talk about the question: Is that behaviour awaited by PHP software developers? 
Is that really the way PHP should work here? May we should change that?!

BTW: I talked to some collegues and friends since my first post. They all 
guessed that 'PHP' == 0 is false within a few seconds. I think the 
weak-typed-PHP is a little to weak at this point.

Regards
Daniel


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php