A practice I like to stick with when designing software is to keep effects at the edges. What I mean, in this article, by effects are all of those actions we ask a program to take that change the state of something outside of our program’s process space: allocating data on the heap, reading from foreign memory, reading and writing from files, making system calls, etc. I keep them separate from my core logic so that I can write clearer code that is easier to maintain and test.

Why Effects Should Be Contained

Without effects our programs would not do anything useful with the hardware and we wouldn’t observe our computers doing anything. No graphics. No sound. No networking. No way to get the results!

We need effects.

The problem with some effects is that they produce data…

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help