Repository navigation
if's else-clause should be optional #772
Replies: 2 comments
|
Rhombus provides I haven't been involved in any Rhombus design discussions on this point, but I expect it was a deliberate choice based on experience to make I can only speak for myself, but I'd be surprised people want to return to the days of |
Uh oh!
There was an error while loading. Please reload this page.
I see the flavor of the language being very expression-oriented, but Rhombus already detects a lot of errors at parse time (even more if you use Rhombus-static) so having an implicit else-clause that returns
#voidwhen nothing is needed might not be harmful.I see myself writing lots of debugging code like the following one in these early stages while I'm learning the language:
The else-clause here adds no value.
Btw, good job on the
guarddesign. I almost gave up on the language when I saw that the expression-oriented nature + the lack of a return statement, but guards allow one to avoid Hadouken indentation by retaining the "return early" (in a way). It retains the cleanness of the return early idiom in an expression-oriented language.All reactions