- Ho Chi Minh
The introduction to Reactive Programming you've been missing
This tutorial as a series of videos
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
A vision for data interchange in Elm
How do you send information between clients and servers? What format should that information be in? What happens when the server changes the format, but the client has not been updated yet? What happens when the server changes the format, but the database cannot be updated?
These are difficult questions. It is not just about picking a format, but rather picking a format that can evolve as your application evolves.
By now there are many approaches to communicating between client and server. These approaches tend to be known within specific companies and language communities, but the techniques do not cross borders. I will outline JSON, ProtoBuf, and GraphQL here so we can learn from them all.
|Latency Comparison Numbers (~2012)|
|L1 cache reference 0.5 ns|
|Branch mispredict 5 ns|
|L2 cache reference 7 ns 14x L1 cache|
|Mutex lock/unlock 25 ns|
|Main memory reference 100 ns 20x L2 cache, 200x L1 cache|
|Compress 1K bytes with Zippy 3,000 ns 3 us|
|Send 1K bytes over 1 Gbps network 10,000 ns 10 us|
|Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD|
System Design Cheatsheet
Picking the right architecture = Picking the right battles + Managing trade-offs
- Clarify and agree on the scope of the system
- User cases (description of sequences of events that, taken together, lead to a system doing something useful)
- Who is going to use it?
- How are they going to use it?
Better local require() paths for Node.js
When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:
const Article = require('../../../../app/models/article');
Those suck for maintenance and they're ugly.