The original internet architecture, built atop Internet Protocol Version 4 (IPv4), allocated less than 4.3 billion addresses. Every internet connected device needs an IP address, but in the early days of the internet there were no tablets or smartphones and computers were luxuries, not commodities.
More than 3.1 billion people (~40%) are not connected to the internet, the majority of whom live in Africa and Asia. For companies, this presents an opportunity to build hardware and software that connects the “next billion,” particularly in the mobile space with platforms like Android Go and KaiOS. The JioPhone is one such success story, selling more than 70 million phones in India at the equivalent of $10 USD (or less!).
With around 500 apps, the KaiStore is a platform where app developers can publish apps available to millions without being crowded out. However, this requires software that is…
Since the early versions of JavaScript there have always been two ways of performing equality comparison:
==
aka “double equals”===
aka “triple equals”ES6 delivered a third option in the form of the Object.is
method. It has some slight differences that hint at problems you did not even know you had. For instance, how would you tell JavaScript’s two zeroes apart?
Perhaps a better question is, JavaScript has two zeroes? Why does JavaScript have two zeroes? Why would any language have two zeroes?
The name for this is Signed Zero. It…
As software company offerings expand, so do their teams. When startups get acquired or go public, the engineering team grows into a full engineering organization. That engineering organization then needs to scale to support more customers and in the process, monolithic architectures make way to service-oriented designs.
Like the code they write, engineering organizations migrate from a single entity into a distributed collection of two-pizza teams. As with their micro-services, these teams need to talk to one another.
Engineers have lots of ways to communicate: email, Slack, JIRA, and passive-aggressive post-it notes. So, there are many options for connectivity in…
There are a lot of ideas about software and how to drive its development. Some approaches are promising, while others can be pretty problematic. Here are just a few strategies you might have seen used by other engineers for crafting digital products.
MVP is Life. Beta Driven Development (AKA the other BDD) exists because the client initially requested a Proof of Concept (POC), but now they want to take that into production. The supporting code is not modular, does not adhere to SOLID principles, and does not have a single unit or integration test written. In fact, there is no…
NASA’s earliest attempts at launching rockets were part of the Bumper program, comprised of unmanned rockets in the late ‘40s and early ‘50s. The next decade saw many rocket launches — some successful, while others burst into flames.
Then, in 1961, the Soviet Union successfully sent cosmonaut Yuri Gagari on the first manned rocket, making him the first human in history to journey to outer space.
Contrast that with Wan Hu, a legendary Chinese figure described as the “first astronaut.” For his ascent, he was seated in a chair attached to several dozen rockets. …
With Proxy, you get a tiger object disguised as a cat object. Here are about half a dozen examples that I hope will convince you that Proxy provides powerful metaprogramming in Javascript.
Although it is not as well known as other ES2015 features, Proxy has many uses including operator overloading, object mocking, concise-yet-flexible API creation, Object on-change events, and even powers the internal reactivity system behind Vue.js 3.
The
Proxy
object is used to define custom behavior for fundamental operations (e.g. property lookup, assignment, enumeration, function invocation, etc).–MDN
A Proxy is a placeholder object that “traps” invocations and operations made…
Originally meant to introduce private properties to ES6, Symbols offer an approach to metaprogramming in Javascript that provides extension hooks into language operators and methods without risking user name collisions. A symbol
is a primitive data type that is immutable and globally-unique.
There are three kinds of Symbols:
Symbol
functionSymbol.for
functionWhile Symbols provide hooks into language methods, this same feature can be exploited by the developers of libraries and frameworks as well.
Here is a quick summary of…
Thank u, [Symbol.iterator].next
Thank u, [Symbol.iterator].next
I’m so f****in’ grateful for this spec
Symbol.iterator
is the protocol that makes native objects like Array
, Set
, and Map
iterable by providing a hook into language features like for…of loops and the spread operator.
The most obvious use case is in creating new, iterable data structures that are not provided by the language, like a Linked List. However, Symbol.iterator
also lets developers redefine navigation patterns without cloning the object or modifying its order in-place.
These patterns can then be written once in a function, class, or module and used anywhere. That means you…
So the last shall be
[0]
, and the first [length — 1].– Adapted from Matthew 20:16
I’ll skip the Malthusian Catastrophe and get to it: arrays are one of the simplest and most important data structures. While terminal elements (first and last) are frequently accessed, Javascript provides no convenient property or method for doing so and using indices can be redundant and prone to side effects and off-by-one errors.
A lesser-known, recent Javascript TC39 Proposal offers solace in the form of two “new” properties: Array.lastItem
& Array.lastIndex
.
Writing to learn, writing to share. Science, Software & Sarcasm — https://barrasso.me