You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure what you're suggesting is a good idea. @DrBoolean is obviously right that the semantics differ per class. I think you can find good literature that centralizing logic that should be decentralized leads to all sorts of antipatterns (the least of which is having a single union that handles all cases). It'll become the highest traffic file in this repo and, unless you want a couple hundred line file, will still have to delegate to modules per class, making it something akin to a leaky abstraction...
edit: dig a little deeper before commenting Steven 😞. So this repo lives in a single file, so that concern isn't relevant (not until the repo grows a lot anyway). That being said, that union or switch or whatever structure you use for the logic would still live in Collection.prototype.<methodName>, which would still be a code smell.
I'd still like to contribute, I could whip up a table of structures, the algebrae they implement, some notes so that people can pick them for contribution?
Activity
DrBoolean commentedon Jun 22, 2018
That's a good idea for aliases, but i'd think the implementation differs for most datatypes. In any case, a cool thing to try!
StevenLangbroek commentedon Feb 10, 2019
I'm not sure what you're suggesting is a good idea. @DrBoolean is obviously right that the semantics differ per class. I think you can find good literature that centralizing logic that should be decentralized leads to all sorts of antipatterns (the least of which is having a single union that handles all cases). It'll become the highest traffic file in this repo and, unless you want a couple hundred line file, will still have to delegate to modules per class, making it something akin to a leaky abstraction...
edit: dig a little deeper before commenting Steven 😞. So this repo lives in a single file, so that concern isn't relevant (not until the repo grows a lot anyway). That being said, that union or switch or whatever structure you use for the logic would still live in
Collection.prototype.<methodName>, which would still be a code smell.I'd still like to contribute, I could whip up a table of structures, the algebrae they implement, some notes so that people can pick them for contribution?