Alright, but then you are just hiding the if-statement within the is_odd method. There is no sane way to implement these types of functions, that take an integet and return a boolean, without if-statements.
To be fair - one could also claim that if statements are just hiding the conditional jumps. Creating better abstractions over problematic implementations is a virtue.
That was my point, Idan; if-statements are just conditional jumps, and you need those to be Turing complete. I disagree with the idea that if-statements are always a design flaw, because that just leads to using overabstracted solutions for simple problems, e.g. using pattern matching on a boolean condition.
I agree with your virtue, I just don't see something as integral as the if-statement as a 'problematic implementation'.
I understand whose is in the functional is alergic to IF statement, but a coder can create a good program without a functional approach. Many developers write code in procedural mode, if you use GNU/Linux you'll know that in many files you'll find IF statements
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
To be fair - one could also claim that
if
statements are just hiding the conditional jumps. Creating better abstractions over problematic implementations is a virtue.That was my point, Idan; if-statements are just conditional jumps, and you need those to be Turing complete. I disagree with the idea that if-statements are always a design flaw, because that just leads to using overabstracted solutions for simple problems, e.g. using pattern matching on a boolean condition.
I agree with your virtue, I just don't see something as integral as the if-statement as a 'problematic implementation'.
I understand whose is in the functional is alergic to IF statement, but a coder can create a good program without a functional approach. Many developers write code in procedural mode, if you use GNU/Linux you'll know that in many files you'll find IF statements