Guest User

Untitled

a guest
Jul 16th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. When to write a function
  2.  
  3. It's never necessary. It's just good programming style.
  4. I need to do many simple but related operations one after another to perform one complicated task that has a well defined result.
  5. I need to change the algorithm I have hard coded to the program but I know that if I erase it I can't get the program working again.
  6. I need to add together two numbers and I repeat that many times in my program.
  7. I want to test a piece of code separately from the other program.
  8. I need to complete two unrelated operations with the same data.
  9. I need to repeat the same procedure with different data.
  10. Two programs need to do the same kind of calculation.
Add Comment
Please, Sign In to add comment