Re: [RFC] Return Type Declarations pre-vote follow-up
Hi!
> For context/background. Hack has deliberately resisted doing this
> since we consider the types to be an integral part of the language.
I understand this, and this is a completely valid way of thinking. But I
think it's a way, not "the way".
> So in our opinion putting things in docblocks just compounds this
> problem and can be pretty dangerous if nothing is enforcing them at
> runtime.
Static analysis and runtime enforcement are different things. Of course,
you can do both and they reinforce each other, but I was talking about
specifically the point that claimed that "Hack has shown the way". There
are other ways to do static analysis (including annotations and type
derivation), and as far as I understood from the previous discussion,
Hack doesn't enforce types at runtime consistently either, due to
integration/BC considerations. So, in my opinion, switching from
annotations in docblocks to non-binding annotations in the language
doesn't really change the equation with regard to static analysis
capabilities.
> So this may or may not be a good idea for your use case (I've
> honestly kind of lost where this branch of the email thread was
> going), but that's why we haven't done it for Hack.
Thank you for explaining it.
--
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227
Thread (15 messages)