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
Copy file name to clipboardExpand all lines: docs/developing-flows/readability.md
+10-8Lines changed: 10 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,9 +5,9 @@ title: Improving readability
5
5
---
6
6
### Align nodes
7
7
8
-
<!--
8
+
{% comment %}
9
9
*As the size of the application increases, the process of flow will become complicated, which decreases readability and understandability. One of the key points to improve readability and understandability is a proper node alignment such that flows of one function are adjacent to each other. This chapter shows effective node alignment.*
10
-
-->
10
+
{% endcomment %}
11
11
12
12
A key feature of Node-RED is the ability to create applications without programming ability, provided the application is small and its processing is easy to follow.
13
13
However, as application size increases, visual programming could suffers an effect similar to the "spaghetti code" of general programming.
@@ -105,11 +105,11 @@ It is recommended that you use flow names of 15 or fewer characters.
105
105
106
106
### Using proper nodes
107
107
108
-
<!--
108
+
{% comment %}
109
109
*Each node can be used flexibly. For example, a function node can cover the same function of Change node, Switch node and so on. However, using a proper specialized node for your objective contributes improving understandability of your flows. This chapter introduces the roles and usage of core nodes such as **Change, Switch, Template, Link, HTTP**.*
110
110
111
111
*The **Function** node and **Exec** node are useful for JavaScript and other language developers because they can write JavaScript codes and commands directly. However, heavy use of them makes understanding of flow difficult for other developers. This chapter describes a caution of these nodes and shows examples of alternative methods against Function node and Exec node.*
112
-
-->
112
+
{% endcomment %}
113
113
114
114
Each type of node has an expected role.
115
115
For example, a `Change` node is expected to perform processing that changes the value of a variable.
@@ -198,9 +198,11 @@ Use `Exec` nodes as little as possible, and keep these concerns in mind when doi
198
198
### Changing icon
199
199
200
200
When the same kind nodes are in the flow (e.g. a case that managing a large number of devices with `MQTT` nodes), it is difficult to distinguish nodes. But, it can be solved by designating different icons for each node.
201
-
<!--
201
+
202
+
{% comment %}
202
203
This chapter introduces the procedure for changing the icon and some Use Cases.
203
-
-->
204
+
{% endcomment %}
205
+
204
206
Something to keep in mind is that overusing the icon changing function can in fact make it more difficult to identify nodes on sight.
205
207
You need to take care to maintain a balance.
206
208
@@ -270,13 +272,13 @@ This might include, for example, any changes it makes to `global` and `flow` con
270
272
271
273
### Refactoring
272
274
273
-
<!--
275
+
{% comment %}
274
276
*It is better to check and refactor the developed flows before presenting it to other developers. This section shows refactoring points such as followings,*
275
277
276
278
1.*Coding Style*
277
279
2.*Flow implementation*
278
280
3.*Readability and reusability*
279
-
-->
281
+
{% endcomment %}
280
282
281
283
We recommend that flow developers perform refactoring of the flows they develop to improve legibility.
282
284
While we expect developers to have followed these guidelines in all aspects of development, this section provides a list of key areas to focus on when refactoring flows.
0 commit comments