DEV Community

Discussion on: How Simple is too Simple to Test?

Collapse
 
serhuz profile image
Sergei Munovarov

I'm not familiar with the language, but it looks kinda strange that validation function has void type. Wouldn't it be better to return true or false instead of throwing exceptions?

Is there any reason for passing an array of values instead of 2 params?

Collapse
 
bosepchuk profile image
Blaine Osepchuk

Yes. That's what I was trying to discuss towards the end of the post. It is confusing.

Passing an array instead of two params was the author's choice. It meets our coding standard and it makes a fair bit of sense in the larger context of where that data comes from. Two params would have been perfectly fine in this context too.