News for hackers. Stuff that matters.

SecondRikudo

Re:Anti-Pattern of the Day: Type Keys on Monday January 02, 2023 @11:08AM (#34219463)
I mean... you already have user.setupNotifications() in your example... the obvious solution would have been a polymorphic user.setup() which is a different implementation for the CustomerUser class and the AdminUser class... if you've already picked OO as your paradigm of choice, at least exploit it for its value, you've already paid the costs.
Re:React: The Perils of Rehydration on Monday December 06, 2021 @04:18AM (#29457748)
My primary issue is that you guys did have other options. You did. I saw the RFC thread. About 2/3s were useless "oh no" or "oh yes" comments, but about a third had suggestions and feedback, some good feedback, on how to make the stateful function API not as jarring and not as weird. You simply ignored it all, since you already had an API in mind (and perhaps already did most of the work, I don't know)

That you thought (correctly) that an eslint package of rules was necessary to prevent people from shooting themselves in the foot with the gun you have provided should have been a hint that it's not good API.