Hacker News new | ask | show | jobs
by murph-almighty 1627 days ago
My heuristic: If you have 5 or more arguments, you should use a config object.
1 comments

My heuristic is to not be dogmatic like that. A constructor for a triangle class may reasonably want to take 6 arguments (3 x- and 3 y-coordinates). In other cases, even four arguments might be better as a config object if those 4 are all very rarely used.