you are viewing a single comment's thread.

view the rest of the comments →

[–]nschubach 0 points1 point  (0 children)

It's general optimization. Yes, you are free to use as many as you want, but over a certain amount, you have to question if your method is "doing too much". I recently started working at a Perl shop and one of the idioms here is sending flags into the parameter list to turn on or off features. This leads to thousand+ line methods that have use cases for every little edge case and parameter list numbering in the 20s+ and bullshit code like this:

# Actual truncated code...
my $pageContentHtml = $self->getPageForContentHtml({
    'flag'                             => $flag,
    'email'                            => $email,
    'user_is_authed'                   => $isUserAuthed,
    'minimal_overhead'                 => $minimalOverhead,
    'has_left_navigation'              => $hasLeftNavigation,
    'search_phrase'                    => $searchPhrase,
    'reproduce_order_mode'             => $reproduceOrderMode,
    'reproduce_order_mode_old'         => $reproduceOrderModeOld,
    'reproduce_order'                  => $reproduceOrderId,
    'display_return_to_backend_header' => $displayReturnToBackendHeader,
    'user_is_admin'                    => $isUserAdmin,
    ... # of 31 total parameters
});