sloonz
Fonts bloat (do you want a font with 1 million characters in it ? I don’t. Do you want to have to install 1000 fonts having 1000 characters each to be sure to cover all the Unicode table ? I don't).
Lots of issues for everyday programmers (how do you handle weird unicode characters in your validation code ?) potentially leading to security issues (bypassing validation rules by close-but-different characters, phishing…)
Pasting
check()
.then()
in node REPL gives : > check()
undefined
> .then()
Invalid REPL keyword
Pasting check().
then()
Gives the expected result.More generally, Javascript rules about whether a newline constitutes the end of a statement or not are pretty confusing (at least for me), so I prefer using a form that makes it explicit when a statement continues on the next line.
check()
.then(result => {
if (result) {
// set state to finished
}
check()
.then(result => {
if (result) {
// set state to finished
}
check()
.then(result => {
if (result) {
// set state to finished
}
check()
.then(result => {
if (result) {
// set state to finished
}
check()
.then(result => {
if (result) {
// set state to finished
}
// set state to not done
})
.catch(error => // set state to failed);
})
.catch(error => // set state to failed);
})
.catch(error => // set state to failed);
})
.catch(error => // set state to failed);
})
.catch(error => // set state to failed);
For the love of everything that’s sacred, please don’t do this. The strength of promises is that they can free us from that exact kind of callback hell, and they do that by being chainable. const resultOrNull = await Promise.resolve(null).
then(result => result || check()).
then(result => result || check()).
then(result => result || check()).
then(result => result || check()).
then(result => result || check()).
catch(error => null);
Calling .then/.catch inside of a .then/.catch is a huge red flag. Almost always, you want to return the promise and chain instead.> 4. It has traction ie >10k downloads preferably >50k
Why ? Your home-made code probably don't check those boxes.