diff --git a/README.md b/README.md index f1159781..41913f7d 100644 --- a/README.md +++ b/README.md @@ -977,10 +977,10 @@ function combine(val1, val2) { ### Don't over-optimize Modern browsers do a lot of optimization under-the-hood at runtime. A lot of -times, if you are optimizing then you are just wasting your time. [There are good -resources](https://github.com/petkaantonov/bluebird/wiki/Optimization-killers) -for seeing where optimization is lacking. Target those in the meantime, until -they are fixed if they can be. +times, if you are optimizing then you are just wasting your time. Focus on writing +clear and readable code first, and optimize only when you have identified real +performance issues. + **Bad:** @@ -2047,17 +2047,16 @@ try { For the same reason you shouldn't ignore caught errors from `try/catch`. -**Bad:** -```javascript +**Good:** getdata() - .then(data => { - functionThatMightThrow(data); + .then(user => { + return getOrders(user.id); }) .catch(error => { - console.log(error); + console.error(error); }); -``` + **Good:**