The Saccharine world of modern Programming Languages

ES6, the latest version of ECMAScript (and by extension, JavaScript), was finally approved last month and ever since, the web has been blowing up with articles diving in to the newest features. This is not going to be one of those articles.

But I will link to one: Getting Started with JavaScript ES6 Destructuring

Destructuring in ES6 is a somewhat more developed form of the unpacking assignment syntax that python and some other languages have had for a while. In a nutshell, it lets you easily assign to multiple variables in a single statement, by automatically pulling values out of an array or object (or both).

In the world of programming language design, this type of feature is referred to as syntactic sugar. Sugar is something that saves you keystrokes or generally makes it easier to write the code, without actually providing any functionality that wasn’t previously there.

I have mixed feelings about syntactic sugar. The stodgy old dog programmer in me thinks sugar is wasteful. It complicates the language, obscures concepts and commonalities, and is only of value to people who are lazy and/or can’t type fast.

However, the side of me who has spent the last six or seven years writing extensively in python (arguably one of the more cloying languages out there) doesn’t want to have to write a separate statement to assign each element of a sequence to a different variable, and doesn’t want to have to write for loops to populate a sequence when I could just use a comprehension.

Continue reading “The Saccharine world of modern Programming Languages”

Advertisements
The Saccharine world of modern Programming Languages