On Fri, Aug 23, 2024, at 20:27, Bruce Weirdan wrote:
> On Fri, Aug 23, 2024 at 4:27 PM Larry Garfield <la...@garfieldtech.com> wrote:
>> Moving those definitions to attributes is certainly possible, though AFAIK 
>> both the PHPStan and Psalm devs have expressed zero interest in it.
>> Part of the challenge is that such an approach will either still involve 
>> string parsing,
> 
> That's not really a challenge and would help somewhat with the current status 
> quo where we have to guess where the type ends and the textual part of the 
> comment begins. But it gets ugly for any type that has to include quotes 
> (literal strings, array keys, etc). Technically one can use nowdocs, but it's 
> not much better:  https://3v4l.org/4hpte
>  
>> or will involve a lot of deeply nested attribute classes. 
> 
> Yeah, that would look like Lisp's S-exprs, but much worse - which, in my 
> opinion, would harm adoption.
> 
> All in all, in my opinion attribute-based solutions are less ergonomic than 
> what we already have now in docblocks.
> 
> --
>   Best regards,
>       Bruce Weirdan                                     
> mailto:weir...@gmail.com

Thank you Larry for expressing some of the problems. Is there any reason 
nesting has to be supported out of the gate? Think about type hints. It started 
with some basic functionality and then grew over time. There is no reason we 
have to have a new kitchen sink, oven, dishwasher and stove when all we want is 
a new refrigerator. 

— Rob

Reply via email to