21 Matching Annotations
  1. Sep 2023
    1. A new class for containing value objects: it is somewhat similar to Struct (and reuses some of the implementation internally), but is intended to be immutable, and have more modern and cleaner API.
  2. Jun 2023
    1. you nailed it! A consumer should only be able to set an object's state at initialization (via the constructor). Once the object has come to life, it should be internally responsible for its own state lifecycle. Allowing consumers to affect the state adds unnecessary complexity and risk.
    2. Making a property writable adds an order of magnitude in complexity. In the real world it's definitely not realistic for every class to be immutable, but if most of your classes are, it's remarkably easier to write bug-free code. I had that revelation once and I hope to help others have it.
  3. Feb 2021
    1. Trailblazer will automatically create a new Context object around your custom input hash. You can write to that without interferring with the original context.
    1. Purely functional programming may also be defined by forbidding state changes and mutable data.
    2. Purely functional data structures are persistent. Persistency is required for functional programming; without it, the same computation could return different results.
    1. ather, data is passed around from operation to operation, from step to step. We use OOP and inheritance solely for compile-time configuration. You define classes, steps, tracks and flows, inherit those, customize them using Ruby’s built-in mechanics, but this all happens at compile-time. At runtime, no structures are changed anymore, your code is executed dynamically but only the ctx (formerly options) and its objects are mutated. This massively improves the code quality and with it, the runtime stability
  4. Oct 2020
    1. We could freeze the objects in the model but don't for efficiency. (The benefits of an immutable-equivalent data structure will be documented in vtree or blog post at some point)

      first sighting: "immutable-equivalent data"

    2. A VTree is designed to be equivalent to an immutable data structure. While it's not actually immutable, you can reuse the nodes in multiple places and the functions we have exposed that take VTrees as arguments never mutate the trees.
    1. We don't know if the passed in props is a user created object that can be mutated so we must always clone it once.
    1. Note that interacting with these <input> elements will mutate the array. If you prefer to work with immutable data, you should avoid these bindings and use event handlers instead.
    1. use-methods is built on immer, which allows you to write your methods in an imperative, mutating style, even though the actual state managed behind the scenes is immutable.
  5. Sep 2020
    1. Svelte offers an immutable way — but it’s just a mask to hide “assignment”, because assignment triggers an update, but not immutability. So it’s enough to write todos=todos, after that Svelte triggers an update.
    1. We wanted a library designed specifically for a functional programming style, one that makes it easy to create functional pipelines, one that never mutates user data.
  6. Aug 2020
    1. Valhalla aims to revise the memory model for Java to allow for immutable types, which are more complex than primitives, but less flexible than objects. Sometimes you have more complex data that doesn’t change over the course of that object’s lifespan; burdening it with the overhead of a class is unnecessary. The initial proposal put it more succinctly: “Codes like a class, works like an int.” “For things like big data for machine learning or for natural language, Valhalla promises to represent data in a way that allows the JVM to fully take advantage of modern hardware architectures that have changed dramatically since Java was created,” said Saab.
  7. Sep 2019
    1. Keep the ergonomics of stable reference and directly mutable objects. In other words; be able to have a variable pointing to an object, and make subsequent reads or writes to it. Without needing to fear that you’re working with old data. While, in the background,..State is stored in an immutable, structurally shared tree.
  8. Aug 2019