Re:Be wary of functions which take several parameters of the...
by darkfire613 on Friday September 27, 2019 @02:12AM
(#21088959)
Your last point is something that I really like about the Swift language. All parameters have names that are mandatory when calling the function, so in Swift you would be required to call copyFile(from: file1, to: file2). [0]
0: https://docs.swift.org/swift-book/LanguageGuide/Functions.ht...
Re:Be wary of functions which take several parameters of the...
by Kuinox on Friday September 27, 2019 @02:51AM
(#21089162)
In C# you can optionaly name parameters when you call a method, sometime this is mendatory when you want to set the second(or more!) optional argument, but you don't want to set the first optional argument.
I the given example, I'd love to see a language with optional named parameters. For the function copy(String fromFileName, String toFileName), instead of calling copy (file!, file2), one would have the possibility of calling copy(from:file1, to:file2)