I can imagine with editor support the wiring can b...
# thinking-together
n
I can imagine with editor support the wiring can be type-directed (in a statically typed language), but that doesn't seem like a complete solution
k
This gels with my recent noodling that we are perhaps not using the type systems we have as well as we could be: https://futureofcoding.slack.com/archives/C5U3SEW6A/p1562181908185100?thread_ts=1562010026.133300&cid=C5U3SEW6A. A function taking an int and a string often can/should be reframed to take a
PrimaryKey
and
Guid
, and so on. If this is true then maybe we can often disambiguate how arguments map to formal parameters based purely on type. The obvious examples where this breaks down are low level functions for say comparing two strings. In those cases if an operation is commutative then the mapping didn't matter. If it isn't commutative then we must fall back to ordered args. But maybe that shouldn't be the default. Positional arguments are the default only because that's easiest to implement. Can anyone think of an example of a fairly platonic, low-level operation that needs to take more than two args where one is of a different type than the others? Then it would be harder to decide whether to switch to positional args or not. Ah, here's one:
Copy code
bool is-substring?(string big, string small, int start)
I'm not sure what to do here.