4 ms·
I think Smalltalk seems "quirky" compared to your Kotlin example only becuase we've all gotten used to a standardized C-inspired syntax. Which is fine, we have,
by jrochkind1 5y ago
I think Smalltalk seems "quirky" compared to your Kotlin example only becuase we've all gotten used to a standardized C-inspired syntax. Which is fine, we have, so things that roughly adhere to it seem less quirky. Smalltalk was just written before we had all standardized on that.
There's nothing inherently more quirky about separating list elements with `.` then with `,`, until you've gotten used to a cross-language convention of using `,`. Which Smalltalk predates.
There's nothing inherently more "naked" or less mysterious about using square brackets to delineate a block/lambda instead of curly brackets... and I'm not even sure on what basis curly braces seem more natural to you! What makes curly braces more obvious than square brackets?
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? One could imagine a language (perhaps untyped, to keep things consistent) where you didn't, perhaps any one-argument function would just have an argument named `it`. Heck, maybe a two argument function would just have arguments named `it` and `other`. We could argue about whether that was a good idea or not... but I'm unpersuaded that it's more "naked", as if there is some kind of natural correct one true syntax out there waiting to be discovered. I get that you like Kotlin; I think you are mistaken to think it is objectively more "advanced", and am confident we could find people who don't like some of it's choices.
- Kinrany 5y ago> One could imagine a language It's called Kotlin. Of course this is a relatively minor feature and few C-like or ML-like languages have it. Using it against Smalltalk is a bit unfair.
- jrochkind1 5y agoOh kotlin automatically names arguments for all functions/methods, not just anonymous blocks? I'm obviously not familiar with kotlin. I'd call it "quirky" to suggest that it's more "advanced" to automatically name arguments `it` for all function definitions! I thought the kotlin enthusiasts were only suggesting it for anonymous inline blocks/closures, but was hypothesizing, ok so would doing it for all functions be even more "advanced"? (Is the answer that kotlin already thinks yes?!)
- Kinrany 5y agoI don't think it's for all functions, sorry.
- 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!