Tagged articles
immutability
47 articles · Page 1 of 1
This article demonstrates how Java's final keyword enables immutable objects that remove the need for synchronization in concurrent code, using a config hot-reload example that shows race conditions in mutable objects and zero errors with immutable design.
ConcurrencyJavaJava 17 records
0 likes · 12 min read

The article demonstrates how a convoluted Java user‑registration method—filled with magic error codes, inline regex checks, deep nesting, and mutable parameters—can be systematically refactored by introducing meaningful exception types, extracting password validation, applying early‑return style, and using immutable request records to produce clear, intent‑driven code.
Best PracticesClean CodeException Handling
0 likes · 7 min read

The article explains that an Entity is distinguished by a unique identifier while a Value Object is defined solely by its attributes and must be immutable, illustrating the concepts with Java Entity, record, and JPA mapping examples, and providing three practical questions to decide which to use.
DDDJPAJava
0 likes · 14 min read

The article explains how the Java final keyword can be applied to classes and methods to prevent inheritance and overriding, provides syntax and concrete code examples—including a final class and a final method in a chess algorithm—and advises using final for safety in constructors.
FinalJavaclass
0 likes · 5 min read

The article explains how functional programming’s emphasis on immutability and composability can dramatically reduce bugs, simplify testing, and improve maintainability, illustrated by a real‑world automotive sensor module that saw a 30% code‑size cut, an 80% bug drop, and test coverage rise from 40% to 90%.
Code Maintainabilitycomposabilityfunctional programming
0 likes · 5 min read

The article explains how Java records, with their built‑in immutability and auto‑generated methods, eliminate mutable state, reduce lock contention, and improve throughput in high‑concurrency architectures, providing concrete code examples and comparisons with traditional mutable beans.
ConcurrencyConcurrentHashMapJava
0 likes · 9 min read

The article explains that Java makes the String class final to ensure security, improve performance through string pooling and hash‑code caching, provide inherent thread‑safety, and maintain consistent behavior by preventing subclassing, illustrating each benefit with clear examples.
FinalJavaString
0 likes · 4 min read

DateTimeImmutable, introduced in PHP 5.5, offers immutable date objects that prevent side‑effects and improve code safety, while DateTime remains mutable; the article compares their behaviors, shows practical examples, outlines risks of mutability, and provides guidance on when to use each class.
Best PracticesDATETIMEDateTimeImmutable
0 likes · 6 min read

This article explores how Java Records and Lombok’s @Value annotation enable developers to create immutable objects, covering the definition of immutability, its benefits for thread safety and code simplicity, traditional implementation pitfalls, and concise modern approaches with practical code examples.
JavaLombokRecords
0 likes · 10 min read

Deep‑copying request payloads in Node.js prevents unintended mutations across middleware, protects shared state in async operations, improves debugging and security, and aligns with functional programming principles, making your APIs more robust, maintainable, and safe for handling user data and transactions.
Deep CopyNode.jsSecurity
0 likes · 12 min read

This article explains the benefits of functional programming in Go, outlines four core concepts, presents practical rules, and demonstrates five concrete examples—including pure functions, immutability, higher‑order functions, currying, and recursion—to help developers write clearer, more testable code.
CurryingGoPure Functions
0 likes · 9 min read

This article explains why mutating state in React or Vue breaks predictability, compares traditional immutable update techniques like map() and spread syntax, and demonstrates how the native Array.prototype.with() method provides a concise, high‑performance, immutable way to replace array elements in a single step.
JavaScriptReactarray
0 likes · 5 min read

This article explains how Python actually creates objects, clarifying the distinct roles of the __new__ and __init__ methods, and demonstrates practical techniques such as inheriting immutable types, adding metadata, and implementing singleton patterns through custom object creation.
Pythondesign-patternsimmutability
0 likes · 13 min read

This article introduces the essential Guava utilities for Java developers, covering data validation, immutable collections, collection factories, multiset and multimap handling, advanced string operations, and simple caching, all with clear code examples to make your code more elegant and robust.
GuavaMultimapString Manipulation
0 likes · 18 min read

This article examines PHP's DateTime class, analyzing its mutable design drawbacks, the benefits of the immutable DateTimeImmutable alternative, and offers practical guidelines and best‑practice strategies for developers to write safer, more maintainable date‑handling code.
BackendDATETIMEPHP
0 likes · 8 min read

An object is hashable in Python if it is immutable and implements __eq__, allowing it to serve as a dictionary key; the hash value is normally derived from the object's address unless __hash__ is overridden, and equal objects must share identical hash values, influencing dictionary indexing and collision handling.
custom __eq__custom __hash__dictionary
0 likes · 11 min read


