r/coding • • Aug 05 '19

Why Declarative Coding Makes You a Better Programmer

http://minborgsjavapot.blogspot.com/2019/08/why-declarative-coding-makes-you-better.html
3 Upvotes

7 comments sorted by

View all comments

25

u/yoomiii Aug 05 '19

Writing all the code to achieve the desired goal yourself in the imperative approach and using, for example, the pre-made sum and groupingBy functions in the declarative approach is not a fair comparison. You should either implement those functions in the declarative example or import some magically previously defined function sum() in the imperative approach, which would make it a one liner.

7

u/Kerbobotat Aug 05 '19

You are right. This is a rigged test from the get go.