-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFunctions.java
More file actions
21 lines (14 loc) · 771 Bytes
/
Functions.java
File metadata and controls
21 lines (14 loc) · 771 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
public class Functions {
//The first rule of functions is that they should be small.
// The second rule of functions is that they should be smaller than that.
//Do One Thing
//FUNCTIONS SHOULD DO ONE THING. THEY SHOULD DO IT WELL. THEY SHOULD DO IT ONLY.
//One Level of Abstraction per Function
//Mixing levels of abstraction within a function is always confusing.
// Readers may not be able to tell whether a particular expression is an essential concept or a detail
//Use Descriptive Names
//Don’t be afraid to make a name long.
// A long descriptive name is better than a short enigmatic name.
// A long descriptive name is better than a long descriptive comment.
//Prefer Exceptions to Returning Error Codes
}