21CTOMay 28, 2024 · Frontend Development
This article explores five advanced JavaScript techniques—Monads, declarative programming, server‑side caching, immutability, and pattern matching—explaining their concepts, benefits, and providing practical code examples to help senior developers build more robust, high‑performance web applications.
Advanced TechniquesCachingJavaScript
0 likes · 10 min read

This article explains Python's namedtuple data structure, highlighting its readability, lightweight nature, performance advantages, built‑in methods, and how it compares to regular tuples through clear code examples that demonstrate creation, element access, updating, serialization, and advanced features.
Code ExamplesNamedtuplePython
0 likes · 8 min read

This article explores Java String internals across JDK versions, explaining its memory representation, immutability, substring behavior, and how techniques like StringBuilder, intern(), and shared objects can dramatically reduce memory usage from gigabytes to megabytes in high‑scale applications.
InternJavaMemory Optimization
0 likes · 13 min read

This article explains why Java's String class is immutable, detailing the benefits such as thread safety, cached hash codes, and string pooling, and describes the internal mechanisms—including a private final char array, creation of new objects on concatenation, and the intern method—that enforce this immutability.
ConcurrencyJavaString
0 likes · 5 min read

This article reflects on the author's journey with Java, explaining the immutable nature of the String class, its rich set of methods—including substring, indexOf, replace, and regex support—while also discussing its limitations and alternatives like StringBuilder.
JavaRegularExpressionsString
0 likes · 5 min read

PHP 8 introduces readonly properties that can only be set during object initialization, providing immutable, constant-like behavior useful for defining constants, protecting sensitive data, and enhancing code safety, with examples showing initialization, immutability, consistency, and even getter/setter usage.
Code ExamplesPHPbackend development
0 likes · 6 min read

The article explains why Java's String class is immutable, highlighting performance gains from constant‑pool caching, security advantages for sensitive data, thread‑safety without synchronization, and hash‑code caching that speeds up hash‑based collections in Java applications.
JavaSecurityString
0 likes · 4 min read

Discover ten practical C++ class design guidelines—from embracing modern standards and namespace modularization to minimizing class size, ensuring low coupling, high cohesion, immutability, and leveraging tools like CppDepend—to write cleaner, more maintainable, and thread‑safe code.
Best PracticesC++Cohesion
0 likes · 11 min read

This article explores Google Guava’s rich set of utilities—including Joiner, Splitter, CharMatcher, Multiset, Multimap, BiMap, Table, Functions, Predicate, Optional, Preconditions, and Cache—demonstrating how they simplify string handling, collections, immutability, caching, and asynchronous callbacks for more elegant Java development.
CachingGoogle GuavaJava
0 likes · 11 min read

The article explains how shared mutable state, such as global or static variables, can cause hard‑to‑debug bugs in multithreaded Java applications, and demonstrates that adopting immutability, pure functions, and event‑sourcing principles eliminates these issues, offering concrete coding guidelines and examples.
Javafunctional programmingimmutability
0 likes · 10 min read

Functional programming, once a niche paradigm, is rapidly entering mainstream software development as teams adopt pure functions, immutability, and higher‑order functions to reduce bugs, improve modularity, and manage the growing complexity of large codebases across many languages and frameworks.
Programming ParadigmsPure Functionsfunctional programming
0 likes · 11 min read

This article demonstrates how reflection can alter the internal byte array of a java.lang.String in Java 11, causing both identical literals to change, explains why the hashCode remains unchanged, and shows that Java 17 blocks such modifications with runtime exceptions.
JavaJava11Reflection
0 likes · 5 min read

This article examines Java's String immutability, detailing how the final character array and private design prevent modification, compares mutable alternatives like StringBuilder and StringBuffer, and discusses their thread safety and performance implications to guide developers in choosing the appropriate class for different scenarios.
JavaStringStringBuffer
0 likes · 5 min read


ITPUBJul 6, 2022 · Backend Development
This article walks through applying Domain‑Driven Design in Go, focusing on value objects: their definition, immutability, implementation details, common pitfalls with pointers and serialization, practical code patterns, and how to model enums, offering concrete guidance for robust backend development.
Best PracticesDomain-Driven DesignEnum
0 likes · 15 min read


21CTOJun 24, 2022 · Backend Development
The PHP RFC introduces readonly classes, allowing all properties of a class to be immutable, prohibiting dynamic and static properties, and providing reflection support, with examples, restrictions, inheritance rules, and compatibility notes, helping developers write safer, more robust code.
PHPReflectionimmutability
0 likes · 5 min read

