-
Notifications
You must be signed in to change notification settings - Fork 41
/
17-general-guidelines.Rmd
208 lines (127 loc) · 4.3 KB
/
17-general-guidelines.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
# General guidelines
Big apps or big teams == New challenges
- Organisation
- Stability
- Maintainability
## "Best practices" section of the book
- Software engineering approach & mindset (today's chapter)
- Decomposition:
- into functions
- into modules
- Organisation
- into packages
- Stability
- Testing
- Security
- Performance
## Software engineering
```{r, echo = FALSE}
library(DiagrammeR)
```
```{r, echo = FALSE}
mermaid("
graph LR
A[\"I don't understand it\"]-->B[\"I still need the docs\"]
B-->C[\"I understand it fluently\"]
")
```
## Code organization
Empathy
Code clarity
Comments
Function size
Copy/Paste development
Shiny: functions, modules
## Testing
What is a "test plan"
Why does testing improve stability of an app
Automation vs Manual
Test types:
- Unit, Integration, Functional, Load ....
- Testing behaviour vs Testing components
Can you have _too many_ tests
Can you have the _wrong kind_ of tests
## Dependency management
Reproducibility
Environment management: `{renv}`, `{packrat}`, conda, docker, `sessionInfo()`
Configuration: `{config}`
Are there different reproducibility requirements for
- an app vs
- an analysis project?
When should you have different configurations for an app?
The filesystem as part of the environment
## Source code management
R uses svn: [https://github.com/r-devel/r-svn#readme]()
Did anyone use 'git' for the first time during the bookclub
Related tools for version control-type things (tracking changes etc)
Anyone using version-control systems other than git?
What are the benefits and pain-points of git / github etc?
## Continuous integration / Continuous deployment
Continuous integration for an app
- what things would you run?
The bookclub as an example of continuous deployment
## Code reviews
A fresh pair of eyes
Speeds up learning (try contributing to an R package, and see how much you don't yet know)
Tricks to speed up code-review?
Who should review who?
Code review antipatterns?
Alternatives / complements? pair programming
## Meeting Videos
### Cohort 1
`r knitr::include_url("https://www.youtube.com/embed/stfuGTNJD2M")`
<details>
<summary> Meeting chat log </summary>
```
00:06:04 russ: Hi everyone
00:06:14 russ: Hopefully we can have a discussion today
00:06:35 russ: I've put some notes into the bookclub book, but haven'thad them merged yet
00:12:38 andrew bates: https://blog.rstudio.com/2021/03/11/time-to-shiny/
00:53:28 russ: cache?
00:53:52 andrew bates: https://shiny.rstudio.com/app-stories/weather-lookup-caching.html
01:04:33 Federica: thanks
```
</details>
### Cohort 2
`r knitr::include_url("https://www.youtube.com/embed/aQHyWOEvJAI")`
<details>
<summary> Meeting chat log </summary>
```
00:27:24 Kevin Gilds: https://www.rostrum.blog/2021/04/14/gha-readme/
00:27:42 Kevin Gilds: Update README with Github actions
00:51:26 collinberke: https://www.youtube.com/watch?v=BEyiFVWaTtc&list=PL3x6DOfs2NGjtn1_4BSX99R5wrLjK7XvY&index=19
00:51:35 collinberke: https://www.youtube.com/watch?v=tWEa6JwlJ3c&list=PL3x6DOfs2NGjtn1_4BSX99R5wrLjK7XvY&index=21
```
</details>
### Cohort 3
`r knitr::include_url("https://www.youtube.com/embed/JdisqyPzfHo")`
### Cohort 4
`r knitr::include_url("https://www.youtube.com/embed/7b5UQvzgPxo")`
<details>
<summary>Meeting chat log</summary>
```
00:22:45 Trevin Flickinger: Hi everyone 👋
00:22:58 Lydia Gibson: Hello
00:28:45 Trevin Flickinger: No questions
00:28:48 Lucio Cornejo: all good so far
00:32:54 Trevin Flickinger: yes
00:36:03 Trevin Flickinger: I can see it now
00:36:11 Trevin Flickinger: Sorry I can only type today
00:44:31 Matthew Efoli: https://dcl-prog.stanford.edu/purrr-parallel.html#:~:text=The%20pmap()%20functions%20work,to%20supply%20to%20your%20function.
00:59:07 Lucio Cornejo: session = getReactiveDomain()
01:00:04 Lucio Cornejo: session = getDefaultReactiveDomain()
01:01:04 Trevin Flickinger: We’ll get more into sessions next week with modules
01:01:55 Lucio Cornejo: same over here
01:03:16 Trevin Flickinger: Thanks Matthew! Nothing from me
01:03:41 Trevin Flickinger: See everyone next week 😄
01:03:41 Lucio Cornejo: Also excited for next week. Thank you, see you next everyone
```
</details>
### Cohort 5
`r knitr::include_url("https://www.youtube.com/embed/URL")`
<details>
<summary>Meeting chat log</summary>
```
LOG
```
</details>