3 ms·
I run a functional programming workshop at work, and we talk a lot about side effects. I'm fighting unseeded 'random.next', and 'file.read' in algorithms, so t
by Fiahil 7y ago
I run a functional programming workshop at work, and we talk a lot about side effects.
I'm fighting unseeded 'random.next', and 'file.read' in algorithms, so they can remain pure. But I won't ever forbid someone to use logs in a pure function. Sure, it doesn't make sense from a functional programming point of view, but let's be practical and realistic for five minutes : logs are the only thing you can count on to debug a crashing script quickly. The occasional "bug" thrown by your logging back end is not a big enough deal to forgo our hability to trace what's going on in a running program. Everything is running inside kubernetes anyway.