3 ms·
they are all gathered at once.the following lines could assume any combinations of those conditions. in simple examples it is not an issue but as the function g
by yonixw 8y ago
they are all gathered at once.the following lines could assume any combinations of those conditions. in simple examples it is not an issue but as the function get more complex I found it excruciating.
- aw1621107 8y ago> the following lines could assume any combinations of those conditions. Do you mind expanding a bit more on this? From what I understand, if you have early returns the only way you can get into the rest of the function is if all of the conditions pass, not any arbitrary combination of them. Also, do you have an example of a more complex function with early functions that you find difficult to read?
- de_watcher 8y agoI just soak everything in asserts. That way there is no need to scroll up for preconditions, be it a nested tree or some returns at the start. And when you move a small piece of code, you're told exactly what you should be thinking about, you need to decide what to do with that assert that represents an assumption.