3 ms·
You know, the word "inexplicable" roughly means "some form of thing that I can't explain". Just like your "some form of middleware" without an explanation. It
by mattmanser 10y ago
You know, the word "inexplicable" roughly means "some form of thing that I can't explain".
Just like your "some form of middleware" without an explanation.
It's inexplicably giving up control of the context in the middle of a simple if statement, not once, but TWICE, with no discernible reason for doing so. That part of the program's not making any sort of IO calls or database calls or anything.
What the hell is it awaiting? What does the function next() even do, that is's so poorly named?
- orf 10y agoIt exactly means 'unable to be explained or accounted for'. If you have no domain knowledge then yeah, it's going to be confusing. Not inexplicable. Confusing. If you've never heard of middleware then yeah, it's going to be a bit confusing. If you genuinely don't know then middleware is pretty simple. Imagine a stack of functions, each one taking a HTTP request and returning a HTTP response. Each middleware can meddle with the request and/or the response and pass control up the chain. Imagine a middleware that detects if the request is authenticated, and if not returns a 403 status code. If they are authenticated it passes control to the next middleware up the chain. next() is how you call the next middleware in the chain. It's awaited because future middleware can be asynchronous. Irrespective of if you know what next() does it's pretty easy to infer. At least I think. Your millage clearly varies, but it's not because of "these damn over complicated tools that the damn kids on my lawn are using". Harking back to the shitty, insecure, monolithic messes that the 00's produced and saying how simple they all where is... wrong, at best.