3 ms·
Ah I do this with if() block folding in Vim. In this case, the developer actually has return statements inside some if blocks. A general point that has stood o
by pinkunicorn 11y ago
Ah I do this with if() block folding in Vim.
In this case, the developer actually has return statements inside some if blocks. A general point that has stood out from all comments is to first understand how the function achieves what the function is trying to achieve.
- odonnellryan 11y agoA return point inside an if statement is a great place to do a refactor. Refactor anything inside that if into its own function, write a test, and see what happens :)