News for hackers. Stuff that matters.
Re:Be wary of functions which take several parameters of the... by Too on Friday September 27, 2019 @10:38AM (#21092477)
Parent would not stop me from doing this either:

    copy(source=Src(file2), dest=Dest(file1))
At some point you will have to make a human decision which file to copy, only thing helping you out in that situation is that it clearly states on call-site which arg is src and which arg is dest, instead of remembering left or right argument.
Re:Be wary of functions which take several parameters of the... by mlthoughts2018 on Friday September 27, 2019 @03:33PM (#21095500)
Sure, I mean ultimately you could shoot cosmic rays at your computer to rearrange bits and bypass any type safety you want. I don’t get why you think this bears relevance?
Re:Be wary of functions which take several parameters of the... by GordonS on Friday September 27, 2019 @06:13PM (#21096724)
I'm not sure how @Too's example is any worse than named parameters - surely the point is that it's just as likely to transpose source/destination either way.
Re:Be wary of functions which take several parameters of the... by mlthoughts2018 on Friday September 27, 2019 @06:34PM (#21096869)
I think the point is that it’s irrelevant, because type checking or type assertions would take place at the parameter ingestion step specifically to render transposing the arguments impossible.

Any solution could be screwed up on purpose if you’re imagining someone at an interpreter prompt getting the arguments wrong or omitting unit tests that verify a certain file is used as source and a different file as dest... which is why this kind of objection just totally doesn’t matter.