The winding road to PHP 8's match expression
The winding road to PHP 8's match expression
Posted Sep 2, 2020 21:41 UTC (Wed) by mathstuf (subscriber, #69389)In reply to: The winding road to PHP 8's match expression by professor
Parent article: The winding road to PHP 8's match expression
This mentality works for solo projects (and even then, more towards the one-off end of things). In my experience, having such sharp tools laying around with opt-in safety mechanisms make code review and later maintenance much harder. An explicit `fallthrough;` statement would have been a better solution rather than `break;`. Why? I find fallthrough to be the rarer case. Sure, Duff's device is cool and all, but I've written one maybe once? Seen it only a few other times? Making it have a few more keyword instances would have been fine (especially since your indentation is already all kinds of whack most of the time, doing `fallthrough; case …` would probably have worked).
> "i want everything on a silver plate and stuff i dont know about is someone else´s fault and thefor bad design" is just weird
I know about it and I even use it sometimes. I still comment when I explicitly mean for fallthrough to happen because I'm not the only one working on the code in question (even if another person isn't, years-later me might have to figure out what the code in question is doing anyways).
Posted Sep 2, 2020 22:29 UTC (Wed)
by professor (subscriber, #63325)
[Link]
This part i dont understand at all..
"Sure, Duff's device is cool and all, but I've written one maybe once? Seen it only a few other times? Making it have a few more keyword instances would have been fine (especially since your indentation is already all kinds of whack most of the time, doing `fallthrough; case …` would probably have worked)."
The winding road to PHP 8's match expression
