A Simpler Case for Functional Programming & “Elegant” Code

A lot has been written about the benefits of functional programming, but little of it is accessible to a newcomer. Some of the benefits are easy to understand from an inexperienced perspective (e.g. “it makes concurrency easier”), but others are pretty nebulous.

Chief amongst the inscrutable properties of functional programming is its “elegance.” It isn’t immediately clear what that word actually means in this context. Read more on A Simpler Case for Functional Programming & “Elegant” Code…

How to Read Code (Eight Things to Remember)

“I hate reading other people’s code” is a common refrain among software developers of all experience levels. However, it’s a necessary skill, especially for developers rolling onto existing codebases, and if you approach it with the right perspective and the right tools, it can be an enjoyable and enlightening experience. Read more on How to Read Code (Eight Things to Remember)…

Using Decorators to Declaratively Extend Functions

The decorator pattern gained fame in the object-oriented world after being featured in the classic 1994 Gang of Four book, Design Patterns. Since then, it’s been used extensively in traditional object-oriented programming as an alternative to inheritance. What’s really going on behind the scenes though, is composition, which means decorators are also great for cleaning up some functional programming boilerplate.

We’re going to look at decorators in JavaScript, along with some proposed syntax sugar coming in ES2017 that will make it easier to use them. Read more on Using Decorators to Declaratively Extend Functions…

Lazy Sequences with ECMAScript 6 Generators

Generators are an ES6 feature that started receiving a lot of attention a few years ago because of their potential to ease some of the pain associated with writing asynchronous code. However, with the emergent async/await proposal (mere syntax sugar around generators and promises), some of the shine has worn off, and generators aren’t getting the same amount of attention they used to.

This is a shame, because even if you disregard their uses in asynchronous code, generators are still pretty cool in their own right. I’m going to explore some of the ways you can use them to implement lazy sequences.
Read more on Lazy Sequences with ECMAScript 6 Generators…