re: Keeping your code clean by sweeping out "if" statements VIEW POST


I work in Javascript but sometimes I see Java code at work. I can see what you're saying but I wonder if you think the "if" ridden examples could be included in unit-test code?


Hi Jen,

I don’t really understand what you mean by including in unit-test code, could you clarify? I should have included test examples, but this more declarative approach is not any different to unit test then the if-version.

Thanks for your reply!

Code of Conduct Report abuse