# class

Published articles for class.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Magic statics vs. std::call\_once

DevFeed: [Magic statics vs. std::call\_once](<https://devfeed.tech/articles/magic-statics-vs-std-call-once-42167.md>)

Original publisher: [Read original article](<https://devblogs.microsoft.com/oldnewthing/20260916-00/?p=112703>)

Author: Raymond Chen

Published: 2026-09-16T14:00:00Z

Content type: article

Language: en

Sources: [Raymond Chen](<https://devfeed.tech/sources/raymond-chen.md>)

Topics: [Code](<https://devfeed.tech/topics/code.md>), [Caching](<https://devfeed.tech/topics/caching.md>), [execution](<https://devfeed.tech/topics/execution.md>), [function](<https://devfeed.tech/topics/function.md>), [class](<https://devfeed.tech/topics/class.md>)

Tags: [cache](<https://devfeed.tech/tags/cache.md>), [class](<https://devfeed.tech/tags/class.md>), [code](<https://devfeed.tech/tags/code.md>), [execution](<https://devfeed.tech/tags/execution.md>), [function](<https://devfeed.tech/tags/function.md>), [old-new-thing](<https://devfeed.tech/tags/old-new-thing.md>), [static](<https://devfeed.tech/tags/static.md>)

### AI overview

The article compares function-local static variables with std::call_once for caching values that are expensive to calculate. It explains why magic statics are unsuitable for lazily initializing per-instance data and points to deferred execution as a related alternative.

### Source excerpt

They sort of do the same thing, but differently. The post Magic statics vs. <CODE>std::call_once</CODE> appeared first on The Old New Thing.

## Code Smell 321 - Getter Piggybacking

DevFeed: [Code Smell 321 - Getter Piggybacking](<https://devfeed.tech/articles/code-smell-321-getter-piggybacking-18228.md>)

Original publisher: [Read original article](<https://maximilianocontieri.com/code-smell-321-getter-piggybacking>)

Author: Maxi Contieri

Published: 2026-08-20T02:51:49Z

Content type: article

Language: en

Sources: [Maximiliano Contieri - Software Design](<https://devfeed.tech/sources/maximiliano-contieri-software-design.md>)

Topics: [Refactoring](<https://devfeed.tech/topics/refactoring.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [business-logic](<https://devfeed.tech/tags/business-logic.md>), [class](<https://devfeed.tech/tags/class.md>), [code](<https://devfeed.tech/tags/code.md>), [refactoring](<https://devfeed.tech/tags/refactoring.md>)

### AI overview

This article explains a code smell in which an existing getter is reused to implement business logic outside the object that owns the value. It describes the resulting duplicated rules, broken encapsulation, scattered comparisons, and fragile refactoring, and recommends adding behavior methods, keeping comparisons inside the object, passing collaborators instead of primitives, and using getters mainly for rendering.

### Source excerpt

TL;DR: Don't reuse an existing getter to bolt on new business logic from outside the object. Problems 😔 Duplicated business rules Broken encapsulation Scattered comparison logic Hidden domain kn

## Weekly Update 517: Cyber Ransoms

DevFeed: [Weekly Update 517: Cyber Ransoms](<https://devfeed.tech/articles/weekly-update-517-cyber-ransoms-41985.md>)

Original publisher: [Read original article](<https://www.troyhunt.com/weekly-update-517/>)

Author: Troy Hunt

Published: 2026-08-18T03:44:58Z

Content type: opinion

Language: en

Sources: [Troy Hunt](<https://devfeed.tech/sources/troy-hunt.md>)

Topics: [ransomware](<https://devfeed.tech/topics/ransomware.md>), [Cybercrime](<https://devfeed.tech/topics/cybercrime.md>)

Tags: [breach](<https://devfeed.tech/tags/breach.md>), [class](<https://devfeed.tech/tags/class.md>), [cyber](<https://devfeed.tech/tags/cyber.md>), [ransomware](<https://devfeed.tech/tags/ransomware.md>), [weekly-update](<https://devfeed.tech/tags/weekly-update.md>)

### AI overview

The article comments on ransomware as extortion, the financial motives of attackers, and the legal and communication pressures faced by breached companies.

### Source excerpt

The current ransomware situation is a bit of a kludge (deep breath): a lot of ransomware (which often doesn't even involve "ware", it's just extortion) is carried out by kids who successfully make a truckload of money but can't spend it without

## Why Two Similar Compiler Cases Cannot Share One Calling Convention

DevFeed: [Why Two Similar Compiler Cases Cannot Share One Calling Convention](<https://devfeed.tech/articles/keleusma-research-spike-when-an-apparent-design-wart-is-a-semantic-boundary-39753.md>)

Original publisher: [Read original article](<https://sgeos.github.io/engineering/compilers/verification/2026/08/07/two_calling_conventions.html>)

Author: Brendan Sechter

Published: 2026-08-07T09:00:00Z

Content type: article

Language: en

Sources: [Brendan A R Sechter's Development Blog](<https://devfeed.tech/sources/brendan-a-r-sechter-s-development-blog.md>)

Topics: [Compiler](<https://devfeed.tech/topics/compiler.md>), [interface](<https://devfeed.tech/topics/interface.md>), [Back end](<https://devfeed.tech/topics/backend.md>), [test](<https://devfeed.tech/topics/test.md>), [Mathematics](<https://devfeed.tech/topics/mathematics.md>)

Tags: [article](<https://devfeed.tech/tags/article.md>), [backend](<https://devfeed.tech/tags/backend.md>), [case-study](<https://devfeed.tech/tags/case-study.md>), [class](<https://devfeed.tech/tags/class.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [compilers](<https://devfeed.tech/tags/compilers.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [interface](<https://devfeed.tech/tags/interface.md>), [mathematics](<https://devfeed.tech/tags/mathematics.md>), [measurement](<https://devfeed.tech/tags/measurement.md>), [verification](<https://devfeed.tech/tags/verification.md>)

### AI overview

This compiler backend case study argues that two similar cases cannot be unified when one must report two values through an interface with only one available slot. A counting argument shows that the apparent similarity of nine measured occurrences is irrelevant to the shared interface design. The article also identifies an earlier rule that unnecessarily excluded ten of twenty-four cases.

### Source excerpt

A system had grown two ways of doing what looked like one thing. The obvious move was to tidy them into one. The tidying turns out to be impossible, and the reason it is impossible is the reason the two ways exist. The argument that settles it needs no specialist knowledge and fits in a sentence. One of the two cases has two things to report and only one slot to report them in. Whichever thing the slot is given, the other is lost. The other case has only one thing to report, so the single slot is exactly enough. That is a counting argument, it is decided before any code is written, and it is not the argument an engineer reaches for by default. The engineer's instinct is to look at the cases and ask whether they resemble one another. They did. Every one of the nine measured occurrences had exactly the shape that invited the tidy-up, and the measurement encouraged precisely the wrong conclusion. The resemblance was real and it was irrelevant, because the defect was never in the instances. It was in the interface they would have had to share. This article is about that distinction, which is between evidence about members of a class and evidence about the channel the class must pass through. The second dominates the first and is cheaper to check. The article reports the measurement, the way the measurement pointed the wrong direction, and the argument that settled it. It also reports a rule this author shipped one increment earlier which turns out to be stricter than the property it enforces, excluding ten of twenty-four cases for no reason. No test found that. It surfaced while gathering data for this article. How to read this The general argument is in the opening, in the section called The Argument That Settled It, and in Pattern Extraction. Those three need nothing but attention. The sections between them work the argument through a real case with real numbers, and they use the vocabulary of the trade. Every term is glossed at first use, but a reader who wants the r

## Actegories

DevFeed: [Actegories](<https://devfeed.tech/articles/actegories-28861.md>)

Original publisher: [Read original article](<https://bartoszmilewski.com/2026/06/30/actegories/>)

Author: Bartosz Milewski

Published: 2026-06-30T11:45:46Z

Content type: tutorial

Language: en

Sources: [Bartosz Milewski's Programming Cafe](<https://devfeed.tech/sources/bartosz-milewski-s-programming-cafe.md>)

Topics: [Programming](<https://devfeed.tech/topics/programming.md>), [Haskell](<https://devfeed.tech/topics/haskell.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [actegories](<https://devfeed.tech/tags/actegories.md>), [category-theory](<https://devfeed.tech/tags/category-theory.md>), [class](<https://devfeed.tech/tags/class.md>), [haskell](<https://devfeed.tech/tags/haskell.md>), [lens](<https://devfeed.tech/tags/lens.md>), [optics](<https://devfeed.tech/tags/optics.md>), [programming](<https://devfeed.tech/tags/programming.md>), [types](<https://devfeed.tech/tags/types.md>)

### AI overview

This tutorial introduces actegories, explaining their relationship to monoidal categories and their role in programming optics such as lenses, prisms, and traversals. It develops the concepts through Haskell models, including tensor products, unit objects, constraints, associators, unitors, and categorical actions.

### Source excerpt

Previously: Kan Extensions in Double Categories. In programming, actegories play a central role in optics: lenses, prisms, traversals, etc. To understand actegories, let's start with the definition of a monoidal category. Monoidal Category A monoidal category is a category equipped with a tensor product. A tensor product is a functor . We assume that this [...]

## PHPStan custom rules

DevFeed: [PHPStan custom rules](<https://devfeed.tech/articles/phpstan-custom-rules-39472.md>)

Original publisher: [Read original article](<https://akrabat.com/phpstan-custom-rules/>)

Author: Rob

Published: 2026-03-03T11:00:00Z

Content type: tutorial

Language: en

Sources: [Rob Allen](<https://devfeed.tech/sources/rob-allen.md>)

Topics: [PHP](<https://devfeed.tech/topics/php.md>), [Exception](<https://devfeed.tech/topics/exception.md>), [Code](<https://devfeed.tech/topics/code.md>), [phpstorm](<https://devfeed.tech/topics/phpstorm.md>)

Tags: [autocomplete](<https://devfeed.tech/tags/autocomplete.md>), [class](<https://devfeed.tech/tags/class.md>), [code](<https://devfeed.tech/tags/code.md>), [container](<https://devfeed.tech/tags/container.md>), [exception](<https://devfeed.tech/tags/exception.md>), [extension](<https://devfeed.tech/tags/extension.md>), [php](<https://devfeed.tech/tags/php.md>), [phpstorm](<https://devfeed.tech/tags/phpstorm.md>), [runtime](<https://devfeed.tech/tags/runtime.md>), [settings](<https://devfeed.tech/tags/settings.md>)

### AI overview

This tutorial explains how a PHPStan custom rule can detect references to unavailable PHP classes. It also describes configuring PhpStorm to limit autocomplete to extensions used by the application.

### Source excerpt

Recently I discovered that this code passed our PHPStan level 10 checks: use http\Exception\InvalidArgumentException; // ... throw new InvalidArgumentException; I was surprised as http\Exception\InvalidArgumentException is not a class in our system. While cooling, I discovered that there's an http PHP extension and it appears that PHPStan has a stub for this which means that it accepts it as existing even if it doesn't. What we think happened is that I wrote throw new InvalidArgumentException; and... continue reading.

## 12 OOP Concepts EVERY Developer Should Know

DevFeed: [12 OOP Concepts EVERY Developer Should Know](<https://devfeed.tech/articles/12-oop-concepts-every-developer-should-know-33559.md>)

Original publisher: [Read original article](<https://blog.algomaster.io/p/12-oop-concepts-every-developer-should-know>)

Author: Ashish Pratap Singh

Published: 2026-02-12T04:27:26Z

Content type: tutorial

Language: en

Sources: [AlgoMaster Newsletter](<https://devfeed.tech/sources/algomaster-newsletter.md>)

Topics: [Object-oriented programming (OOP)](<https://devfeed.tech/topics/oop.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [Code](<https://devfeed.tech/topics/code.md>), [interfaces](<https://devfeed.tech/topics/interfaces.md>), [Polymorphism](<https://devfeed.tech/topics/polymorphism.md>), [App](<https://devfeed.tech/topics/app.md>)

Tags: [class](<https://devfeed.tech/tags/class.md>), [classes](<https://devfeed.tech/tags/classes.md>), [code](<https://devfeed.tech/tags/code.md>), [concepts](<https://devfeed.tech/tags/concepts.md>), [developer](<https://devfeed.tech/tags/developer.md>), [interface](<https://devfeed.tech/tags/interface.md>), [interfaces](<https://devfeed.tech/tags/interfaces.md>), [object-oriented](<https://devfeed.tech/tags/object-oriented.md>), [oop](<https://devfeed.tech/tags/oop.md>), [practical](<https://devfeed.tech/tags/practical.md>), [programming](<https://devfeed.tech/tags/programming.md>), [real-world](<https://devfeed.tech/tags/real-world.md>)

### AI overview

An introductory tutorial on object-oriented programming explains how classes, objects, and interfaces organize state and behavior. It uses real-world examples such as users, orders, payments, and payment gateways, and notes that these concepts are relevant to low-level design interviews.

### Source excerpt

Key Object-Oriented Programming Concepts

## Creating an Arduino Library for ESP32

DevFeed: [Creating an Arduino Library for ESP32](<https://devfeed.tech/articles/creating-an-arduino-library-for-esp32-13737.md>)

Original publisher: [Read original article](<https://developer.espressif.com/blog/2025/12/arduino-library-creation/>)

Author: John Lee

Published: 2025-12-15T00:00:00Z

Content type: tutorial

Language: en

Sources: [Blog on Developer Portal](<https://devfeed.tech/sources/blog-on-developer-portal.md>)

Topics: [Arduino](<https://devfeed.tech/topics/arduino.md>), [ESP32](<https://devfeed.tech/topics/esp32.md>), [Library](<https://devfeed.tech/topics/library.md>), [Development](<https://devfeed.tech/topics/development.md>), [Code](<https://devfeed.tech/topics/code.md>), [C++](<https://devfeed.tech/topics/c-plus-plus.md>), [ide](<https://devfeed.tech/topics/ide.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [API](<https://devfeed.tech/topics/api.md>)

Tags: [arduino](<https://devfeed.tech/tags/arduino.md>), [arduino-ide](<https://devfeed.tech/tags/arduino-ide.md>), [beginner](<https://devfeed.tech/tags/beginner.md>), [blog](<https://devfeed.tech/tags/blog.md>), [c-plus-plus](<https://devfeed.tech/tags/c-plus-plus.md>), [class](<https://devfeed.tech/tags/class.md>), [classes](<https://devfeed.tech/tags/classes.md>), [code](<https://devfeed.tech/tags/code.md>), [development](<https://devfeed.tech/tags/development.md>), [esp32](<https://devfeed.tech/tags/esp32.md>), [getting-started](<https://devfeed.tech/tags/getting-started.md>), [guide](<https://devfeed.tech/tags/guide.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [ide](<https://devfeed.tech/tags/ide.md>), [libraries](<https://devfeed.tech/tags/libraries.md>), [library](<https://devfeed.tech/tags/library.md>), [maintainability](<https://devfeed.tech/tags/maintainability.md>), [modular](<https://devfeed.tech/tags/modular.md>), [modularity](<https://devfeed.tech/tags/modularity.md>), [modules](<https://devfeed.tech/tags/modules.md>), [programming](<https://devfeed.tech/tags/programming.md>), [structure](<https://devfeed.tech/tags/structure.md>), [tutorial](<https://devfeed.tech/tags/tutorial.md>)

### AI overview

A step-by-step guide to creating, structuring, and publishing custom Arduino libraries for ESP32. It explains library benefits and structure, prerequisites, and implementation through a minimal "Hello World" example.

### Source excerpt

Learn how to create, structure, and publish Arduino libraries for ESP32. This step-by-step guide covers everything from understanding a library structure to submitting your library to the Arduino Library Manager.

## Empowering Your Annotations with Fields

DevFeed: [Empowering Your Annotations with Fields](<https://devfeed.tech/articles/empowering-your-annotations-with-fields-30743.md>)

Original publisher: [Read original article](<http://blog.vanillajava.blog/2024/12/empowering-your-annotations-with-fields.html>)

Author: Peter Lawrey (noreply@blogger.com)

Published: 2024-12-21T22:13:00Z

Content type: tutorial

Language: en

Sources: [Vanilla Java](<https://devfeed.tech/sources/vanilla-java.md>)

Topics: [Java](<https://devfeed.tech/topics/java.md>), [Java Language](<https://devfeed.tech/topics/java-language.md>), [Code](<https://devfeed.tech/topics/code.md>), [interfaces](<https://devfeed.tech/topics/interfaces.md>), [enum](<https://devfeed.tech/topics/enum.md>)

Tags: [class](<https://devfeed.tech/tags/class.md>), [code](<https://devfeed.tech/tags/code.md>), [enum](<https://devfeed.tech/tags/enum.md>), [info](<https://devfeed.tech/tags/info.md>), [interfaces](<https://devfeed.tech/tags/interfaces.md>), [java](<https://devfeed.tech/tags/java.md>), [java-language](<https://devfeed.tech/tags/java-language.md>), [opinion](<https://devfeed.tech/tags/opinion.md>)

### AI overview

This tutorial explains how Java annotations can contain nested classes, interfaces, enums, other annotations, static fields, and embedded logic. It discusses uses such as domain converters, framework lifecycle hooks, and syntactic sugar, while noting that excessive nesting can reduce readability.

### Source excerpt

Introduction Java's annotation system has come a long way since its introduction in Java 5. At first glance, annotations appear to be mere metadata markers on classes and methods. However, annotations can do much more than that. You can nest types within them, incorporate fields that reference helper classes, and even embed logic via static singletons. These capabilities provide a powerful mechanism for integrating domain-specific or framework-specific functionality right into your code, in ways that are both compact and self-documenting. Why Add Code to Annotations? The Java language specification usually treats annotations as static metadata describing a type, method, field, or parameter. However, you can leverage nested classes (including enums, interfaces, and even other annotations) to extend the functionality of a single annotation. This approach allows you to keep logic closely tied to the metadata, rather than scattering it across multiple classes. Common use cases include: Custom domain converters. For example, if you have a long that needs to be stored in an encoded format (e.g., Base85), you can supply a default converter directly within the annotation. Framework-specific lifecycle hooks. You can embed an interface for processing the annotation, enabling the framework to perform reflective lookups and apply behaviour at runtime. Syntactic sugar. Rather than writing @LongConversion(SomeConverter.class), you could write @ShortText, which internally references a known converter. Nesting Types in Java You can nest various kinds of types within your classes or annotations--these include interfaces, enums, classes, and even other annotations. Although nesting these types can feel unconventional, it is fully supported by the language. For example: public class A { public interface B { public enum C { ; public @interface D { public class E { // etc etc } } } } } While this example might look bizarre, it demonstrates the power and flexibility of Java's nesting rule

## A Curious Case of Mistaken Identity: How Lambdas Break Data Class Hashing

DevFeed: [A Curious Case of Mistaken Identity: How Lambdas Break Data Class Hashing](<https://devfeed.tech/articles/a-curious-case-of-mistaken-identity-how-lambdas-break-data-class-hashing-27333.md>)

Original publisher: [Read original article](<https://blog.mmckenna.me/a-curious-case-of-mistaken-identity>)

Author: Matt McKenna

Published: 2024-11-14T21:44:31Z

Content type: tutorial

Language: en

Sources: [Matt McKenna](<https://devfeed.tech/sources/matt-mckenna.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [hashing](<https://devfeed.tech/topics/hashing.md>), [hash](<https://devfeed.tech/topics/hash.md>), [consistency](<https://devfeed.tech/topics/consistency.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [behavior](<https://devfeed.tech/tags/behavior.md>), [class](<https://devfeed.tech/tags/class.md>), [data-class](<https://devfeed.tech/tags/data-class.md>), [hashcode](<https://devfeed.tech/tags/hashcode.md>), [hashing](<https://devfeed.tech/tags/hashing.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [maintenance](<https://devfeed.tech/tags/maintenance.md>)

### AI overview

This Kotlin article explains why data class instances containing lambdas may compare as unequal and produce different hash-based behavior. Each lambda instance has a distinct identity, so the article recommends excluding the callback from equality and hashCode calculations, while noting the resulting maintenance cost.

### Source excerpt

Introduction: The Scene of the Crime It was a dark and stormy night. My hands were flying across the keys when suddenly the codebase began to exhibit strange behavior. Hashes, which once returned the same values for identical objects, suddenly became...

## Replace Useless Cases with Interfaces

DevFeed: [Replace Useless Cases with Interfaces](<https://devfeed.tech/articles/replace-useless-cases-with-interfaces-25097.md>)

Original publisher: [Read original article](<https://dladukedev.com/articles/042_avoid_useless_cases_part_2/>)

Published: 2024-08-15T00:00:00Z

Content type: article

Language: en

Sources: [Donovan LaDuke - Developer](<https://devfeed.tech/sources/donovan-laduke-developer.md>)

Topics: [Code](<https://devfeed.tech/topics/code.md>), [mvc](<https://devfeed.tech/topics/mvc.md>), [Framework](<https://devfeed.tech/topics/framework.md>)

Tags: [architecture](<https://devfeed.tech/tags/architecture.md>), [class](<https://devfeed.tech/tags/class.md>), [dependencies](<https://devfeed.tech/tags/dependencies.md>), [function](<https://devfeed.tech/tags/function.md>), [implement](<https://devfeed.tech/tags/implement.md>), [interface](<https://devfeed.tech/tags/interface.md>), [interfaces](<https://devfeed.tech/tags/interfaces.md>)

### AI overview

The article presents an alternative to dedicated pass-through use-case classes: define use-case interfaces and implement them directly in the repository. This preserves architectural benefits while reducing unnecessary code. It also discusses using invoke-operator extensions and the resulting trade-off of exposing an additional function.

### Source excerpt

An alternative approach to avoiding Useless Cases by making Use Case interfaces without dedicated Use Case classes

## Avoid the Long Parameter List

DevFeed: [Avoid the Long Parameter List](<https://devfeed.tech/articles/avoid-the-long-parameter-list-23855.md>)

Original publisher: [Read original article](<http://testing.googleblog.com/2024/05/avoid-long-parameter-list.html>)

Author: Google Testing Bloggers (noreply@blogger.com)

Published: 2024-05-20T13:42:00Z

Content type: tutorial

Language: en

Sources: [Google Testing Blog](<https://devfeed.tech/sources/google-testing-blog.md>)

Topics: [Code](<https://devfeed.tech/topics/code.md>), [Java](<https://devfeed.tech/topics/java.md>), [C++](<https://devfeed.tech/topics/c-plus-plus.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Python](<https://devfeed.tech/topics/python.md>)

Tags: [c-plus-plus](<https://devfeed.tech/tags/c-plus-plus.md>), [class](<https://devfeed.tech/tags/class.md>), [code](<https://devfeed.tech/tags/code.md>), [code-health](<https://devfeed.tech/tags/code-health.md>), [data-class](<https://devfeed.tech/tags/data-class.md>), [gene-volovich](<https://devfeed.tech/tags/gene-volovich.md>), [google](<https://devfeed.tech/tags/google.md>), [java](<https://devfeed.tech/tags/java.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [language](<https://devfeed.tech/tags/language.md>), [list](<https://devfeed.tech/tags/list.md>), [parameter](<https://devfeed.tech/tags/parameter.md>), [post](<https://devfeed.tech/tags/post.md>), [python](<https://devfeed.tech/tags/python.md>), [series](<https://devfeed.tech/tags/series.md>), [tott](<https://devfeed.tech/tags/tott.md>)

### AI overview

This Google Code Health article explains how long parameter lists make method calls difficult to understand and maintain. It recommends grouping related parameters into meaningful value objects, with language-specific options including Java records, Kotlin data classes, C++ option structs, Python keyword arguments and defaults, and the Java Builder pattern.

### Source excerpt

This is another post in our Code Health series. A version of this post originally appeared in Google bathrooms worldwide as a Google Testing on the Toilet episode. You can download a printer-friendly version to display in your office. By Gene Volovich Have you seen code like this? void transform(String fileIn, String fileOut, String separatorIn, String separatorOut); This seems simple enough, but it can be difficult to remember the parameter ordering. It gets worse if you add more parameters (e.g., to specify the encoding, or to email the resulting file): void transform(String fileIn, String fileOut, String separatorIn, String separatorOut, String encoding, String mailTo, String mailSubject, String mailTemplate); To make the change, will you add another (overloaded) transform method? Or add more parameters to the existing method, and update every single call to transform? Neither seems satisfactory. One solution is to encapsulate groups of the parameters into meaningful objects. The CsvFile class used here is a "value object" -- simply a holder for the data. class CsvFile { CsvFile(String filename, String separator, String encoding) { ... } String filename() { return filename; } String separator() { return separator; } String encoding() { return encoding; } } // ... and do the same for the EmailMessage class void transform(CsvFile src, CsvFile target, EmailMessage resultMsg) { ... } How to define a value object varies by language. For example, in Java, you can use a record class, which is available in Java 16+ (for older versions of Java, you can use AutoValue to generate code for the value object); in Kotlin, you can use a data class; in C++, you can use an option struct. Using a value object this way may still result in a long parameter list when instantiating it. Solutions for this vary by language. For example, in Python, you can use keyword arguments and default parameter values to shorten the parameter list; in Java, one option is to use the Builder pattern, wh

## Item 29: Minimize elements' visibility

DevFeed: [Item 29: Minimize elements' visibility](<https://devfeed.tech/articles/item-29-minimize-elements-visibility-39277.md>)

Original publisher: [Read original article](<https://kt.academy/article/ek-element-visibility>)

Published: 2024-05-06T00:00:00Z

Content type: tutorial

Language: en

Sources: [Kt. Academy](<https://devfeed.tech/sources/kt-academy.md>)

Topics: [interface](<https://devfeed.tech/topics/interface.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [class](<https://devfeed.tech/topics/class.md>), [properties](<https://devfeed.tech/topics/properties.md>), [maintenance](<https://devfeed.tech/topics/maintenance.md>)

Tags: [class](<https://devfeed.tech/tags/class.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [interface](<https://devfeed.tech/tags/interface.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [maintenance](<https://devfeed.tech/tags/maintenance.md>), [properties](<https://devfeed.tech/tags/properties.md>), [workshop-learning-programming](<https://devfeed.tech/tags/workshop-learning-programming.md>)

### AI overview

The article explains why APIs should minimize visible elements: smaller interfaces are easier to learn, maintain, test, and change. It also shows how restricting visibility in Kotlin helps protect class invariants by encapsulating internal state, including making property setters private.

### Source excerpt

Why we should minimize elements' visibility and how to do it.

## Kotlin Reflection: Class references

DevFeed: [Kotlin Reflection: Class references](<https://devfeed.tech/articles/kotlin-reflection-class-references-39215.md>)

Original publisher: [Read original article](<https://kt.academy/article/ak-reflection-class>)

Published: 2023-10-23T00:15:00Z

Content type: tutorial

Language: en

Sources: [Kt. Academy](<https://devfeed.tech/sources/kt-academy.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [class](<https://devfeed.tech/topics/class.md>)

Tags: [class](<https://devfeed.tech/tags/class.md>), [example](<https://devfeed.tech/tags/example.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [object](<https://devfeed.tech/tags/object.md>), [practical](<https://devfeed.tech/tags/practical.md>), [workshop-learning-programming](<https://devfeed.tech/tags/workshop-learning-programming.md>)

### AI overview

A tutorial on Kotlin class references, covering class names, type characteristics, visibility, members, and declared members, with a practical object serialization example.

### Source excerpt

All the essential aspects of class references, and a practical object serialization example.

## Data Classes and Destructuring

DevFeed: [Data Classes and Destructuring](<https://devfeed.tech/articles/data-classes-and-destructuring-25052.md>)

Original publisher: [Read original article](<https://typealias.com/start/kotlin-data-classes-and-destructuring/>)

Author: author@typealias.com (Dave Leeds)

Published: 2023-10-09T00:00:00Z

Content type: tutorial

Language: en

Sources: [Dave Leeds on Kotlin - typealias.com](<https://devfeed.tech/sources/dave-leeds-on-kotlin-typealias-com.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [data](<https://devfeed.tech/topics/data.md>)

Tags: [class](<https://devfeed.tech/tags/class.md>), [classes](<https://devfeed.tech/tags/classes.md>), [copy](<https://devfeed.tech/tags/copy.md>), [data-class](<https://devfeed.tech/tags/data-class.md>), [destructuring](<https://devfeed.tech/tags/destructuring.md>), [destructuring-assignment](<https://devfeed.tech/tags/destructuring-assignment.md>), [equals](<https://devfeed.tech/tags/equals.md>), [hashcode](<https://devfeed.tech/tags/hashcode.md>), [introduction](<https://devfeed.tech/tags/introduction.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [learn-to-program](<https://devfeed.tech/tags/learn-to-program.md>), [object](<https://devfeed.tech/tags/object.md>), [open](<https://devfeed.tech/tags/open.md>), [operator](<https://devfeed.tech/tags/operator.md>), [override](<https://devfeed.tech/tags/override.md>), [programming](<https://devfeed.tech/tags/programming.md>), [properties](<https://devfeed.tech/tags/properties.md>), [tostring](<https://devfeed.tech/tags/tostring.md>)

### AI overview

A Kotlin tutorial introducing data classes and destructuring. It explains how data classes relate to equals(), hashCode(), and toString(), beginning with reference equality and overriding inherited functions.

### Source excerpt

At the end of the last chapter, we saw how all objects in Kotlin inherit three functions from an open class called Any. Those functions are equals(), hashCode(), and toString(). In this chapter, we're going to learn about data classes, which are super-powered classes that are especially helpful when we've got an immutable class that mainly just holds properties. To better understand data classes, let's first explore each of the three functions above, and see what's involved when we override them!

## Touchlab Open Source Updates - Sep 2023 - Touchlab Engineering

DevFeed: [Touchlab Open Source Updates - Sep 2023 - Touchlab Engineering](<https://devfeed.tech/articles/touchlab-open-source-updates-sep-2023-touchlab-engineering-38335.md>)

Original publisher: [Read original article](<https://touchlab.co/touchlab-open-source-updates-sep-2023>)

Published: 2023-09-19T23:33:27Z

Content type: news

Language: en

Sources: [Touchlab | Enterprise Mobile Innovation & Development](<https://devfeed.tech/sources/touchlab-enterprise-mobile-innovation-development.md>)

Topics: [multiplatform](<https://devfeed.tech/topics/multiplatform.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [iOS](<https://devfeed.tech/topics/ios.md>), [Coroutines](<https://devfeed.tech/topics/coroutines.md>), [Logging](<https://devfeed.tech/topics/logging.md>), [Crashlytics](<https://devfeed.tech/topics/crashlytics.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [class](<https://devfeed.tech/tags/class.md>), [concurrency](<https://devfeed.tech/tags/concurrency.md>), [coroutines](<https://devfeed.tech/tags/coroutines.md>), [crashlytics](<https://devfeed.tech/tags/crashlytics.md>), [default-parameters](<https://devfeed.tech/tags/default-parameters.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [enums](<https://devfeed.tech/tags/enums.md>), [ios](<https://devfeed.tech/tags/ios.md>), [kmp](<https://devfeed.tech/tags/kmp.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [logging](<https://devfeed.tech/tags/logging.md>), [multiplatform](<https://devfeed.tech/tags/multiplatform.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [sealed](<https://devfeed.tech/tags/sealed.md>), [updates](<https://devfeed.tech/tags/updates.md>)

### AI overview

Touchlab reports open-source updates for Kotlin Multiplatform, including SKIE improvements for Kotlin-to-iOS interfaces, the Kermit 2.0 release, CrashKiOS updates, and Stately 2.0 concurrency features.

### Source excerpt

Touchlab has pushed some major open source updates over the past few weeks that will have an impact on how teams use KMP, and on KMP adoption overall. Here are the highlights.

## Objects in Kotlin

DevFeed: [Objects in Kotlin](<https://devfeed.tech/articles/objects-in-kotlin-39337.md>)

Original publisher: [Read original article](<https://kt.academy/article/kfde-objects>)

Published: 2023-07-17T00:01:00Z

Content type: tutorial

Language: en

Sources: [Kt. Academy](<https://devfeed.tech/sources/kt-academy.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [object](<https://devfeed.tech/topics/object.md>), [class](<https://devfeed.tech/topics/class.md>), [constructor](<https://devfeed.tech/topics/constructor.md>), [interfaces](<https://devfeed.tech/topics/interfaces.md>)

Tags: [class](<https://devfeed.tech/tags/class.md>), [constructor](<https://devfeed.tech/tags/constructor.md>), [interfaces](<https://devfeed.tech/tags/interfaces.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [object](<https://devfeed.tech/tags/object.md>), [synchronization](<https://devfeed.tech/tags/synchronization.md>), [syntax](<https://devfeed.tech/tags/syntax.md>), [workshop-learning-programming](<https://devfeed.tech/tags/workshop-learning-programming.md>)

### AI overview

This Kotlin tutorial explains how to create objects with object expressions and object declarations. It covers anonymous objects, inheritance and interface implementation, object scope, singleton behavior, and practical uses such as listeners and synchronization locks.

### Source excerpt

What is object expression, object declaration and companion objects, and how we use them.

## Building a Note-Taking App in Compose

DevFeed: [Building a Note-Taking App in Compose](<https://devfeed.tech/articles/building-a-note-taking-app-in-compose-20024.md>)

Original publisher: [Read original article](<https://technology.doximity.com/articles/building-a-note-taking-app-in-compose>)

Author: Doximity

Published: 2023-07-05T19:47:00Z

Content type: tutorial

Language: en

Sources: [Doximity](<https://devfeed.tech/sources/doximity.md>)

Topics: [Jetpack Compose](<https://devfeed.tech/topics/jetpack-compose.md>), [App](<https://devfeed.tech/topics/app.md>), [Code](<https://devfeed.tech/topics/code.md>), [Template](<https://devfeed.tech/topics/template.md>)

Tags: [app](<https://devfeed.tech/tags/app.md>), [architecture](<https://devfeed.tech/tags/architecture.md>), [build](<https://devfeed.tech/tags/build.md>), [building](<https://devfeed.tech/tags/building.md>), [class](<https://devfeed.tech/tags/class.md>), [clean-architecture](<https://devfeed.tech/tags/clean-architecture.md>), [code](<https://devfeed.tech/tags/code.md>), [collect](<https://devfeed.tech/tags/collect.md>), [compose](<https://devfeed.tech/tags/compose.md>), [data-class](<https://devfeed.tech/tags/data-class.md>), [di](<https://devfeed.tech/tags/di.md>), [extension-function](<https://devfeed.tech/tags/extension-function.md>), [flow](<https://devfeed.tech/tags/flow.md>), [icons](<https://devfeed.tech/tags/icons.md>), [implement](<https://devfeed.tech/tags/implement.md>), [koin](<https://devfeed.tech/tags/koin.md>), [list](<https://devfeed.tech/tags/list.md>), [state](<https://devfeed.tech/tags/state.md>), [state-management](<https://devfeed.tech/tags/state-management.md>), [view](<https://devfeed.tech/tags/view.md>)

### AI overview

A case study showing how to build a note-taking app with Jetpack Compose. It models note state, renders the notes UI, collects note data through a presenter and Clean Architecture use cases, and plans events for adding, editing, checking, and deleting notes.

### Source excerpt

In this case study, we will build a note-taking app that lets the user add, edit and delete notes. It uses Compose for both the view and presentation layers! Note: This is a follow up to Part 1: Simplifying State Management with Compose and assumes the reader is already familiar with Jetpack Compose. The Template I find it useful to start with the model that represents the state of the screen we're building. It will have a list of notes, with each note containing properties for the text and checkbox: data class NotesUiModel(val notes: List<Note>) : UiModel { data class Note(val text: String, val isChecked: Boolean) : UiModel } It'll be the job of the presenter to produce this model. Initially, let's implement a stub to return an empty list of notes (we'll ignore parameters for now): class NotesListPresenter : Presenter<NotesUiModel, Unit> { @Composable override fun present(params: Unit): NotesUiModel { return NotesUiModel(notes = emptyList()) } } Then we can build our view to render the model that's returned by the presenter: @Composable fun NotesScreen() { val presenter: NotesListPresenter = koinInject() // we use koin for DI val uiModel = presenter.present(Unit) Column { TopAppBar(title = { Text("Notes") }) Notes(uiModel) } } } The View The views themselves are pretty self-explanatory if you're already familiar with building UIs in Compose. For the notes, we'll take in a NotesUiModel argument and create a LazyColumn with the notes property. A FAB button is used for adding new notes, although we'll skip the triggering of events and return to this part in a little bit: @Composable private fun Notes(uiModel: NotesUiModel) { Box { LazyColumn { items(uiModel.notes) { note -> Note(note) } } FloatingActionButton(onClick = { /* TODO */ }) { Icon(imageVector = Icons.Rounded.Add) } } } Then we can render each note with a checkbox, text field and delete button: @Composable private fun Note(uiModel: Note) { Row { Checkbox( checked = uiModel.isChecked, onCheckedChange = { /* T

## Avoid Java double brace initialization

DevFeed: [Avoid Java double brace initialization](<https://devfeed.tech/articles/avoid-java-double-brace-initialization-25619.md>)

Original publisher: [Read original article](<https://blog.p-y.wtf/avoid-java-double-brace-initialization>)

Author: Pierre-Yves Ricau

Published: 2023-06-27T20:58:00Z

Content type: tutorial

Language: en

Sources: [Py's blog](<https://devfeed.tech/sources/py-s-blog.md>)

Topics: [Java](<https://devfeed.tech/topics/java.md>), [Code](<https://devfeed.tech/topics/code.md>), [Android](<https://devfeed.tech/topics/android.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [class](<https://devfeed.tech/tags/class.md>), [classes](<https://devfeed.tech/tags/classes.md>), [code](<https://devfeed.tech/tags/code.md>), [constructor](<https://devfeed.tech/tags/constructor.md>), [crash-reporting](<https://devfeed.tech/tags/crash-reporting.md>), [gc](<https://devfeed.tech/tags/gc.md>), [global](<https://devfeed.tech/tags/global.md>), [implementation](<https://devfeed.tech/tags/implementation.md>), [java](<https://devfeed.tech/tags/java.md>), [leak](<https://devfeed.tech/tags/leak.md>), [leakcanary](<https://devfeed.tech/tags/leakcanary.md>), [lifecycle](<https://devfeed.tech/tags/lifecycle.md>), [memory](<https://devfeed.tech/tags/memory.md>), [memory-leak](<https://devfeed.tech/tags/memory-leak.md>), [object](<https://devfeed.tech/tags/object.md>), [patterns](<https://devfeed.tech/tags/patterns.md>), [subclass](<https://devfeed.tech/tags/subclass.md>)

### AI overview

This tutorial explains how Java double brace initialization can cause memory leaks. An anonymous HashMap subclass implicitly retains its outer Activity, so a breadcrumb stored by a singleton BugSnag client can keep a destroyed Android Activity in memory. The article recommends avoiding the pattern and using explicit initialization or Kotlin.

### Source excerpt

TL;DR Avoid doing this: new HashMap() {{ put("key", value); }}; Leak Trace I was recently looking at the following leak trace from LeakCanary: ┬─── │ GC Root: Global variable in native code │ ├─ com.bugsnag.android.AnrPlugin instan...

## Class Modifiers in Dart: Sealed, Interface, Base

DevFeed: [Class Modifiers in Dart: Sealed, Interface, Base](<https://devfeed.tech/articles/class-modifiers-in-dart-sealed-interface-base-23989.md>)

Original publisher: [Read original article](<https://quickbirdstudios.com/blog/flutter-dart-class-modifiers/>)

Author: Marvin März

Published: 2023-06-23T11:29:43Z

Content type: tutorial

Language: en

Sources: [QuickBird Studios Blog](<https://devfeed.tech/sources/quickbird-studios-blog.md>)

Topics: [Dart](<https://devfeed.tech/topics/dart.md>), [Object-oriented programming (OOP)](<https://devfeed.tech/topics/oop.md>)

Tags: [abstract-class](<https://devfeed.tech/tags/abstract-class.md>), [class](<https://devfeed.tech/tags/class.md>), [classes](<https://devfeed.tech/tags/classes.md>), [dart](<https://devfeed.tech/tags/dart.md>), [flutter](<https://devfeed.tech/tags/flutter.md>), [implementation](<https://devfeed.tech/tags/implementation.md>), [interface](<https://devfeed.tech/tags/interface.md>), [oop](<https://devfeed.tech/tags/oop.md>), [pattern-matching](<https://devfeed.tech/tags/pattern-matching.md>), [post](<https://devfeed.tech/tags/post.md>), [sealed](<https://devfeed.tech/tags/sealed.md>), [sealed-interface](<https://devfeed.tech/tags/sealed-interface.md>)

### AI overview

This tutorial explains Dart 3 class modifiers, including the newly introduced sealed, interface, final, and base modifiers and changes to existing modifiers. It describes how modifiers control whether classes can be extended, mixed in, constructed, or implemented, and discusses their practical use cases.

### Source excerpt

With Dart 3 the class modifiers sealed, interface, final and base were introduced into the Dart language. They also updated how existing ones work. In this article, we show you why this change was made and how those new modifiers work. The post Class Modifiers in Dart: Sealed, Interface, Base appeared first on QuickBird Studios.

## MutexProtected: A C++ Pattern for Easier Concurrency

DevFeed: [MutexProtected: A C++ Pattern for Easier Concurrency](<https://devfeed.tech/articles/mutexprotected-a-c-pattern-for-easier-concurrency-38361.md>)

Original publisher: [Read original article](<https://awesomekling.github.io/MutexProtected-A-C++-Pattern-for-Easier-Concurrency/>)

Author: Andreas Kling

Published: 2023-04-06T00:00:00Z

Content type: tutorial

Language: en

Sources: [Andreas Kling](<https://devfeed.tech/sources/andreas-kling.md>)

Topics: [C++](<https://devfeed.tech/topics/c-plus-plus.md>), [Concurrency](<https://devfeed.tech/topics/concurrency.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [Code](<https://devfeed.tech/topics/code.md>), [Deadlock](<https://devfeed.tech/topics/deadlock.md>)

Tags: [c-plus-plus](<https://devfeed.tech/tags/c-plus-plus.md>), [callback](<https://devfeed.tech/tags/callback.md>), [class](<https://devfeed.tech/tags/class.md>), [concurrency](<https://devfeed.tech/tags/concurrency.md>), [cpp](<https://devfeed.tech/tags/cpp.md>), [locks](<https://devfeed.tech/tags/locks.md>), [mutex](<https://devfeed.tech/tags/mutex.md>), [programming](<https://devfeed.tech/tags/programming.md>), [serenityos](<https://devfeed.tech/tags/serenityos.md>), [technical](<https://devfeed.tech/tags/technical.md>), [type-system](<https://devfeed.tech/tags/type-system.md>)

### AI overview

This tutorial explains the MutexProtected pattern, which combines a mutex and protected data behind a callback-based C++ API. It compares manual locking in C with C++ RAII and the newer pattern, showing how the design reduces forgotten-lock errors and encodes the mutex-data relationship in the type system. It also notes that inconsistent ordering of multiple MutexProtected instances can still cause deadlocks.

### Source excerpt

In this post, we will discuss the challenges of programming with locks and how the C++ language offers some useful tools to make it easier. We will start with an example in C and then use C++ to improve upon it in steps. The example APIs are based on real-life APIs from the SerenityOS kernel.

## Enum classes in Kotlin

DevFeed: [Enum classes in Kotlin](<https://devfeed.tech/articles/enum-classes-in-kotlin-39330.md>)

Original publisher: [Read original article](<https://kt.academy/article/kfde-enum>)

Published: 2023-02-01T00:01:00Z

Content type: tutorial

Language: en

Sources: [Kt. Academy](<https://devfeed.tech/sources/kt-academy.md>)

Topics: [enum class](<https://devfeed.tech/topics/enum-class.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>)

Tags: [abstract-class](<https://devfeed.tech/tags/abstract-class.md>), [class](<https://devfeed.tech/tags/class.md>), [constructor](<https://devfeed.tech/tags/constructor.md>), [enum](<https://devfeed.tech/tags/enum.md>), [enum-class](<https://devfeed.tech/tags/enum-class.md>), [enums](<https://devfeed.tech/tags/enums.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [property](<https://devfeed.tech/tags/property.md>), [superclass](<https://devfeed.tech/tags/superclass.md>), [workshop-learning-programming](<https://devfeed.tech/tags/workshop-learning-programming.md>)

### AI overview

This Kotlin tutorial explains how to define and use enum classes to represent finite sets of values. It covers enum values and their order, companion object utilities, exhaustive when conditions, stored state, and custom methods.

### Source excerpt

What are enum classes in Kotlin and how do we use them.

## How to create a parameterized base test class in Kotlin

DevFeed: [How to create a parameterized base test class in Kotlin](<https://devfeed.tech/articles/how-to-create-a-parameterized-base-test-class-in-kotlin-25575.md>)

Original publisher: [Read original article](<https://www.marcogomiero.com/posts/2023/parameterized-kotlin-base-test/>)

Author: Marco Gomiero

Published: 2023-01-31T00:00:00Z

Content type: tutorial

Language: en

Sources: [Posts on Marco Gomiero](<https://devfeed.tech/sources/posts-on-marco-gomiero.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [configuration](<https://devfeed.tech/topics/configuration.md>)

Tags: [argument](<https://devfeed.tech/tags/argument.md>), [class](<https://devfeed.tech/tags/class.md>), [configuration](<https://devfeed.tech/tags/configuration.md>), [constructor](<https://devfeed.tech/tags/constructor.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [tests](<https://devfeed.tech/tags/tests.md>)

### AI overview

This tutorial explains how to create a parameterized base test class in Kotlin using JUnit 4's Parameterized test runner. It describes defining test arguments in a companion object, accepting an argument in the base-class constructor, and having test classes reuse the shared setup while running with different arguments.

### Source excerpt

One exciting feature of JUnit 4 (and 5 as well, but this post will be focused on JUnit 4) is the possibility of running the same test with different input arguments. That is made possible by a custom test runner called Parameterized, which will inject the provided arguments in the constructor of the test class. Instead, the different arguments must be defined in the companion object of the test class.

## Operator overloading in Kotlin

DevFeed: [Operator overloading in Kotlin](<https://devfeed.tech/articles/operator-overloading-in-kotlin-39338.md>)

Original publisher: [Read original article](<https://kt.academy/article/kfde-operators>)

Published: 2023-01-23T00:01:00Z

Content type: tutorial

Language: en

Sources: [Kt. Academy](<https://devfeed.tech/sources/kt-academy.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Code](<https://devfeed.tech/topics/code.md>), [class](<https://devfeed.tech/topics/class.md>), [function](<https://devfeed.tech/topics/function.md>), [Compiler](<https://devfeed.tech/topics/compiler.md>), [Math and Logic](<https://devfeed.tech/topics/math-and-logic.md>)

Tags: [arithmetic](<https://devfeed.tech/tags/arithmetic.md>), [class](<https://devfeed.tech/tags/class.md>), [code](<https://devfeed.tech/tags/code.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [complex-numbers](<https://devfeed.tech/tags/complex-numbers.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [extension-function](<https://devfeed.tech/tags/extension-function.md>), [function](<https://devfeed.tech/tags/function.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [number](<https://devfeed.tech/tags/number.md>), [numbers](<https://devfeed.tech/tags/numbers.md>), [operations](<https://devfeed.tech/tags/operations.md>), [operator-overloading](<https://devfeed.tech/tags/operator-overloading.md>), [physics](<https://devfeed.tech/tags/physics.md>), [type](<https://devfeed.tech/tags/type.md>), [types](<https://devfeed.tech/tags/types.md>), [workshop-learning-programming](<https://devfeed.tech/tags/workshop-learning-programming.md>)

### AI overview

A tutorial on Kotlin operator overloading. It explains Kotlin's predefined operators, how operator methods are declared for custom classes, and how arithmetic and range operators are handled, using complex numbers as an example.

### Source excerpt

How are operators defined for types in Kotlin, and how can we define our own operators.

[Next page](<https://devfeed.tech/tags/class.md?cursor=WyIyMDIzLTAxLTIzVDAwOjAxOjAwKzAwOjAwIiwgIjYwZmMyMTU3LTEyNjktNDZmNS04NmE5LTVkY2QxODFiMTg0MiJd>)