10 Matching Annotations
- Feb 2021
-
dry-rb.org dry-rb.org
-
In other words, once you've used Maybe you cannot hit nil with a missing method. This is remarkable because even &. doesn't save you from omitting || "No state" at the end of the computation. Basically, that's what they call "Type Safety".
-
Another solution is using the Safe Navigation Operator &. introduced in Ruby 2.3 which is a bit better because this is a language feature rather than an opinionated runtime environment pollution
Tags
- type safety
- programming languages: features
- reuse existing language constructs
- opinionated
- make it impossible to get wrong/incorrect
- remarkable
- good point
- good explanation
- don't modify objects you don’t own (monkey patching)
- polluting the global scope/environment
- monad: Maybe
- optional chaining/safe navigation operator
Annotators
URL
-
- Jan 2021
-
github.com github.com
-
You should default to the most permissive option imo and there really is no reason to check anything until you really need to If it were left to me I'd just use optional chaining, as it also eliminates the need for no-ops
(lazy checking)
-
- Nov 2020
-
imfeld.dev imfeld.dev
-
Directives like ng-if="info.report.revenue" sort of work in Angular if info.report is undefined, in that the ng-if becomes false. But the Svelte equivalent {#if info.report.revenue} throws an error. For now we're using lodash get in places where we need to and looking forward to Svelte support for optional chaining.
-
- Sep 2020
-
github.com github.com
-
handle?.destroy?.()
-
- Oct 2019
-
devblogs.microsoft.com devblogs.microsoft.com
-
TypeScript 3.7 implements one of the most highly-demanded ECMAScript features yet: optional chaining
-
- Sep 2019
-
tom-jaeschke.blogspot.com tom-jaeschke.blogspot.com
- Aug 2019