4 ms·
I don't see any sentence nor expressiveness in that. It's the same structure as most method calls. "Deposit 100 dollars in my account." is a sentence, and that
by ignitionmonkey 5y ago
I don't see any sentence nor expressiveness in that. It's the same structure as most method calls.
"Deposit 100 dollars in my account." is a sentence, and that's doable in most languages. It just depends on how high you want to go with it. Functions are ubiquitous and powerful:
deposit($(100), in(my_account))
And if we remove brackets like a lot of languages (I prefer not to)...
deposit $ 100, in my_account
Functions remove the need to tie actions to objects too. We can rely on types/interfaces.
deposit($(100), in(the_river))
We could go further, again, depends where you want to stop. Expressiveness isn't really limited by most languages.
- layer8 5y agoAlso, reading like a sentence is not expressiveness. Expressiveness in programming languages is about abstractions, like for example macro capabilities. Reading like a sentence is merely about fluent APIs and (sometimes) syntactic sugar.
- PaulDavisThe1st 5y agoBest to read the smalltalk as always embedded in an invisible framework that looks like this: hey OBJECT !, I want you to ACTION with ARGUMENTS so ... "hey account!, I want you to make a deposit with $100"
- wk_end 5y ago...which illustrates one of the oddities of Smalltalk's vision of OOP pretty well. I've made deposits into accounts, or maybe I've asked banks to make a deposit into an account on my behalf, but I've never (intuitively) instructed an account to make a deposit into itself.
- PaulDavisThe1st 5y agolevel error! account deposit: $100 was the message from the bank teller to the account, not from you :)
- wk_end 5y agoDo bank tellers, conceptually, think of themselves as telling accounts to add $100 to themselves? Or do they think of themselves as adding $100 to an account?
- PaulDavisThe1st 5y ago... when the bank teller's are software-driven entities, they might :)
- wk_end 5y agoYes, I suppose it's the case that if the bank tellers are written in Smalltalk, the Smalltalk way of doing things make sense.
- bitwize 5y agoYeah, you're supposed to say: bankTeller deposit: (100 dollars) in: myAccount.