by cupofjoakim · 6mo ago · 0 comments
Perhaps it's just one point from me - not liking chaining :D
Strictly speaking I assume everyone knows O(n) = O(2n) =O(kn) for k in R.
But I see your point. I assume any decent compiler would merge the loops though
At least for me,
thing
.doThis()
.thenDoThat()
.andFinallyThis()
is much more readable than andFinallyThis(
thenDoThat(
doThis(thing)
)
)``` thing.doThis() thing.thenDoThat() thing.andFinallyThis()
// or
doThis(thing) thenDoThat(thing) andFinallyThis(thing) ```
Of course, blorp also allows local mutation in loops (even in pure functions, so long as the logic is contained to the function), so if there's a specific algorithm you'd rather express in a loop, you can.