Conversation

I'm at the point of being bothered that so many languages don't default to pure functions with required indication for impure. Like, why make me think about whether I'm writing an actual function or not?
2
10
And maybe basic logging should count as introspection rather than an actual side effect, so maybe can call it pure? If so, logging is more fundamental than printing to stdout, which is user interface.
2
3
I guess it might be tricky to have a general rule for this (lots of types of applications with different needs), but I thought this was an interesting perspective:
Quote Tweet
Replying to @alpha_convert
Not sure about modules, but one thing I've found is that most modules in most projects shouldn't be logging at all. Logging makes sense in the parts of the code that actually do stuff (IO) and have the full context. The pure logic parts of the code shouldn't know about logging.
2
2