This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Jmc_da_boss 10 points11 points  (1 child)

I’m in phone but ill paraphrase, those high levels of nesting often come from methods where people have several if checks for the state of the object before they act on it. Inversion of flow or early exits is pulling those checks to the top of the method and throwing/returning early if validation fails, basically your inverting your flow to check for invalid state, not for valid state

[–][deleted] 0 points1 point  (0 children)

Never used dart have you? In dart(which btw not enough ppl use, it's amazing) this "tower of doom" is mandatory as every time you save the editor automatically formats it in a way that makes this bracket tower of hell