|
|
|
|
|
by anentropic
3222 days ago
|
|
what does functional programming have to do with it? you still unit test functions in functional programming surely? > It's like saying all data should be declared as variable, in the functional programming paradigm, functions are data. That's why closures are useful. I don't think you understand what you're talking about. We were already talking about using 'functions as data', and closures and anonymous functions aren't the same thing. But anyway, how do you unit test an anonymous function? I assume you mean that you don't, you just test the bigger context around it. But that was my point, once your anonymous function starts becoming much bigger than a one-liner it ought to be tested itself. |
|