Posts

Showing posts from January, 2016

The final feature set of ECMAScript 2016 (ES7)

Check out my new book (free online): “ Exploring ES2016 and ES2017 ”. We always knew that ECMAScript 2016 (ES2016) would be a small release. It turns out that it will be very small. Read on for a list of its features and an explanation why that is not a problem. The features of ES2016 Any proposals that were at stage 4 on Thursday, 28 January 2016, will be in ES2016 ( source: ECMAScript standard editor Brian Terlson ). That means that ES2016 will contain just two new features (in addition to bug fixes and smaller improvements): Array.prototype.includes (Domenic Denicola, Rick Waldron) Exponentiation Operator (Rick Waldron) The draft of ECMAScript 2016 is online and will be ratified in 2016, probably in June. The new release process works ES2016 being so small demonstrates that the new release process works: New features are only included after they are completely ready and after there were at least two implementations that were sufficiently field-tested. Releases happen much more f

Something Terrible Happened Here

Image
“We don’t know how to make it stop.”   Ghost electronic voice phenomenon (EVP) of an “overwhelmed” and “out-of-breath” soldier allegedly recorded at the site of the Battle of Little Bighorn, Montana. *  *  *  *  *  *  * There is a theory, one not supported by science, that in places where extreme trauma and tragedy have occurred there remains an imprint, an echo burned into the rocks and trees and landmarks.   This echo might be voices or spheres of light or gauzy figures that can be captured with digital cameras and sound recordings.   Those in the field of parapsychology call this electronic voice phenomenon or EVP.   This idea seems to support the assertion in the Kevin Costner film, Field of Dreams (Universal Pictures, 1989) that “if you build it, they will come.”   If you journey to the site of horrific death and destruction and turn on your digital recorder, you will capture these echoes.   If only that were true.   What a boon that would be for historians; they could walk t

ES.next News: a weekly email newsletter

Today, Johannes Weber and I are launching a new weekly email newsletter: ES.next News . The concept is simple: you get 5 links related to ECMAScript 6/2015+ per week, via email. Subscribe now, it’s free: Email : one email per week, each Tuesday. You can check out a sample issue . Twitter : all links that will be in the newsletter plus a few more, spread out all over the week. We see ES.next News as complementary to JavaScript Weekly (which we recommend, but are not affiliated with). The former is more focused, the latter is more comprehensive. Happy reading!

Enumify: better enums for JavaScript

In this blog post, I present enumify, a library for implementing enums in JavaScript . The approach it takes is inspired by Java’s enums. Enum patterns The following is a naive enum pattern for JavaScript: const Color = { RED: 0, GREEN: 1, BLUE: 2, } This implementation has several problems: Logging: If you log an enum value such as Color.RED , you don’t see its name. Type safety: Enum values are not unique, they can be mixed up with other values. Membership check: You can’t easily check whether a given value is an element of Color . We can fix problem #1 by using strings instead of numbers as enum values: const Color = { RED: 'RED', GREEN: 'GREEN', BLUE: 'BLUE', } We additionally get type safety if we use symbols as enum values: const Color = { RED: Symbol('RED'), GREEN: Symbol('GREEN'), BLUE: Symbol('BLUE'), } console.log(String(Color.RED

A House of My Own

Image
“I like to tell stories,” Sandra Cisneros writes at the end of her first novel, The House On Mango Street (Vintage, 1991).   “I tell them inside my head…I make a story for my life, for each step my brown shoe takes.   I say, ‘And so she trudged up the wooden stairs, her sad brown shoes taking her to the house she never liked.’”   Over the years, Cisneros has found a few houses she has liked, in Greece, in Chicago, in San Antonio, and now in Mexico, as she reveals in her recent essay collection, A House of My Own (Knopf, 2015). First, the book is gorgeously printed on rich, heavy paper.   Yes, it makes the book weightier than a normal hardback, but it definitely elevates the art of the book as a thing of beauty.   This is a book well-made, both in physical construction and in the literature it contains.   The essays come from diverse publications across the years, from 1984 to 2014, as Cisneros documents her life as human being and artist.   She has never been the shy, retiring type,