Topics

Featured in Development

Peter Alvaro talks about the reasons one should engage in language design and why many of us would (or should) do something so perverse as to design a language that no one will ever use. He shares some of the extreme and sometimes obnoxious opinions that guided his design process.

Featured in AI, ML & Data Engineering

Today on The InfoQ Podcast, Wes talks with Katharine Jarmul about privacy and fairness in machine learning algorithms. Jarul discusses what’s meant by Ethical Machine Learning and some things to consider when working towards achieving fairness. Jarmul is the co-founder at KIProtect a machine learning security and privacy firm based in Germany and is one of the three keynote speakers at QCon.ai.

Featured in Culture & Methods

Organizations struggle to scale their agility. While every organization is different, common patterns explain the major challenges that most organizations face: organizational design, trying to copy others, “one-size-fits-all” scaling, scaling in siloes, and neglecting engineering practices. This article explains why, what to do about it, and how the three leading scaling frameworks compare.

Microsoft Enables Async/Await in Edge Preview Build

Microsoft's Edge browser has enabled the upcoming async/await feature of ES 2016. The feature is still behind an experimental flag in a preview build, but its presence is an important step towards widespread adoption.

JavaScript's inherent asynchronous nature is powerful, but it can also burden developers with excessive code for simple jobs. "Callback hell" is a joke JavaScript developers smile and nod at in dismay. In recent years, developers embraced Promises which enable a better way to deal with async code. Promises have advanced enough to become part of the ES6 spec.

The async/await feature takes Promises a step further, eliminating the need to wire up all the callback pieces required by traditional Promises. In an example where a function getJsonAsync returns a Promise, using async/await allows developers to wire up that same promise in a more synchronous style.

async function getServerData() {
try {
// Once the promise is resolved, the value is returned
var json = await getJsonAsync();
}
catch (e) {
// If the promise is rejected, the result ends up in the catch block
}
}

C# developers may find the syntax familiar; Microsoft introduced async/await for C# 5.0. In C#, the feature allows developers to write asynchronous code in a synchronous manner, without the need to explicitly wire up excessive code. Similarly, async/await in JavaScript is sugar, reducing the need for boilerplate code.

The feature is available in build 10547 as part of the Windows Insider program. The "Enable experimental JavaScript features" flag must be enabled in the about:flags window.

For now, the feature is not available in other browsers. However, the Babel transpiler has support for it as an experimental feature. Support in other browsers is likely not far behind. Mozilla is working on it.

Implementation in browsers is a necessary step in the ECMAScript standards process. Async/await is currently at stage 3, "Candidate". For a proposal to move on to the final stage 4, implementation experience is necessary. The feature's champion, Brian Terlson, spoke about this feature and the TC39 ES2016 process at this year's QCon New York.