3 ms·
The functional version would chain these statements (either implicitly with temporary variables or explicitly with bind), so it became obvious which depends on
by fegu 12y ago
The functional version would chain these statements (either implicitly with temporary variables or explicitly with bind), so it became obvious which depends on which.
As it is now, you can't be sure if foo.setBar(bar) changes bar, and you can't be sure if dao.update(foo) changes bar. You also can't be sure if foo is the same before and after addBar.
Imagine coming back two years later to add some functionality here. You can either read all the other functions or you can rely on the choice of verbs to guess. In functional code, you won't have to guess (as much).