From the article: https://medium.com/androiddevelopers/coroutines-on-android-part-iii-real-work-2ba8a2ec2f45
- As a general pattern, start coroutines in the ViewModel.
- A repository should prefer to expose regular suspend functions that are main-safe.
From the article: https://medium.com/androiddevelopers/coroutines-on-android-part-iii-real-work-2ba8a2ec2f45
Who thought it would be so hard to learn "best practices" for a table view?
This document references the Contracts Draft Design for Go Generics, dated 31 July 2019.
The current design uses parentheses to delimit type parameter clauses, but this makes the code difficult to read. This is covered briefly in Non-Parenthetical Delimiters from the essay Towards Clarity: Syntax Changes for Contracts in Go, as well as in many other points of feedback which can be found at https://github.com/golang/go/wiki/Go2GenericsFeedback as linked documents or inline comments.
The official draft states:
Why not use the syntax
F<T>
like C++ and Java?
When parsing code within a function, such asv := F<T>
, at the point of seeing the < it's ambiguous whether we are seeing a type instantiation or an expression using the < operator. Resolving that requires effectively unbounded lo
There are two main parts to the Contracts Draft Design:
Type Parameters are mostly independent of Contracts; Contracts builds on Type Parameters. The two concepts are well thought-out and many corner cases have been looked at.
These are some specific points that I think are done well by the current generics draft proposal, not in any particular order:
//A generics proposal for Go, introducing one new type (generic) and one new builtin function (typeof), no syntax changes. | |
//Function add takes arguments of any type. | |
//The return value is automatically inferred based on the arguments, can be inlined by the compiler. | |
//Both arguments must be the same type and addable or else a compiler error will be raised. | |
//It's the developer's responsibility to document which types can be passed to this function. | |
func add(a, b generic) generic { | |
return a+b | |
} |
#! /bin/sh | |
# Copy to /usr/local/bin/chime | |
# Use: | |
# cd my-project | |
# chime . | |
open -a /Applications/Chime.app/Contents/MacOS/Chime $@ |
{ | |
"display_name": { | |
"en": "Monokai Light" | |
}, | |
"colors": { | |
"editor.background": "#fafafa", | |
"editor.selection": "#ccc9ad", | |
"editor.insertion-point": "#666663", | |
"syntax.default": "#000000", |
{ | |
"Touch Bar Items": [], | |
"Key Mappings": { | |
"0xf72d-0x20000": { | |
"Text": "", | |
"Action": 8 | |
}, | |
"0xf72b-0x100000": { | |
"Text": "", | |
"Action": 4 |