21 Matching Annotations
- Sep 2023
-
rubyreferences.github.io rubyreferences.github.io
-
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.
-
- Jun 2023
-
stackoverflow.com stackoverflow.com
-
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.
-
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.
-
- Feb 2021
-
trailblazer.to trailblazer.to
-
Trailblazer will automatically create a new Context object around your custom input hash. You can write to that without interferring with the original context.
Tags
Annotators
URL
-
-
en.wikipedia.org en.wikipedia.org
-
Purely functional programming may also be defined by forbidding state changes and mutable data.
-
Purely functional data structures are persistent. Persistency is required for functional programming; without it, the same computation could return different results.
-
-
trailblazer.to trailblazer.to
-
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
Tags
Annotators
URL
-
- Oct 2020
-
final-form.org final-form.org
-
Note: it does not mutate the object, but returns a new object.
-
-
github.com github.com
-
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"
-
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.
-
-
github.com github.com
-
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.
-
-
-
Solid’s State primitive is arguably its most powerful and distinctive one. Through the use of proxies and explicit setters it gives the control of an immutable interface and the performance of a mutable one
-
-
-
We have to be careful not to mutate state so when we have some complex state like an object or an array we have to use some ugly tricks like in the setTodoCompleted function above.
-
-
svelte.dev svelte.dev
-
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.
-
-
github.com github.com
-
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.
Tags
Annotators
URL
-
- Sep 2020
-
medium.com medium.com
-
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.
-
-
github.com github.com
-
you should take care not to mutate the passed in value
-
-
ramdajs.com ramdajs.com
-
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.
Tags
Annotators
URL
-
- Aug 2020
-
stackoverflow.blog stackoverflow.blog
-
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.
-
- Sep 2019
-
codeburst.io codeburst.io
-
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.
-
- Aug 2019
-
www.youtube.com www.youtube.com
-
.
Tags
Annotators
URL
-