Sorry, I messed up the link to the pull request: https://github.com/apache/commons-numbers/pull/36
On 6/12/19 3:00 PM, Heinrich Bohne wrote:
I have been asked to request some feedback on this pull request: https://github.com/apache/commons-numbers/pull/36– specifically, about the introduction of code blocks in the commit "NUMBERS-100: Reduce scope of local variables". I had the idea with the code blocks when I wanted to add a test to the method testAdd() but was intimidated by the huge wall of code contained in the method. When taking a closer look, this code wall is actually composed of several test cases that are completely independent of each other, but because the local variables live throughout the whole method and are re-used in almost every test case, this is not obvious. The more variables are involved, the closer you have to look to figure out which sections are independent of the rest. I think that, with the code blocks, it is instantly obvious that a specific section does not depend on anything that happened before it, or that it does not affect anything that comes after it. So I think that they are preferable to the previous version of the file.
--------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org