picostitch
crafting (and) JavaScript

JS (and) Crafting #1 – Source Maps, V8, Eff Monad, Clean Code, Smoke, Hash Lifetimes

Welcome to the JS (and) Crafting #1 - February 28th, 2017. Every Monday you will receive a hand-selected collection of links about JavaScript and how to craft better software. Let's get started ...

JavaScript

In "Fast Source Map Generation for React Native" David describes how he and others "improved source map generation for 1,758,618 single mappings from 3 seconds to 550 milliseconds by optimizing code for execution in v8."

"V8 has been improved and released version 5.7", where the async performance of Promises has doubled and the speed of async functions has quadrupled, regexps have become 15% faster and two new String functions padStart and padEnd have been added. And great to see that date and time get some love with the function Intl.DateTimeFormat.prototype.formatToParts (read more about it in ECMAScript 2017 spec).

In "The Eff monad implemented in Flow" gcanti shows how to use flowtype to be able to be more explicit about side effects in your code. He shows in a server-side app how you could wire up a signup route to the side effect of writing to a DB.

Crafting

Many contributors have taken Uncle Bob's clean code principles and adapted them for JavaScript, which says "Clean Code concepts adapted for JavaScript is not a style guide. It's a guide to producing readable, reusable, and refactorable software in JavaScript.".

Samir wrote smoke a small "integration test framework for console applications.". Where he says "a test case consists of input and expected output. It is constructed of a number of files with the same name and different extensions.", so if you want to run a script or program and test/compare it's output this tool might help. In the Origins section of the readme file Samir describes well why he created this tool.

Various

Lifetimes of cryptographic hash functions visualises impressively that (most) hash functions have a lifetime before they get broken. And since git uses the SHA1 hash, which caused the latest noise, Linus Torvalds states on the mailinglist that the impact on git is rather minor.

It's always good to know where to find the markdown syntax, so here is the link. I use markdown almost daily but still don't know all the special characters by heart yet.

While writing this newsletter I wanted to know again how to do quoting right and found this article by Virginia Kearney, where she basically states that "When you are writing on the web, you can mention the name of the source at the beginning of your quote, paraphrase or summary and then provide a link.". So I hope I have done it right :).