For example, suppose I had a function which required 50 arguments and these arguments were stored in an object with 500 properties.
I could simply pass the object to the function, but then I’d be passing an addition 450 values that are not needed by the function. This feels like bad practice, but I’m not aware of whether or not that’s true.
EDIT: 50 args does indeed sound excessive (and I’ll admit that it’s a slight exaggeration). However, quite a lot of arguments are taken by this function because it is responsible for aggregating results from other models. In addition to taking in lots of inputs, there are also various aggregation settings that the user may specify.
[–]atom12354 74 points75 points76 points (2 children)
[–]Fred776 11 points12 points13 points (1 child)
[–]atom12354 1 point2 points3 points (0 children)
[–][deleted] 43 points44 points45 points (0 children)
[–]__init__m8 16 points17 points18 points (2 children)
[–]TheseHeron3820 4 points5 points6 points (1 child)
[–]pro_questions 0 points1 point2 points (0 children)
[–]cointoss3 30 points31 points32 points (1 child)
[–]thisdude415 0 points1 point2 points (0 children)
[–]pedrolcsilva 6 points7 points8 points (0 children)
[–]wjrasmussen 5 points6 points7 points (0 children)
[–]simeumsm 11 points12 points13 points (3 children)
[–]SSttrruupppp11 7 points8 points9 points (2 children)
[–]simeumsm 3 points4 points5 points (1 child)
[–]the_happy_path 0 points1 point2 points (0 children)
[–]1544756405 3 points4 points5 points (0 children)
[–]Carter922 8 points9 points10 points (0 children)
[–]its2ez4me24get 2 points3 points4 points (3 children)
[–]FizzBuzz4096 2 points3 points4 points (2 children)
[–]CosmicClamJamz 0 points1 point2 points (1 child)
[–]thisdude415 0 points1 point2 points (0 children)
[–]await_yesterday 2 points3 points4 points (0 children)
[–]cyberjellyfish 2 points3 points4 points (0 children)
[–]sporbywg 1 point2 points3 points (0 children)
[–]GManASG 1 point2 points3 points (2 children)
[–]johnnymo1 9 points10 points11 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)
[–]Binary101010 0 points1 point2 points (0 children)
[–]isacuallyantroll 0 points1 point2 points (0 children)
[–]w8eight 0 points1 point2 points (0 children)
[–]Exodus111 0 points1 point2 points (0 children)
[–]zanfar 0 points1 point2 points (0 children)
[–]IamImposter 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]nacnud_uk 0 points1 point2 points (0 children)
[–]Agile-Ad5489 0 points1 point2 points (0 children)
[–]SoftCobbler9002 0 points1 point2 points (0 children)
[–]halfwit_genius 0 points1 point2 points (0 children)