All,
One thing that I think we should change is how we refer to the ‘weak’ type
hints. The word ‘weak’ has a negative ring to it, and considering this is
how the language behaves across the board it’s a pretty bad name for this
feature.
Personally I think we should go for ‘dynamic’ when we document it, as this
is the common way to refer to this behavior (dynamic languages). We could
also consider going for ‘lax’ or ‘lenient’ as the opposite of ‘strict’,
although I think we can easily do without introducing a new word into the
vocabulary here.
Thoughts?
Zeev
We could
also consider going for ‘lax’ or ‘lenient’ as the opposite of ‘strict’,
although I think we can easily do without introducing a new word into the
vocabulary here.
From an user perspective, I'd suggest that "lax" would potentially carry
more negative connotations than "weak." Lax implies (to me) that the engine
is being negligent in not checking the types...
Dynamic for "weak" types, and Strong for "strict" types would make the most
sense to me. :)
Hi Zeev,
Le 30 mars 2015 16:17, "Zeev Suraski" zeev@zend.com a écrit :
All,
One thing that I think we should change is how we refer to the ‘weak’ type
hints. The word ‘weak’ has a negative ring to it, and considering this is
how the language behaves across the board it’s a pretty bad name for this
feature.Personally I think we should go for ‘dynamic’ when we document it, as this
is the common way to refer to this behavior (dynamic languages). We could
also consider going for ‘lax’ or ‘lenient’ as the opposite of ‘strict’,
although I think we can easily do without introducing a new word into the
vocabulary here.
Dynamic is used in the context of static/dynamic typing though, and that's
a different meaning. Strong/weak typing is a known definition, and the
correct one here.
Thoughts?
Zeev
All,
One thing that I think we should change is how we refer to the ‘weak’ type
hints. The word ‘weak’ has a negative ring to it, and considering this is
how the language behaves across the board it’s a pretty bad name for this
feature.Personally I think we should go for ‘dynamic’ when we document it, as this
is the common way to refer to this behavior (dynamic languages). We could
also consider going for ‘lax’ or ‘lenient’ as the opposite of ‘strict’,
although I think we can easily do without introducing a new word into the
vocabulary here.Thoughts?
To me, "dynamic" implies "subject to change". The rules are different but
they are fixed and well defined.
I would suggest "loose" if you want to avoid "weak" (personally I think
"weak" is OK, but I can certainly see where you are coming from). "Loose
typing" is not new terminology, indeed Google seem to consider it
synonymous with "weak typing" - when I Google either the first hit is
http://en.wikipedia.org/wiki/Strong_and_weak_typing
Zeev
Zeev Suraski wrote:
One thing that I think we should change is how we refer to the ‘weak’ type
hints. The word ‘weak’ has a negative ring to it, and considering this is
how the language behaves across the board it’s a pretty bad name for this
feature.
Personally I think we should go for ‘dynamic’ when we document it, as this
is the common way to refer to this behavior (dynamic languages). We could
also consider going for ‘lax’ or ‘lenient’ as the opposite of ‘strict’,
although I think we can easily do without introducing a new word into the
vocabulary here.
It appears to me that all of these suggestions may hide the fact that
the arguments are converted to the hinted types. So perhaps "converting
type hints" might be a good name.
Then again, the respective declare directive is called "strict_types",
so maybe it's best to speak of "non-strict type hints".
--
Christoph M. Becker
Zeev Suraski wrote:
One thing that I think we should change is how we refer to the ‘weak’ type
hints. The word ‘weak’ has a negative ring to it, and considering this is
how the language behaves across the board it’s a pretty bad name for this
feature.
Borrowing from C#, I would suggest the names implicit and explicit argument
types. There is nothing "weak" about them, they just do an implicit
conversion which can be quite powerful if used correctly.
In the future, I hope that we will have implicit object conversions in
addition to the scalar ones.
Lazare INEPOLOGLOU
Ingénieur Logiciel
-----Ursprüngliche Nachricht-----
Von: Lazare Inepologlou [mailto:linepogl@gmail.com]
Gesendet: Dienstag, 31. März 2015 00:01
An: Christoph Becker
Cc: Zeev Suraski; PHP internals
Betreff: Re: [PHP-DEV] Re: Naming of 'weak' type hintsZeev Suraski wrote:
One thing that I think we should change is how we refer to the ‘weak’
type hints. The word ‘weak’ has a negative ring to it, and
considering this is how the language behaves across the board it’s a
pretty bad name for this feature.Borrowing from C#, I would suggest the names implicit and explicit argument types. There is nothing "weak" about them,
they just do an implicit conversion which can be quite powerful if used correctly.
[Robert Stoll]
It's probably hard to come up with something which does not conflict with another concept, but implicit and explicit typing is used to refer to two sub categories of static typing. Explicit typing refers to code which requires explicit type specifications written by the user and implicit typing is the case where type inference infers the types.
I am not so sure if it is clever to use an own name for type hints when strict_types=1 since the type hint as such is not different, the context is different. I am think about it in the sense that a function has different overloads and depending on the context some are available and others are not (similar to the callee of a method call, strict_types=1 can be seen as another argument). But I guess that is too complicated for a documentation. Nevertheless, I would put emphasis on the fact that the context is different.
In the future, I hope that we will have implicit object conversions in addition to the scalar ones.
[Robert Stoll]
That would be nice :)
Lazare INEPOLOGLOU
Ingénieur Logiciel
Hi!
One thing that I think we should change is how we refer to the ‘weak’ type
hints. The word ‘weak’ has a negative ring to it, and considering this is
I would really prefer we stop calling it "hints". It is misleading as it
is implying this is something which can be easily ignored if wished and
only provides an unimportant small piece of information not directly
related to the important things. In fact, it would either change the
type of the value or produce fatal error, it's hardly a "hint".
Stas Malyshev
smalyshev@gmail.com
All,
One thing that I think we should change is how we refer to the ‘weak’ type
hints. The word ‘weak’ has a negative ring to it, and considering this is
how the language behaves across the board it’s a pretty bad name for this
feature.Personally I think we should go for ‘dynamic’ when we document it, as this
is the common way to refer to this behavior (dynamic languages). We could
also consider going for ‘lax’ or ‘lenient’ as the opposite of ‘strict’,
although I think we can easily do without introducing a new word into the
vocabulary here.Thoughts?
Zeev
Hello,
I would definitely stick with "weak"; it is common naming used across
many languages and textbooks.
Also, why is the strongly typed mode named "strict" anyways? If
anything should change, it should be strict to strong, so PHP doesn't
look like a special snowflake.
Regards
Pavel Kouril
Pavel,
Hello,
I would definitely stick with "weak"; it is common naming used across
many languages and textbooks.Also, why is the strongly typed mode named "strict" anyways? If
anything should change, it should be strict to strong, so PHP doesn't
look like a special snowflake.
Strong has a very specific meaning, which PHP is not using. For
example, Python variables are strongly typed (meaning it's restrictive
about how types are intermingled). So while "x" + 3 in JavaScript
(another weakly typed language) is "x3", in python it would be a type
error (assuming "x" + 3).
PHP's overall type behavior is still weak at the variable level. The
difference is that strict type declarations require types to match at
the point of parameter passing. But it doesn't make the variable
strongly typed.
As far as "weak", that's the description of the type system in
general. However as far as type declarations are concerned, I think it
would be fair to talk about the two modes as "coercive" and "strict".
Anthony
Hi!
general. However as far as type declarations are concerned, I think it
would be fair to talk about the two modes as "coercive" and "strict".
I think this is a good option.
Stas Malyshev
smalyshev@gmail.com
-----Original Message-----
From: Stanislav Malyshev [mailto:smalyshev@gmail.com]
Sent: Wednesday, April 01, 2015 10:12 AM
To: Anthony Ferrara; Pavel Kouřil
Cc: Zeev Suraski; PHP internals
Subject: Re: [PHP-DEV] Naming of 'weak' type hintsHi!
general. However as far as type declarations are concerned, I think it
would be fair to talk about the two modes as "coercive" and "strict".I think this is a good option.
Seems like this is the one that has the most supporters and I agree it makes
sense. +1 from me.
Zeev
Personally I think we should go for ‘dynamic’ when we document it, as this
is the common way to refer to this behavior (dynamic languages). We could
also consider going for ‘lax’ or ‘lenient’ as the opposite of ‘strict’,
although I think we can easily do without introducing a new word into the
vocabulary here.
soft and hard?
And as long as we don't add any hints it is still 'no type hinting' ?
--
Lester Caine - G8HFL
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk
De : Zeev Suraski [mailto:zeev@zend.com]
One thing that I think we should change is how we refer to the ‘weak’ type
hints. The word ‘weak’ has a negative ring to it, and considering this is
how the language behaves across the board it’s a pretty bad name for this
feature.
What about 'loose' vs 'strict' type hinting ?
All,
One thing that I think we should change is how we refer to the ‘weak’ type
hints. The word ‘weak’ has a negative ring to it, and considering this is
how the language behaves across the board it’s a pretty bad name for this
feature.Personally I think we should go for ‘dynamic’ when we document it, as this
is the common way to refer to this behavior (dynamic languages). We could
also consider going for ‘lax’ or ‘lenient’ as the opposite of ‘strict’,
although I think we can easily do without introducing a new word into the
vocabulary here.Thoughts?
Zeev
Coercive?
--
Regards,
Terry Cullen
Freelance Senior PHP Programmer/Web Developer
Phone 1300-955-838 <+61-1300-955-838>Mobile 04-3836-8032 <+61-4-3836-8032>
Email terry@terrycullen.com.auWeb http://www.terrycullen.com.au/G-Talk
terry@terrycullen.com.au13 Jarrott St, ChelmerTerah Pty Ltd | ACN 135 365
552 http://www.terrycullen.com.au/[image: Terah Pty Ltd logo]
<http://www.terrycullen.com.au/
On Monday, March 30, 2015, Christoph Becker <cmbecker69@gmx.de
javascript:_e(%7B%7D,'cvml','cmbecker69@gmx.de');> wrote:
It appears to me that all of these suggestions may hide the fact that
the arguments are converted to the hinted types. So perhaps "converting
type hints" might be a good name.
"Coercive" may be a concise term, without the negative connotation of
weak/lax.
--
jeremy mikola