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?
I'm a small business programmer. I love solving tough problems with Python and PHP. If you like what you're seeing, you should probably follow me here on dev.to and then checkout my blog.
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.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I'm not familiar with the language, but it looks kinda strange that validation function has
void
type. Wouldn't it be better to returntrue
orfalse
instead of throwing exceptions?Is there any reason for passing an array of values instead of 2 params?
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.