Restricting attributes that can be set in Python
Explains how to restrict attribute assignment in Python classes to prevent typos and enforce defined attributes, using a real-world example.
Explains how to restrict attribute assignment in Python classes to prevent typos and enforce defined attributes, using a real-world example.
A programmer reflects on a decade of experience, sharing highly opinionated insights on object-oriented programming and software design paradigms.
A comprehensive guide to JavaScript classes, covering syntax, fields, methods, inheritance, and how they work with prototypal inheritance.
A guide to understanding and correctly using the 'this' keyword in JavaScript, covering common pitfalls and binding techniques.
A podcast episode exploring the original definition of Object-Oriented Programming and comparing it to modern interpretations.
A podcast episode discussing how using 'final' in code can improve maintainability, part of a series on SOLID principles and interfaces.
Explains the benefits of static factory methods in Java, covering naming, instance control, and return type flexibility.
Explains why custom S3 methods in R fail and how to fix them by properly defining generic functions.
Explains the Swift factory method design pattern with code examples, showing how to decouple object creation logic using protocols and classes.
A tutorial on implementing the simple factory design pattern in Swift to encapsulate object creation, using examples like color and environment factories.
A beginner-friendly explanation of dependency injection using a car analogy, contrasting it with inheritance and promoting composition.
Explains the Strategy design pattern, its goals, structure, and provides a PHP implementation example for flexible algorithm selection.
An introduction to Object-Oriented Programming in JavaScript, covering the creation of objects from a common template.
Explains Python's __eq__ and __hash__ methods, their interaction, and the critical rule that an object's hash must never change.
A developer explains how implementing lazy instantiation for game object classes dramatically improved their custom game engine's reset performance.
Explains the JavaScript 'this' keyword, arguing it's essential to learn despite its perceived complexity, and discusses its role in OOP vs. functional programming.
A guide explaining the 'this' keyword in JavaScript, covering its behavior in six different contexts like global scope, object methods, and arrow functions.
Explains an object-oriented approach to reading large files line by line in PHP, comparing it to generator functions and file_get_contents.
The article compares classes and functions in JavaScript, arguing that functional programming leads to simpler, more maintainable code.
A tutorial on implementing custom array-like collection objects in PHP using the ArrayAccess and Iterator interfaces.