Immutability
Immutability is a property of a data value or object that cannot be modified after it is created; instead of changing an immutable value in place, operations produce a new value, leaving the original unchanged.
19 resources across 3 libraries
Glossary Terms(4)
Gleam
Gleam is a statically typed, functional programming language that compiles to Erlang bytecode (running on the BEAM virtual machine) or to JavaScript, designed…
Builder Pattern
The Builder pattern is a creational design pattern that separates the construction of a complex object from its representation, using a step-by-step builder ob…
Immutability
Immutability is a property of a data value or object that cannot be modified after it is created; instead of changing an immutable value in place, operations p…
Pure Function
A pure function is a function whose output depends only on its input arguments and which produces no observable side effects, such as mutating external state,…
Study Notes(4)
NSString and String Handling
How Objective-C represents and manipulates text with NSString and NSMutableString, including encoding, formatting, and common gotchas.
Values and Immutability
How F#'s let bindings are immutable by default, how to opt into mutability, and how shadowing differs from mutation.
Pure Functions and Immutability
Understand what makes a Haskell function pure, why referential transparency matters, and how immutability changes the way you update data and reason about prog…
vals, vars, and Types
How Scala's val/var distinction enforces immutability by default, and how the static type system infers and checks types at compile time.
Interview Questions(11)
What is the Builder Pattern?
The Builder pattern is a creational design pattern that separates the step-by-step construction of a complex object from its final representation, letting the…
What is Immutability in OOP?
Immutability means an object’s observable state cannot change after it is constructed — every field is fixed for the lifetime of the object, so any operation t…
Value Semantics vs Reference Semantics
Value semantics means a variable holds an independent copy of data so assigning or passing it duplicates the value, while reference semantics means a variable…
Constructor Injection vs Setter Injection
Constructor injection supplies dependencies as constructor parameters so an object is fully and immutably initialized the instant it is created, while setter i…
What is a Final Class in OOP?
A final class is a class declared with the final keyword so it cannot be subclassed by any other class, locking its implementation as the end of the inheritanc…
What is a Record Type?
A record type is an immutable, compiler-supported data carrier — introduced as `record` in Java — whose fields are declared once in the header and whose constr…
What is a Value Object?
A value object is an object defined entirely by its attribute values rather than a unique identity, meaning two value objects with the same data are interchang…
Getters and Setters: Best Practices
Good getter/setter practice means not generating them blindly for every field, but instead validating input in setters, returning defensive copies of mutable f…
Factory Pattern vs Builder Pattern
The Factory pattern encapsulates object creation behind a single method call that returns a fully-formed object of a chosen type, while the Builder pattern con…
Builder Pattern vs Telescoping Constructor
The builder pattern replaces a telescoping chain of overloaded constructors with a separate builder object that sets each field by name through chained method…
Shallow Copy vs Deep Copy: What Is the Difference?
A shallow copy duplicates only the top-level properties of an object or array, so nested objects are still shared by reference with the original, while a deep…