222 private links
Parsing increases the information in the type system. A list can be of type NonEmpty, i.e. there is at least one element.
Use a data structure that makes illegal states unrepresentable.
Push the burden of proof upward as far as possible, but no further.
and awesome guidelines to follow.
So parse "data" and return the closest type instead of only validate them.
It states that every method should either be a command that performs an action, or a query that returns data to the caller, but not both.
More formally, methods should return a value only if they are referentially transparent and hence possess no side effects.
Even in single-threaded programs, it is sometimes arguably significantly more convenient to have a method that is a combined query and command. Martin Fowler cites the pop() method of a stack as an example.
Safari is using the web to create a desktop app in a very convenient way!
There’s a HTML file and a Service Worker that keeps it working offline
More about it on https://adactio.com/journal/20716
It explains the Writer monad and the Option monad.
This pattern is used for future or promise by the way.
A way to represent the either/or in JSON. Using enums that leads to empty objects. These empty objects can then be extended as needed.
Compilers are pipelines with a serie of step. Each step transform the input and provides data to the next.
Each step has then a contract with the input provided and its output 😃
The author goes in depth.
We can completely segment one component of the compiler from another by having the right form of data structure in between them. To build that data structure, you don’t need to know anything that happens to it afterwards, you just need to know what it means.
I wasn't aware of the mess on Windows. I also agree that it will be more confortable for users to follow XDG conventions on *nix. The article explains well why it is such a mess.
Solution?
On *nix, the answer is straightforward: get everyone to adhere to the XDG Base Directory specification.
How do we actually encapsulate state, and actually regain compositional reasoning, fully? The technique that actually works is confining state locally. Confining state to within an object (“encapsulation” as it’s usually meant) doesn’t get us there because the state is owned by the object and thus escapes, but fully-local to a function does successfully isolate that state.
Instead of thinking in terms of a function that modifies multiple objects, you think in terms of a function that computes a description of how multiple objects should be affected, then a separate interpreter of that data type that animates that description into real action.
A minimal representation is the events of the DOM: they describe a change.
The author describes the advantages of such.
Note that Rust or Typescript are good candidates to represent algebraic data types.
The different levels of portability:
- Language
- Standard Library
- POSIX
- 3rd party libraries
- OS
The more features a program needs, the further out it must reach through the layers.#
Avoid – or wrap – compiler language extensions
C though portable is not suitable as much work as to be done to ensures it works on multiple systems.
In order to use OS extras, use an interface to reimplement it in systems that does not support it.
Kafka has a good throughput with sequential Writes and Reads.
Kafka can move a lot of data because of the zero copy read principle:
Before:
- Disc to OS buffer
- Write the content of the OS buffer to the RAM
- Copy the data to the application Buffer
- Copy the data back to the socket buffer
- Copy the data from the socket to the Network Interface Chip buffer and send it
With zero-copy read principle:
- Read from the disc and load it into the OS Buffer
- Directly copy to the NIC Buffer (the CPU is not involved)
Good practices !
✅ on my personal projects
- Documentation in the same repo as the code ✅
- Mechanisms for creating test data
- Rock solid database migrations
- Templates for new projects and components
- Automated code formatting ✅
- Tested, automated process for new development environments ✅
- Automated preview environments ✅
As a result, to avoid downtime you need to design every schema change with this in mind. The process needs to be:
- Design a new schema change that can be applied without changing the application code that uses it.
- Ship that change to production, upgrading your database while keeping the old code working.
- Now ship new application code that uses the new schema.
- Ship a new schema change that cleans up any remaining work—dropping columns that are no longer used, for example.
I find these explanations great to draw some charts for my masterthesis :)
Even if it is not complete
Using web browsers might seem inefficient, but they solve so many problems.
FasterThanLime describes how hard it is to build a text-messaging app from scratch if we want to develop it properly.