

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Still calibrating
click for more info
Not enough gems
Cost: 6 gems
1: Pure Functions
incomplete
2: Pure Function Review
incomplete
3: Reference vs. Value
incomplete
4: Pass by Reference Impurity
incomplete
5: Input and Output
incomplete
6: Should I I/O?
incomplete
7: No-Op
incomplete
8: Memoization
incomplete
9: Referential Transparency
incomplete
10: Pure Functions Practice
incomplete
11: Pure Functions Practice
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
A program that doesn't do any i/o is pretty useless. What's the point of computing something if you can't see the results?
In functional programming, i/o is viewed as dirty but necessary. We know we can't eliminate i/o from our code, so we just contain it as much as possible. There should be a clear place in your project that does nasty i/o stuff, and the rest of your code can be pure.
For example, a Python program might: