Nested calls vs Linear pipeline: Which is easier to read?
Nested (inside-out reading)
save(
clean(
load(
"data.csv"
)))
1
load
2
clean
3
save
Read inside-out?
Hard to follow!
execution order:
3 ( 2 ( 1 ( ) ) )
Linear (left-to-right reading)
data
=
load
(
"data.csv"
)
data
=
clean
(data)
save
(data)
load()
clean()
save()
Easy to
follow!
Read top to bottom, left to right. Each step is one line.