DEV Community

Discussion on: Keeping your code clean by sweeping out "if" statements

Collapse
 
jenc profile image
Jen Chan

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?

Collapse
 
tomazfernandes profile image
Tomaz Lemos

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!