3 ms·
> Why do you have to find names for closure arguments? I don't know why do you have to find names for arguments in functions/methods either? You are missing th
by hota_mazi 5y ago
> Why do you have to find names for closure arguments? I don't know why do you have to find names for arguments in functions/methods either?
You are missing the point.
What Kotlin gets right here is that most of the time, these closures only have one parameter so it allows you to not declare that parameter and instead, use `it`. Smalltalk (and many other languages) missed that simple quality of life improvement, but once you get used to it, it really makes the code more readable. Obviously, you can always decide to pick your own name anyway, so Kotlin's approach subsumes Smalltalk's here.
> I think Smalltalk seems "quirky" compared to your Kotlin example only becuase we've all gotten used to a standardized C-inspired syntax.
My examples are not complaining that Smalltalk uses [] instead of {}, please reread what I wrote. Smalltalk is making a lot of bizarre syntactic choices that really only impede readability with unnecessary symbols (e.g. the . terminator).
- jrochkind1 5y ago> My examples are not complaining that Smalltalk uses [] instead of {}, please reread what I wrote OK: > No spurious colon, dots sprinkled a bit everywhere, mysterious ":in" or pipe bar, square brackets. Just a very naked syntax. You seemed to be complaining about the square brackets, did I misread? Why were you mentioning the square brackets? My point was that there is nothing inherently "mysterious" about any of those things, except I guess if you're used to the cross-language conventions that have developed since smalltalk, which is fair (and except I don't think curly vs square brackets for blocks/closures is even one of those). But I wasn't trying to be rude or read you incorrectly. I suspect this conversation is going nowhere, that's fine, good day!