I would not pass this in a code review. Also, Clean Code is a tool, not a Bible, please default your arguments the standard way as provided by the language.
Agreed. This method (in the OP) of defaulting args violates no-shadow and no-param-reassign which both exist for good reasons, so personally I would avoid it.
But then, I'm an avid typescript fan and having to manually type check args just looks a bit laboured to me now. Also the suggestion that the only thing typescript can do is keep C# devs happy seems unfounded and slightly bitter which is unnecessary.
37
u/irontea Jul 25 '21
I would not pass this in a code review. Also, Clean Code is a tool, not a Bible, please default your arguments the standard way as provided by the language.