869 private links
What tests you shouldn’t write for your software -- An essay on negative tests · Endless Parentheses
Interesting insight: A false failure is one that you fix by editing the test, while a real failure is one you fix by editing the code. Some tests virtually never have real failures, so it's better to avoid them. One principle is to test function, not code.
All look like interesting concepts to toy with!
- Text editor
- 2D game - Space Invaders
- Compiler - Tiny BASIC
- Mini operating system
- Spreadsheet (hard!)
- Video game console emulator (hard!)
- Ray tracer
- Key-value store web API
- Web browser
- Stock trading bot
Also see Challenging algorithms and data structures every programmer should try.
An introduction to various graphical tracing and profiling tools.
A web-based CSS animation editor.
An encoding scheme for encoding a sequence of numbers into a short URI-safe string, like a mix of nanoid and base64
A handy tool to play with Rust's regex/fancy-regex.
Various tricks to mess with webpages - actually quite useful! For example, have you thought of modifying the state of the program using a conditional breakpoint?
Fascinating paradigm for execution: log all side effects and restore execution deterministically.
Nice to learn about this interesting language. Besides its mixed logical-imperative paradigm and planner, it also has a neuron network module for creating simple nn. Looks like a nice alternative to prolog.
Raku is indeed the successor of the Perl I loved :)
A clever way of adding new syntax to Python - through the # coding: xxx
option with a custom encoding handler.
# coding: cursed-for
for (i = 5; i < 10; i += 2):
print(i)
The SQL Join can be thought of as the follows:
- A join is a lookup
- A join is a nested loop over rows
- A join is a nested loop over columns
- A join is compatible alternate realities
- A join is flatMap
- A join is the solution to the N+1 problem
- A join is paths through a graph
- A join is a minimal model
- A join is typechecking
- A join is an operation in the Set monad
- A join is the biggest acceptable relation
- A join is a…join
- A join is a ring product
These are nice ways to illustrate a non-trivial algebraic structure.
A really innovative way to store exact floating point numbers:
- for "safe numbers" (numbers whose value can be expressed precisely in floating point), store them as is
- for non-"safe numbers", store two safe numbers as denominator and nominator.
There is a lot of this method comparing to the other alternatives:
- BigDecimal: a lot faster than arbitrary precision BigDecimal
- Rational: denom and nom deoesn't blow up to extremely large numbers
And it is also faster and uses less space.
Comparing different approaches of generating HTML:
- String templating
- XML based embedding
- Inline XML (JSX)
- S-expr as DSL
- Custom DSL
A collection of seemingly interesting data structure and algorithms.
A thought provoking article on the coding syntax of sequences (lists, fields, pipes). An interesting reflection on how we typically intuit about sequence syntax in natural languages and how it may be better written in the other way around.
Interesting though useless knowledge on the evolution of the term "boilerplate" in programming context.
TL;DR: first it refers to the plate used to roll into water boiler cylinder in the steam age. Then in linotype age there is a technique to make mold lead into the lines of text for printing. These plates of lines of texts looks similar to boilerplates. And the connotation of "copy-pasted" text comes from the usage of these plates been casted several times and sent to various new publishers for printing.
I always wanted to write an article about how to write readable code. This article did it for me!
The core idea is that our brain has a small working memory. We are able to hold 4-6 things simultaneously, but no more. So to make the code more digestible, we need to abstract related things together into a bigger chunk if there are more than a handful of things to be dealt with.
Another thing the article didn't mention is that we can use symmetry to reduce the amount of memory needed. Symmetrical things require fewer places in working memory. "match cases" and "pipelining operators" are useful to construct symmetrical structures. The structures hints the brain on what to expect and we know the sub-expressions are equal in rank. This is why I am against using pipeline operator in places where there is no pipeline semantics (each step should be an endofunction).
A Preprocessor Iceberg Meme on C preprocessor magic. Similar to "The Cursed Computer Iceberg Meme".
The author made a point that reference count is almost always superior than GC in any case.