Ruby's keyword args work a little differently than similar implementations (selectors in Objective C, for instance). The value on the right-hand side of the colon is the default, not the local name.
7 Matching Annotations
- Sep 2022
-
-
- Jun 2021
-
naildrivin5.com naildrivin5.com
-
It also makes it hard to centralize type coercions and default values.
-
- Feb 2021
-
github.com github.com
-
Make your functions return something meaningful, typed, and safe!
-
-
en.wikipedia.org en.wikipedia.org
-
This is done to avoid confusion by differentiating between cases where a variable carries a defined value and those where it does not.
-
-
trailblazer.to trailblazer.to
-
Using a terminus to indicate a certain outcome - in turn - allows for much stronger interfaces across nested activities and less guessing! For example, in the new endpoint gem, the not_found terminus is then wired to a special “404 track” that handles the case of “model not found”. The beautiful thing here is: there is no guessing by inspecting ctx[:model] or the like - the not_found end has only one meaning!
-
A major improvement here is the ability to maintain more than two explicit termini. In 2.0, you had the success and the failure termini (or “ends” as we used to call them). Now, additional ends such as not_found can be leveraged to communicate a non-binary outcome of your activity or operation.
Tags
- non-binary
- strong (extreme/great/high/intense degree/level/concentration/amount/quality of)
- Trailblazer
- improvement
- unambiguous
- advantages/merits/pros
- programming: return values / result objects that communicate a more precise/complete representation of the outcome
- state charts
- interfaces (programming)
Annotators
URL
-
- Sep 2020
-
github.com github.com
-
For my point of view, and I've been annoyingly consistent in this for as long as people have been asking for this feature or something like it, style encapsulation is one of the core principles of Svelte's component model and this feature fundamentally breaks that. It would be too easy for people to use this feature and it would definitely get abused removing the style safety that Svelte previously provided.
-