3 ms·
IMO the java is more readable. Parenthesis clearly delimit the scope of the function call. How would smalltalk handle nested function calls?
by trophycase 7y ago
IMO the java is more readable. Parenthesis clearly delimit the scope of the function call. How would smalltalk handle nested function calls?
- edflsafoiewq 7y agoThink like arithmetic. 2 times: (3 plus: 4).
- cwp 7y agoYou can use parenthesis around any expression, as in most languages. eg something like: bank balanceOf: (bank findAccount: #savings) However, parens aren't necessary when a nested message takes no arguments, or uses a binary selector. eg: bank withdraw: 3 + 4 from: user checkingAccount There are 3 messages here. 1. 3 + 4 (execute method + with argument 4) 2. user checkingAccount (getter with no arguments) 3. bank withdraw: <result of #1> from: <result of #2>