You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Flow is an utility/ design pattern that help developers to write simple and readable codes.
8
+
Flow is an utility/ design pattern that help developers to write simple and readable code.
9
9
There are two main concerns:
10
10
`Flow of operations and Flow of data`
11
11
12
12
By using Flow, we should able to achieve the followings:
13
13
- Logics / operations can be reused easily
14
14
- The logic flows are readable by anyone (including the code reviewers)
15
-
- Each line of codes is meaningfully and avoid ambiguous keywords
15
+
- Each line of code is meaningfully and avoid ambiguous keywords
16
16
- No more callback hell for complicated async operations
17
17
- Debuggable both at development and production stage
18
18
@@ -35,8 +35,8 @@ Here is an example for simple usage:
35
35
In these 5 lines of code, we can know that two operations will be executed in serial and able to do something before and after the operations.
36
36
37
37
## Naming
38
-
To make the logic readable, it is important to make the operation's name meaningfully. It is developer's responsibility to make a good name. Also, the name also determine the degree of reusable of codes.
39
-
e.g. If you create an operation named: `SimplePrintOp`, it should contain only the codes to print the message associated with it. You should NOT do anything out of the context of the name. Such as sending the message to server / write to file.
38
+
To make the logic readable, it is important to make the operation's name meaningfully. It is developer's responsibility to make a good name. Also, the name also determine the degree of reusable of code.
39
+
e.g. If you create an operation named: `SimplePrintOp`, it should contain only the code to print the message associated with it. You should NOT do anything out of the context of the name. Such as sending the message to server / write to file.
40
40
41
41
Also, all operations made for Flow should share a common suffix (e.g. Op) so all developers can know that there are operations that ready for reuse.
42
42
@@ -263,7 +263,7 @@ You can trace the data changes, how the operations run in one place. You can sen
263
263
264
264
## Why not RxSwift?
265
265
Surely RXsSwift is much more powerful in some aspects.
266
-
BUT I think it's always good if we can make our codes: `Simple and Human readable`
266
+
BUT I think it's always good if we can make our code: `Simple and Human readable`
267
267
With `Flow`, even code reviewers and non-programmer can understand your logic in the blueprint.
0 commit comments