DEV Community

Discussion on: List of Variables vs. Object

Collapse
 
mahmoudzohdi profile image
Mahmoud Zohdi

yesterday, I was thinking about this style of code and I found it's a good approach in functions with a lot of params.
but you shouldn't use a lot of this to keep your code clean.

Collapse
 
miku86 profile image
miku86

Hey Mahmoud,

thanks for your comment.

What is your understanding of keep your code clean in this case?

Collapse
 
mahmoudzohdi profile image
Mahmoud Zohdi

I mean if you used an object with properties instead of multiple params in this case you can send extra properties without keep tracking of it.

I don't know if this a big deal or not but I think it's not good to use this approach in all your app