Comment on Problems with default function arguments (2020)Comments−Waterluvian2yAre there any languages that do not have positional arguments at all and they’re always keyword arguments?My pet peeve is reading code and trying to reason about foo(true, 1, 1, null, “cupcakes”)−noelwelsh2yI believe in Smalltalk all method arguments are by keyword. Objective-C probably has a similar restriction. I've never written any serious code in either, so I could be wrong.−justinsaccount2yNot a language, but I have seen some recent editor integration with LSP stuff that will visually display that as foo(bake: true, batches: 1, boxes:1, frosting: null, type: “cupcakes”)−Waterluvian2yOh that’s helpful. I should look into setting that for TS.Also frosting can’t be null when type is cupcakes. We found a bug.−comex2ySwift, more or less.
Comments
Are there any languages that do not have positional arguments at all and they’re always keyword arguments?
My pet peeve is reading code and trying to reason about
I believe in Smalltalk all method arguments are by keyword. Objective-C probably has a similar restriction. I've never written any serious code in either, so I could be wrong.
Not a language, but I have seen some recent editor integration with LSP stuff that will visually display that as
Oh that’s helpful. I should look into setting that for TS.
Also frosting can’t be null when type is cupcakes. We found a bug.
Swift, more or less.