This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
In the maybeNew class, there are 2 returns (they are not seperated with a else).
- The example before was clear but i ll explain (just to be sure)
Lets say giveSecret was 5, so the return 42 makes the value 42 now. - Back to the other code. Where do the returns go? -> maybeNew = 0? But why are there 2 returns. Does the compilier make the value first 1 and then 0? Isnt it useless to use 2 returns or just for the example?