3 ms·
I’m seeing a little bit of a waterbed effect here. The author has replaced the basic type with one that matches it in name. You will never accidentally send Cus
by 49bc 8y ago
I’m seeing a little bit of a waterbed effect here. The author has replaced the basic type with one that matches it in name. You will never accidentally send CustomerId to CartID because the compiler will fail... but now we’ll nees to dig through the code to find out whether customer ID should be an int, int32, String.... what the heck is it anyway?
In scala can I not just say foo(item1=item1) even if foo takes only 1 arg?
- tytytytytytytyt 8y ago> In scala can I not just say foo(item1=item1) even if foo takes only 1 arg? Why would you want to do that? That's less succinct than foo(item1). What are you really asking?
- amzans 8y agoUsually you would lookup the definition of those types just as you do for the function that you are trying to call. At least it’s a good idea to know what a function accepts before passing around your customer IDs ;) And to answer your last question, yes in Scala you can use named parameters like in your example.