1 “it means there is only one input data, and there is only one output value” Everything is predictable, everything that depends on the function can be replaced with the value (RT). a(a(a(3))) -> a(a(4)) -> a(5) and the result is same -> 6 & no side effects
Update database -> update failed - Change button color -> change failed - Create file on disk -> no such file or directory - Save to memory -> save failed - Send to AMQP -> cannot connect
...and that’s why we need a unit tests! if a function there is a two condition return values plus one throws exception, then in our unit test should cover all of these conditions
in single function - Too many side effects -> too many requirements ? - Too many return values ? - Not tested - It works in my laptop/device/env!! <- ultimate reason lv 99!!
first code later - Better team communication -> trust issues? - Better abstraction -> implement different solution - Stop iteration, let’s sit and evaluate our codebase (and requirements)! - Help others, not blame!