13 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
-
Monads provide an elegant way of handling errors, exceptions and chaining functions so that the code is much more understandable and has all the error handling, without all the ifs and elses.
Tags
- reuse existing language constructs
- chaining
- make it impossible to get wrong/incorrect
- understandable
- monad
- too many ifs: bad
- optional chaining/safe navigation operator
- good point
- type safety
- polluting the global scope/environment
- monad: Maybe
- error/exception handling
- programming languages: features
- elegant solution
- opinionated
- good explanation
- don't modify objects you don’t own (monkey patching)
- remarkable
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?.()
-
- Jan 2020
-
web.archive.org web.archive.org
-
Core to arel is per-query / per-clause chainability: “build at your leisure, one scope at a time”
-
-
-
In order to implement true method chaining, we need to teach each sub-query method to return an instance of the query builder. We'll define a method, #reflect, that takes in an argument of the query we are adding to the chain and uses it to initialize a new instance of SceneQueryBuilder.
-
- 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