This article explains why Java strings are immutable, how the JVM uses the string constant pool and the final keyword to manage memory, and demonstrates the behavior with code examples that show reference handling, object creation, and common string operations.
FinalJVMJava
0 likes · 11 min read

This article explains why Java String objects are immutable, how the JVM’s string constant pool reuses instances, the role of the final keyword and char[] storage, and demonstrates that all mutating operations actually create new String objects rather than altering the original.
FinalJVMJava
0 likes · 10 min read

The article explains Java's String immutability, shows how concatenation creates new objects, and discusses the design reasons—caching, security, thread‑safety, hash‑code caching and performance—while recommending mutable alternatives like StringBuilder for modifiable text.
JavaMemorySecurity
0 likes · 7 min read

This article explains the immutable nature of Java's String class, compares it with mutable StringBuilder and thread‑safe StringBuffer, shows how the JVM handles string literals, constant pool, intern(), and provides performance guidelines and code examples for efficient string manipulation.
StringStringBufferStringBuilder
0 likes · 16 min read

This article explains Bitcoin by distinguishing the digital token from its underlying protocol, describes its decentralized network, limited supply, pseudonymous usage, immutability, divisibility, and how it differs from traditional fiat currencies, providing a clear introductory overview of cryptocurrency fundamentals.
BitcoinSupply Limitcryptocurrency
0 likes · 8 min read

The article surveys functional programming’s origins, from Hilbert and Church to lambda calculus, explains its pure‑computation model versus imperative state mutation, outlines essential concepts such as currying, higher‑order functions, and immutability, discusses JavaScript‑specific practices and limitations, and notes the growing impact of functional ideas in modern front‑end frameworks.
Pure Functionshigher-order functionsimmutability
0 likes · 24 min read

This article explains the two ways to create Java strings, demonstrates how string literals are shared in the method area, shows the effect of the intern() method at runtime, and discusses why the String class is final, immutable, and thread‑safe.
FinalJavaString
0 likes · 8 min read

This article explains the concept of Java String immutability, illustrates how references work with examples and diagrams, and discusses the benefits such as string pool reuse, hashcode caching, thread safety, and security that improve memory efficiency and application performance.
JavaStringimmutability
0 likes · 8 min read


21CTOAug 23, 2019 · Fundamentals
Object-oriented programming, once hailed as the pinnacle of software design, is criticized for its complexity, mutable state, and poor testability, while functional programming offers simpler, more reliable code through immutability and pure functions, prompting a call to abandon OOP in favor of functional paradigms.
ComplexityOOPProgramming Paradigms
0 likes · 29 min read


21CTOApr 13, 2018 · Blockchain
This article explains blockchain fundamentals and demonstrates a Java implementation, covering block structure, immutability, hashing, Merkle trees, transaction handling, proof‑of‑work mining, and unit tests with complete code examples.
JavaMerkle treeSmart Contracts
0 likes · 12 min read

This article explains how Java strings are defined, how assigning one string variable to another copies the reference, how concatenation creates a new immutable string object, and why mutable alternatives like StringBuilder should be used to avoid excessive garbage collection.
JavaStringfundamentals
0 likes · 2 min read

This article presents a series of annotated diagrams from the Program Creek Java tutorial that visually explain fundamental Java topics such as string immutability, the difference between equals() and hashCode(), exception hierarchy, collection framework, synchronization, aliasing, heap vs. stack memory, and the JVM runtime data areas.
Core ConceptsJVMexceptions
0 likes · 3 min read

The article explores the evolution and core concepts of responsive architecture for iOS, explains immutability and its model layer, examines Flux as its foundational pattern, and provides practical guidance on integrating responsive design into existing mobile app architectures.
FluxResponsive ArchitectureiOS
0 likes · 11 min read

This article explains Java String's immutability, constant pool optimization, the impact of the final keyword, and practical techniques such as using split alternatives, StringBuilder/StringBuffer, and efficient primitive-to-String conversions to dramatically improve performance.
JavaStringimmutability
0 likes · 6 min read

This article presents a detailed guide to modern Java development, covering coding style, immutable data structures, builder patterns, dependency injection, null handling, formatting, Javadoc, streams, publishing strategies, Maven configuration, CI tools, repository management, configuration automation, essential development tools, and a curated list of widely used Java libraries.
Best PracticesBuilder PatternJava
0 likes · 22 min read

The article explains the concept of immutable objects in object‑oriented programming, uses Java’s String and Date classes as examples, lists benefits such as thread safety, reduced coupling and side‑effects, and discusses counter‑arguments and practical considerations for adopting immutability.
DesignJavaimmutability
0 likes · 8 min read
