2 ms·
I like this for some things where the logic is somewhat large-ish, but also strongly coupled. A good example is setting up state for integration tests; I'm not
by arp242 4y ago
I like this for some things where the logic is somewhat large-ish, but also strongly coupled. A good example is setting up state for integration tests; I'm not going to re-use any functions I create for that. It's not bad to use functions, I just find it more convenient to keep it all in one function, but split out a little bit in these faux-subfunctions.
I don't use it often, but when I do, I find it convenient.
- jerf 4y ago"A good example is setting up state for integration tests; I'm not going to re-use any functions I create for that." And if it turns out I'm wrong about that, the braces provide a very nice, guaranteed cutting point in the future that anyone can understand without having to load all the context of the function. This isn't the sort of thing I want splattered all over a code base, but it is a nice niche tool.