Hi All.

Am 14.01.17 um 11:03 schrieb Fleshgrinder:
> On 1/13/2017 8:24 AM, Wes wrote:
[…]
> On 1/13/2017 8:24 AM, Wes wrote:
>>> the only reason for prohibiting explicit __construct calls is that it makes
>>> PHP objects mutable
>>
>>
>> then don't call it explicitly, exactly like you wouldn't use reflection to
>> call private methods
>>
> 
> This is one possible answer to this issue. The question is whether PHP
> wants to protect developers from errors and help reduce bugs by
> enforcing things or wants to be a purely convention based language and
> leave it developers to use it correctly.
> 
> I am completely in favor of #1 and you seem to be in favor of #2.
> 
> I actually have the impression that it is not defined which of both PHP
> actually is or wants to be. The introduction of scalar type hints in PHP
> 7 definitely points towards #1 but it could just be an outlier.

Do we as "makers of PHP" want to dictate the user what the "intended"
behaviour of PHP is? Or are we treating the user as a responsible person
that knows what to do and also not to do?

Personally I'm in favour of the later. Let the user be able to call
__construct whenever they like. It's a special method which is clearly
visible by the two underscores at the start. So the users either know
exactly what they are doing or they need to learn it.

Translated to a different example this discussion is like: "Let's remove
the handle from the window because someone might be able to open the
window and jump out of it". The handle is there for a valid reason. And
as a window-maker I have no idea in what way it might be used. But I
have to accept that there are people missusing it. But should I limit
all those users with a valid use-case for it just to save some from
missusing it? And if we start with that, where should we stop?

Just my 0.02€

Cheers

Andreas
> 


-- 
                                                              ,,,
                                                             (o o)
+---------------------------------------------------------ooO-(_)-Ooo-+
| Andreas Heigl                                                       |
| mailto:andr...@heigl.org                  N 50°22'59.5" E 08°23'58" |
| http://andreas.heigl.org                       http://hei.gl/wiFKy7 |
+---------------------------------------------------------------------+
| http://hei.gl/root-ca                                               |
+---------------------------------------------------------------------+

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to