Начать. Это бесплатно
или регистрация c помощью Вашего email-адреса
Function создатель Mind Map: Function

1. Don't Repeat yourself

2. Structured Programming

2.1. should only be one return statement in a function, no break or continue statements in a loop, and never, ever, any goto statements. But, if function is small -> multiple return, break, or continue statement does no harm and can sometimes even clearly

3. Write function?

3.1. code come out long and complicated has lots of indending and nested loop, arguments, no-good name, duplicate code ==> splitting out functions, changes name, no duplication code, reorder function, break out classes, keep the tests passing.

4. function arguments

4.1. [0,2]

5. switch statements

5.1. always do N things, duplicate code, ... ==> abstract factory

6. Do one thing

6.1. stepdown rule

7. Command query separation

8. Prefer Exceptions to Returning Error Codes

8.1. Extract Try/Catch Blocks

8.1.1. try/catch blocks confuse the structure of the code and mix error processing with normal processing ==> extract bodies of try and catch out into functions.

8.2. The Error.java Dependency magnet

8.2.1. should not define error code

8.3. Error Handling is one thing

8.3.1. Functions should do one thing. Error handing is one thing. Thus, a function that handles errors should do nothing else

9. Have no side effects

10. use descriptive names

11. one level of abstraction per function

12. Small