> On Oct 5, 2021, at 3:18 PM, Dan Ackroyd <dan...@basereality.com> wrote: > > On Tue, 5 Oct 2021 at 18:47, Mike Schinkel <m...@newclarity.net> wrote: > >> Consider the `Type` class[3] in the `SebastianBergmann\Type` namespace. It >> contains 60 lines of function declaration to define 14 functions that all >> return `false`. > > PHP allows you to define functions on one line: > > function isCallable(): bool { return false; } > function isFalse(): bool { return false; } > function isGenericObject(): bool { return false; }
The benefit I was proposing was not just fewer lines, but also reduced visual complexity making it easier to read and comprehend code quickly. Your argument addresses the former benefit but not the latter. > If you don't like having functions take up lots of lines, it's easier > to just not follow that PSR guide line on formatting, It is not always easier for developers where whose organizations dictate code standards. Besides, your alternative is a bit reductio ad absurdum. > rather than modify the language. You state this without justification that it has been established that changing the language is a bad thing. If that were true, why does the RFC process even exist as in most cases RFCs are passed to change the language? -Mike -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php