Default args and function composition bruh
-
-
-
Replying to @chaosprime @danlistensto
Recently had this discussion re: locales (or TZ, …) as a process-wide thing in e.g. web servers. Passing through of all these things entirely impractical, as is creating closures/partials for a hundred functions. Hate thread/request locals.
1 reply 0 retweets 2 likes -
Best I got is something like computing these data from request and memoizing it with a MRU LUT; request as a parameter is usually in scope. Still vaguely suckish, but at least explicit yet up-front practical. Anything nicer?
1 reply 0 retweets 2 likes -
Replying to @ITBeHa @danlistensto
if request as a parameter is in scope, you're half a step away from passing around a context model that provides request, memoized localization what-have-you, etc
1 reply 0 retweets 4 likes -
Replying to @chaosprime @danlistensto
Yeah, that’s a nice model. I wish pedestal had better documentation.
1 reply 0 retweets 2 likes -
Aren’t you a static types practitioner tho? How do you work with plugging arbitrary context model data into statically defined values?
1 reply 0 retweets 2 likes -
Replying to @ITBeHa @danlistensto
not mainly, but when i am i'd make the context model data not arbitrary if i could (like, the set of things i'm going to want to know about localization is well-defined), make crappy generic abstractions if i couldn't
2 replies 0 retweets 2 likes -
Replying to @chaosprime @ITBeHa
yes hello this is $_POST and I'd like to talk to your manager
2 replies 0 retweets 3 likes -
Replying to @danlistensto @ITBeHa
i have no idea what you mean, sure it's exactly like $_POST but it's not in a weird more-global-than-global variable, it's in a nice well-behaved object being explicitly passed instead, and therefore nice and good and beyond reproach
2 replies 0 retweets 3 likes
also be careful about talking to my manager, we're probably going to be hiring for devops soon
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.