←back to thread

361 points mmphosis | 1 comments | | HN request time: 0s | source
Show context
leetrout ◴[] No.42165704[source]
> It's better to have some wonky parameterization than it is to have multiple implementations of nearly the same thing. Improving the parameters will be easier than to consolidate four different implementations if this situation comes up again.

Hard disagree. If you cant decompose to avoid "wonky parameters" then keep them separate. Big smell is boolean flags (avoid altogether when you can) and more than one enum parameter.

IME "heavy" function signatures are always making things harder to maintain.

replies(17): >>42165868 #>>42165902 #>>42166004 #>>42166217 #>>42166363 #>>42166370 #>>42166579 #>>42166774 #>>42167282 #>>42167534 #>>42167823 #>>42168263 #>>42168489 #>>42168888 #>>42169453 #>>42169755 #>>42171152 #
zombiwoof ◴[] No.42166217[source]
Super rock hard agree with you and disagree with the author

I have seen so many terrible projects with methods with endless arguments/paramters, nested object parameters the signatures are fucking insane

The biggest stench to me in any project is when I see a majority of methods all have > 6 arguments

To quote Shoresy: so dumb

replies(1): >>42168543 #
1. Aeolun ◴[] No.42168543[source]
It’s funny, because the biggest stench to me is seeing a project with thousands of nested functions all doing nearly nothing.

Probably one of those ‘truth is in the middle’ kind of situations.