@nicksdot@notpsychxpath Comments are discarded as non-semantic before the language acts on them, which means they create neither a contract nor enforceable syntax.
@nicksdot@notpsychxpath Comments are discarded as non-semantic before the language acts on them, which means they create neither a contract nor enforceable syntax.
@nicksdot@notpsychxpath 2. Putting aside subjective readability claims, comments are intentionally ignored by PHP before the script is processed. Real erased generics are syntax the language can parse, validate, reflect on, and then erase.
@nicksdot@notpsychxpath PHPDoc generics aren’t erased generics. They’re imaginary. The contract is a sticky note, the checker is optional, and PHP itself has no idea you promised anything, because comments are not syntax, and making them syntax defeats their point.
@nicksdot@notpsychxpath Personally, I believe that anything “official” should carry with it an official syntax, allowing comments to serve their original purpose (describing code).
@nicksdot@notpsychxpath When people make sweeping statements like “there is no argument” it’s generally when I stop taking them seriously. We are better off approaching a conversation with open minds and desiring to see the alternative perspective and then making a reasonable argument.
@nicksdot@notpsychxpath There is no syntax or structure tied to comments, nor could you force one.
If PHPDoc comments are good enough for this, why weren’t they good enough for primitives?
@nicksdot@notpsychxpath I adore C# for how similar it is to PHP’s syntax and I loath how frequently I have to pick it up for things like this where I’d rather use PHP.
@nicksdot@notpsychxpath Same argument could be made for primitive types. Thank goodness Internals was smarter than that then and I hope it is smarter than that now.
Comments have been well stretched beyond their intended use.
@nicksdot@notpsychxpath I’m a PHP fan boy for 20+ years now, so I’m going down with the ship, but we desperately need some movement here or we’re going to start becoming irrelevant.
@nicksdot@notpsychxpath Native erased generics are not some kind of unreadable disaster. They are very in line with the syntax taken by fairly elegant languages like C#.