Computers and other such things.
Binary Search
“Binary search is one of the most powerful ideas in algorithm design.” — Steven S. Skiena, The Algorithm Design Manual This piece is about the profound importance of a relatively simple algorithm, binary search. It’s a story of how binary search (and more generally, functions with logarithmic time complexity) can performantly search extremely large datasets. The implementation code is in Swift, although the principles generalize across languages. Say you were handed a phonebook of Gotham (hypothetical population one million) and asked to find the name Ron Swanson....
Javascript Async/Await via Generators
async/await with ES6 Generators & Promises This vanilla ES6 function async allows code to yield (i.e. await) the asynchronous result of any Promise within. The usage is almost identical to ES7’s async/await keywords. async/await control flow is promising because it allows the programmer to reason linearly about complex asynchronous code. It also has the benefit of unifying traditionally disparate synchronous and asynchronous error handling code into one try/catch block. This is expository code for the purpose of learning ES6....