31 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. Dec 2022
  4. Nov 2021
    1. The reason is that all mainstream OS makers are moving towards a radical new paradigm for OSes called 'immutable' systems (apple recently completed this transition, ms failed twice and pins its hopes on win11, linux distros are held back by a requirement for lightweight container formats to gain a foothold first before decreasing mutability then switching to read-only system partitions).Immutability trended first for servers, where canonical gained some success early before pushing for snaps for desktop. Its a way to guarantee a system does not deviate from a 'know good' state and neither its reliability or hardware compatibility/certifications change across updates.
  5. 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
  6. 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. When processors are exposed from a module (for example, unified itself) they should not be configured directly, as that would change their behavior for all module users. Those processors are frozen and they should be called to create a new processor before they are used.
    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.
  7. 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.
  8. 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.
  9. 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.
  10. Aug 2019
  11. Jun 2019
    1. Stop telling your manager that blockchain will make information correct. It is a mechanism for detecting untruths, not a magical lie-detector.

      Storing immutable proof of a crime on a blockchain isn't a good idea

  12. Mar 2016
  13. Oct 2015