-
MDN URL: to many to list What information was incorrect, unhelpful, or incomplete?I'm curious in general if there is a policy on async/await vs then/catch? What did you expect to see?I expect to see pretty much every MDN article the uses async features (fetch, service workers, etc...) to show mainly or even only async/await based code. For example I expect this
not this
To me the first is simple and easy to understand for new users. The second is effectively obfusticated code. Does the leadership of MDN have some policy on this issue? Is it okay to edit articles using obfusticated MDN Content page report details
|
Beta Was this translation helpful? Give feedback.
Replies: 0 comments 3 replies
-
I agree to use async / await consistently. |
Beta Was this translation helpful? Give feedback.
-
They tend to shy away from new idioms until they've had to achieve support in most browsers. When to embrace them is a judgement call with no reliable heuristic. |
Beta Was this translation helpful? Give feedback.
-
We have a policy on this! https://developer.mozilla.org/en-US/docs/MDN/Guidelines/Code_guidelines/JavaScript#use_modern_js_features which says it's fine to use async/await. It doesn't actually encourage it (although personally I think it should). But I think it would be fine to update the example you've quoted. |
Beta Was this translation helpful? Give feedback.
We have a policy on this! https://developer.mozilla.org/en-US/docs/MDN/Guidelines/Code_guidelines/JavaScript#use_modern_js_features which says it's fine to use async/await. It doesn't actually encourage it (although personally I think it should).
But I think it would be fine to update the example you've quoted.