# generic programming

Generic programming is a computing technique for expressing adaptable, interoperable algorithms and data structures through abstraction and parameterization, enabling their use in software construction.

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

## Four major changes coming to Rust

DevFeed: [Four major changes coming to Rust](<https://devfeed.tech/articles/four-major-changes-coming-to-rust-140726.md>)

Original publisher: [Read original article](<https://www.infoworld.com/article/4240528/four-major-changes-coming-to-rust.html>)

Author: Serdar Yegulalp

Published: 2026-11-18T09:00:00Z

Content type: article

Language: en

Sources: [InfoWorld](<https://devfeed.tech/sources/infoworld.md>)

Topics: [Rust](<https://devfeed.tech/topics/rust.md>), [rust-ai](<https://devfeed.tech/topics/rust-ai.md>), [Machine learning](<https://devfeed.tech/topics/machine-learning.md>), [Memory Safety](<https://devfeed.tech/topics/memory-safety.md>), [generic programming](<https://devfeed.tech/topics/generic-programming.md>)

Tags: [2026](<https://devfeed.tech/tags/2026.md>), [accelerated](<https://devfeed.tech/tags/accelerated.md>), [async](<https://devfeed.tech/tags/async.md>), [caching](<https://devfeed.tech/tags/caching.md>), [capabilities](<https://devfeed.tech/tags/capabilities.md>), [changes](<https://devfeed.tech/tags/changes.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [covers](<https://devfeed.tech/tags/covers.md>), [csv](<https://devfeed.tech/tags/csv.md>), [data](<https://devfeed.tech/tags/data.md>), [data-type](<https://devfeed.tech/tags/data-type.md>), [define](<https://devfeed.tech/tags/define.md>), [developers](<https://devfeed.tech/tags/developers.md>), [development](<https://devfeed.tech/tags/development.md>), [exists](<https://devfeed.tech/tags/exists.md>), [faster](<https://devfeed.tech/tags/faster.md>), [features](<https://devfeed.tech/tags/features.md>), [function](<https://devfeed.tech/tags/function.md>), [has](<https://devfeed.tech/tags/has.md>), [language-en](<https://devfeed.tech/tags/language-en.md>), [programming-languages](<https://devfeed.tech/tags/programming-languages.md>), [programming-languages-rust-software-development](<https://devfeed.tech/tags/programming-languages-rust-software-development.md>), [rust](<https://devfeed.tech/tags/rust.md>), [software-development](<https://devfeed.tech/tags/software-development.md>), [storytype-feature](<https://devfeed.tech/tags/storytype-feature.md>)

### AI overview

Four initiatives could broaden Rust's capabilities: a next-generation trait solver, the Polonius borrow checker, a parallel compiler front end, and higher-level machine-learning optimizations. The new solver uses caching to address self-referential-type problems and may be faster, but it still needs to cover all use cases, including async. Polonius analyzes control flow rather than lexical scopes, potentially accepting more memory-safe code; it remains experimental and needs broader analysis and performance work. Front-end parallelism could speed parsing, type checking, and borrow checking, but needs stronger consistency testing and support for features such as macro expansion. For machine learning, Rust lacks higher-level tensor and matrix optimizations and compilation to accelerators such as TPUs; proposed MLIR support could enable specialized code generation. These efforts are at different stages and are described as ongoing work, not completed capabilities.

### Source excerpt

Over its decade-and-a-half lifetime, the Rust programming language has evolved dramatically. Rust has always been about ensuring safe programming with strong typing that doesn't sacrifice speed. But how it expresses those capabilities has matured and expanded, and that movement hasn't slowed. If anything, it has accelerated. At any given time in Rust's development, you could point to dozens of different initiatives to improve the language. As of the end of 2026, four of these stand far above the rest, because of how broad their impact could be and how deeply they touch on many aspects of Rust. The next-generation trait solver Rust's type system uses "traits" to define the functionality that a given type has and can share with other types. If we described a trait named ExportToJSON, we might have a matching impl, or implementation, for a data type: impl ExportToJSON for CSV The Rust compiler tries to find matching implementations for each reference to a trait. This is highly important for generic functions, since it may not be obvious if an implementation exists for a given invocation of a function. The current version of the trait solver has problems dealing with situations like self-referential types. Those aren't common, but Rust programmers must consciously avoid constructing them to keep the trait solver from getting tied up in knots. Sometimes, because of this, it's the developer who gets ensnarled. A new version of the trait solver takes a totally different approach to the problem. It draws on ideas gleaned from an earlier attempt to rewrite the trait solver (called "Chalk"), and uses a sophisticated caching mechanism both to avoid problems with self-referential types and potentially run faster than the current solver. The current version of the new trait solver covers some use cases, but not all of them. The next step is to ensure that the solver can cover all use cases, including async features. Once that happens, Rust developers will have far more freedom i

## MPPI-Generic: A CUDA Library for Stochastic Trajectory Optimization

DevFeed: [MPPI-Generic: A CUDA Library for Stochastic Trajectory Optimization](<https://devfeed.tech/articles/mppi-generic-a-cuda-library-for-stochastic-trajectory-optimization-131504.md>)

Original publisher: [Read original article](<https://arxiv.org/abs/2409.07563>)

Author: Bogdan Vlahov, Jason Gibson, Manan Gandhi, Evangelos A. Theodorou

Published: 2026-11-13T05:00:00Z

Content type: article

Language: en

Sources: [arXiv: Distributed Computing](<https://devfeed.tech/sources/arxiv-distributed-computing.md>)

Topics: [CUDA-X](<https://devfeed.tech/topics/cuda-x.md>), [CUDA](<https://devfeed.tech/topics/cuda.md>), [Library](<https://devfeed.tech/topics/library.md>), [generic programming](<https://devfeed.tech/topics/generic-programming.md>)

Tags: [accelerated](<https://devfeed.tech/tags/accelerated.md>), [algorithms](<https://devfeed.tech/tags/algorithms.md>), [api](<https://devfeed.tech/tags/api.md>), [c-plus-plus](<https://devfeed.tech/tags/c-plus-plus.md>), [cs-dc](<https://devfeed.tech/tags/cs-dc.md>), [cs-ms](<https://devfeed.tech/tags/cs-ms.md>), [cs-ro](<https://devfeed.tech/tags/cs-ro.md>), [cs-sy](<https://devfeed.tech/tags/cs-sy.md>), [cuda](<https://devfeed.tech/tags/cuda.md>), [eess-sy](<https://devfeed.tech/tags/eess-sy.md>), [gpu](<https://devfeed.tech/tags/gpu.md>), [gpu-accelerated](<https://devfeed.tech/tags/gpu-accelerated.md>), [library](<https://devfeed.tech/tags/library.md>), [optimization](<https://devfeed.tech/tags/optimization.md>), [performance](<https://devfeed.tech/tags/performance.md>), [real-time](<https://devfeed.tech/tags/real-time.md>), [robust](<https://devfeed.tech/tags/robust.md>), [trajectory-optimization](<https://devfeed.tech/tags/trajectory-optimization.md>), [tube](<https://devfeed.tech/tags/tube.md>)

### AI overview

MPPI-Generic is a C++/CUDA library for GPU-accelerated stochastic trajectory optimization, implementing Model Predictive Path Integral, Tube-Model Predictive Path Integral, and Robust Model Predictive Path Integral control. It supports existing dynamics models and cost functions, and lets researchers add their own through defined APIs without modifying the MPPI control code. The paper compares its computational performance with other MPPI implementations across multiple GPUs and reports real-time capabilities; the supplied abstract gives no specific benchmark results.

### Source excerpt

arXiv:2409.07563v5 Announce Type: replace-cross Abstract: This paper introduces a new C++/CUDA library for GPU-accelerated stochastic optimization called MPPI-Generic. It provides implementations of Model Predictive Path Integral control, Tube-Model Predictive Path Integral Control, and Robust Model Predictive Path Integral Control, and allows for these algorithms to be used across many pre-existing dynamics models and cost functions. Furthermore, researchers can create their own dynamics models or cost functions following our API definitions without needing to change the actual Model Predictive Path Integral Control code. Finally, we compare computational performance to other popular implementations of Model Predictive Path Integral Control over a variety of GPUs to show the real-time capabilities our library can allow for. Library code can be found at: https://acdslab.github.io/mppi-generic-website/ .

## Generic Const Args and You

DevFeed: [Generic Const Args and You](<https://devfeed.tech/articles/generic-const-args-and-you-63726.md>)

Original publisher: [Read original article](<https://blog.rust-lang.org/inside-rust/2026/10/02/generic-const-args-and-you/>)

Author: BoxyUwU

Published: 2026-10-02T00:00:00Z

Content type: tutorial

Language: en

Sources: [Inside Rust Blog](<https://devfeed.tech/sources/inside-rust-blog.md>)

Topics: [Python](<https://devfeed.tech/topics/python.md>), [generic programming](<https://devfeed.tech/topics/generic-programming.md>)

Tags: [code](<https://devfeed.tech/tags/code.md>), [generics](<https://devfeed.tech/tags/generics.md>), [implementation](<https://devfeed.tech/tags/implementation.md>)

### AI overview

The post explains Rust's Generic Const Arguments feature family, which aims to replace `generic_const_exprs` and allow more expressions involving generic parameters in const generics. It describes the feature gates, current restrictions, and experimental macroless syntax, noting that the features are not ready for stabilization.

### Source excerpt

Generic Const Args and You Back in June of 2024 at RustFest Zürich, the Const Generics project group first discussed a new design for supporting more complex uses of generic parameters in Const Generics. Since then, we've continued to refine the initial design and have implemented the new design as a family of features dubbed "Generic Const Arguments" (GCA for short). These features are intended to replace the existing generic_const_exprs feature which has existed in some form or another since min_const_generics was stabilized back in 2021. Even though GCA obviates generic_const_exprs it was still incredibly valuable to have invested the time into it that we did as the design and implementation of GCA was informed quite significantly by generic_const_exprs. Each feature in the GCA family introduces support for a specific set of expressions to be used in Const Generics with generic parameters. This post will go over all of the features part of the GCA family and explain their design and how to use them. A huge thanks to @camelid for doing almost all of the initial implementation work for the GCA prototype. Without him GCA would have stayed just a vague concept rather than anything tangible. Additionally, a huge thanks to @khyperia who has done a significant amount of the implementation and design work required to go from the original GCA prototype to the fully featured family that it is now. Finally there have been a tonne of other people who have made contributions to getting GCA to where it is today. For a full list of everyone and all of their contributions, see the Full Const Generics project goal. What is GCA On stable, only generic parameters by themselves (e.g. { N }) or fully concrete constants (e.g. { 1 + 1 }) are supported by Const Generics. It's not possible to have arrays like [u8; T::NUM_BYTES] or [u8; N + 1]. This limitation prevents a lot of useful abstractions and pushes users to rely on the typenum crate instead. Generic Const Arguments is a family o

## Rust vs. Go in 2026 -- a calmer take

DevFeed: [Rust vs. Go in 2026 -- a calmer take](<https://devfeed.tech/articles/rust-vs-go-in-2026-a-calmer-take-38798.md>)

Original publisher: [Read original article](<https://fidelitas.io/2026/05/rust-vs-go-2026/>)

Author: fidelitas.io

Published: 2026-05-18T14:00:00Z

Content type: opinion

Language: en

Sources: [Fidelitas](<https://devfeed.tech/sources/fidelitas-io.md>)

Topics: [Go Language](<https://devfeed.tech/topics/go-language.md>), [Rust](<https://devfeed.tech/topics/rust.md>), [Tokio](<https://devfeed.tech/topics/tokio.md>), [async](<https://devfeed.tech/topics/async.md>), [generic programming](<https://devfeed.tech/topics/generic-programming.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [analysis](<https://devfeed.tech/tags/analysis.md>), [async](<https://devfeed.tech/tags/async.md>), [generics](<https://devfeed.tech/tags/generics.md>), [go](<https://devfeed.tech/tags/go.md>), [languages](<https://devfeed.tech/tags/languages.md>), [opinion](<https://devfeed.tech/tags/opinion.md>), [runtime](<https://devfeed.tech/tags/runtime.md>), [rust](<https://devfeed.tech/tags/rust.md>), [tokio](<https://devfeed.tech/tags/tokio.md>)

### AI overview

A practitioner compares Rust and Go in 2026 after shipping production code in both. The article discusses Rust compile times, async development, and ecosystem maturity, alongside Go generics, runtime performance, garbage collection, scheduling, and escape analysis.

### Source excerpt

After five years of shipping both in production, my take has stopped being 'it depends' and started being 'it really depends -- here is precisely on what'.

## Creating Query Abstractions

DevFeed: [Creating Query Abstractions](<https://devfeed.tech/articles/creating-query-abstractions-48186.md>)

Original publisher: [Read original article](<https://tkdodo.eu/blog/creating-query-abstractions>)

Published: 2026-02-23T00:00:00Z

Content type: article

Language: en

Sources: [TkDodo](<https://devfeed.tech/sources/tkdodo-s-blog.md>)

Topics: [abstraction](<https://devfeed.tech/topics/abstraction.md>), [hooks](<https://devfeed.tech/topics/hooks.md>), [TypeScript](<https://devfeed.tech/topics/typescript.md>), [React](<https://devfeed.tech/topics/react.md>), [generic programming](<https://devfeed.tech/topics/generic-programming.md>), [interface](<https://devfeed.tech/topics/interface.md>), [Library](<https://devfeed.tech/topics/library.md>)

Tags: [abstraction](<https://devfeed.tech/tags/abstraction.md>), [components](<https://devfeed.tech/tags/components.md>), [generics](<https://devfeed.tech/tags/generics.md>), [hooks](<https://devfeed.tech/tags/hooks.md>), [interface](<https://devfeed.tech/tags/interface.md>), [react](<https://devfeed.tech/tags/react.md>), [types](<https://devfeed.tech/tags/types.md>)

### AI overview

The article examines the tradeoffs of creating reusable abstractions around TanStack Query in React and TypeScript. It explains how custom hooks can share logic and preserve consistency, while increasingly flexible parameters can produce difficult interfaces and generic type behavior.

### Source excerpt

Building reusable abstractions on top of libraries that rely on type inference can be deceptively difficult, which is why we need better ways to build those abstractions ...

## BitFields API: Type-Safe Bit Packing for Lock-Free Data Structures

DevFeed: [BitFields API: Type-Safe Bit Packing for Lock-Free Data Structures](<https://devfeed.tech/articles/bitfields-api-type-safe-bit-packing-for-lock-free-data-structures-22396.md>)

Original publisher: [Read original article](<http://rocksdb.org/blog/2025/12/31/bit-fields-api.html>)

Author: Peter Dillinger

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

Content type: article

Language: en

Sources: [RocksDB](<https://devfeed.tech/sources/rocksdb.md>)

Topics: [thread safe data sharing](<https://devfeed.tech/topics/thread-safe-data-sharing.md>), [rocksdb](<https://devfeed.tech/topics/rocksdb.md>), [Data structures](<https://devfeed.tech/topics/data-structures.md>), [API](<https://devfeed.tech/topics/api.md>), [generic programming](<https://devfeed.tech/topics/generic-programming.md>), [data type](<https://devfeed.tech/topics/data-type.md>), [atomic reference counting](<https://devfeed.tech/topics/atomic-reference-counting.md>)

Tags: [api](<https://devfeed.tech/tags/api.md>), [atomic](<https://devfeed.tech/tags/atomic.md>), [bit-packing](<https://devfeed.tech/tags/bit-packing.md>), [blog](<https://devfeed.tech/tags/blog.md>), [c-plus-plus](<https://devfeed.tech/tags/c-plus-plus.md>), [cache](<https://devfeed.tech/tags/cache.md>), [data-structures](<https://devfeed.tech/tags/data-structures.md>), [hash-table](<https://devfeed.tech/tags/hash-table.md>), [lock-free](<https://devfeed.tech/tags/lock-free.md>), [rocksdb](<https://devfeed.tech/tags/rocksdb.md>), [state](<https://devfeed.tech/tags/state.md>), [type-safe](<https://devfeed.tech/tags/type-safe.md>)

### AI overview

RocksDB's BitFields API packs typed fields into a single integer so lock-free structures can update more state with atomic operations while avoiding hand-maintained masks and shifts. In HyperClockCache, each slot's counters, state, and hit flag share a 64-bit value; the migration reportedly made the implementation easier to understand and helped algorithms make progress through atomic work updates. The C++ API offers typed field declarations, CAS support, and transforms that combine supported additions/subtractions or bitwise operations into one atomic operation, with debug-build overflow checks. The authors report no runtime overhead versus handwritten manipulation in RocksDB and identical assembly in one verified case. A LifoSem optimization relying on overflow between fields could not be expressed as efficiently under the API's overflow checks, so it accessed the underlying representation. A variant has been proposed for folly; broader acceptance and possible API improvements remain future work.

### Source excerpt

Modern concurrent data structures increasingly rely on atomic operations to avoid the overhead of locking. A valuable but under-utilized technique for maximizing the effectiveness of atomic operations is bit packing--fitting multiple logical fields into a single atomic variable for algorithmic simplicity and efficiency. However, language support for bit packing does not guarantee dense packing, and manually managing bit manipulation quickly becomes error-prone, especially when dealing with complex state machines. To address this in RocksDB, we have developed a reusable BitFields API, a type-safe, zero-overhead abstraction for bit packing in C++. This works in conjunction with clean wrappers for std::atomic for powerful and relatively safe bit-packing of atomic data. For broader use, a variant of the code has been proposed for adding to folly. The Problem: Managing Packed Bit Fields Consider HyperClockCache, an essentially lock-free cache implementation in RocksDB, which was refactored to use this BitFields API. It is a hash table built on slots that can each hold a cache entry and relevant metadata. For atomic simplicity and efficiency, all the essential metadata for each slot is packed into a single 64-bit value: The reference count and eviction metadata are together encoded into acquire and release counters, 30 bits each. The possible states of {empty, under construction/destruction, occupied+visible, and occupied+invisible} are encoded into three state bits (instead of two, for easier decoding and manipulation). A hit bit is used for secondary cache integration. Traditionally, you might write code like this: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 // Old approach: manual bit manipulation constexpr uint64_t kAcquireCounterShift = 0; constexpr uint64_t kReleaseCounterShift = 30; constexpr uint64_t kCounterMask = 0x3FFFFFFF; constexpr uint64_t kHitBitShift = 60; constexpr uint64_t k

## My wishlist for PHP in 2026

DevFeed: [My wishlist for PHP in 2026](<https://devfeed.tech/articles/my-wishlist-for-php-in-2026-44166.md>)

Original publisher: [Read original article](<https://stitcher.io/blog/my-wishlist-for-php-in-2026>)

Author: Brent

Published: 2025-10-29T00:00:00Z

Content type: opinion

Language: en

Sources: [Stitcher](<https://devfeed.tech/sources/stitcher-io.md>)

Topics: [PHP](<https://devfeed.tech/topics/php.md>), [generic programming](<https://devfeed.tech/topics/generic-programming.md>), [syntax](<https://devfeed.tech/topics/syntax.md>), [version](<https://devfeed.tech/topics/version.md>)

Tags: [2026](<https://devfeed.tech/tags/2026.md>), [generics](<https://devfeed.tech/tags/generics.md>), [php](<https://devfeed.tech/tags/php.md>), [rust](<https://devfeed.tech/tags/rust.md>), [syntax](<https://devfeed.tech/tags/syntax.md>), [wishlist](<https://devfeed.tech/tags/wishlist.md>)

### AI overview

An opinion piece outlining a wishlist for PHP, including generics and opt-in PHP editions that could allow experimental or backward-incompatible features within selected namespaces or codebases.

### Source excerpt

Read the full post on https://stitcher.io/blog/my-wishlist-for-php-in-2026

## Inside Go -- How It Really Works: Series Kickoff

DevFeed: [Inside Go -- How It Really Works: Series Kickoff](<https://devfeed.tech/articles/inside-go-how-it-really-works-series-kickoff-39762.md>)

Original publisher: [Read original article](<https://furkankolcu.com/post/inside-go-how-it-really-works-series-kickoff>)

Author: Furkan Kolcu

Published: 2025-09-11T10:16:52Z

Content type: article

Language: en

Sources: [Furkan Kolcu](<https://devfeed.tech/sources/furkan-kolcu-software-engineer-blog.md>)

Topics: [Go Language](<https://devfeed.tech/topics/go-language.md>), [Compiler](<https://devfeed.tech/topics/compiler.md>), [Concurrency](<https://devfeed.tech/topics/concurrency.md>), [Code](<https://devfeed.tech/topics/code.md>), [Optimization](<https://devfeed.tech/topics/optimization.md>), [escape analysis](<https://devfeed.tech/topics/escape-analysis.md>), [generic programming](<https://devfeed.tech/topics/generic-programming.md>), [modules](<https://devfeed.tech/topics/modules.md>), [reproducible builds](<https://devfeed.tech/topics/reproducible-builds.md>)

Tags: [compilation](<https://devfeed.tech/tags/compilation.md>), [concurrency](<https://devfeed.tech/tags/concurrency.md>), [deep-dive](<https://devfeed.tech/tags/deep-dive.md>), [generics](<https://devfeed.tech/tags/generics.md>), [go](<https://devfeed.tech/tags/go.md>), [go-compiler](<https://devfeed.tech/tags/go-compiler.md>), [go-concurrency](<https://devfeed.tech/tags/go-concurrency.md>), [go-performance](<https://devfeed.tech/tags/go-performance.md>), [go-runtime](<https://devfeed.tech/tags/go-runtime.md>), [golang](<https://devfeed.tech/tags/golang.md>), [how-go-works](<https://devfeed.tech/tags/how-go-works.md>), [inside-go](<https://devfeed.tech/tags/inside-go.md>), [internals](<https://devfeed.tech/tags/internals.md>), [memory-management](<https://devfeed.tech/tags/memory-management.md>), [performance](<https://devfeed.tech/tags/performance.md>), [technology](<https://devfeed.tech/tags/technology.md>)

### AI overview

This article launches a technical series about how Go works internally. The planned installments cover compilation, memory management, garbage collection, concurrency, the runtime, performance tuning, interfaces, generics, modules, and reproducible builds, with code examples and runtime experiments.

### Source excerpt

A deep-dive series into Go's internals. From compilation to memory management, concurrency, and performance tuning, each part unpacks how Go operates under the hood with clear explanations and real-life code examples.

## How to use generics to avoid duplications and make your code better

DevFeed: [How to use generics to avoid duplications and make your code better](<https://devfeed.tech/articles/how-to-use-generics-to-avoid-duplications-and-make-your-code-better-32291.md>)

Original publisher: [Read original article](<https://domenicoluciani.com/2025/04/11/how-to-use-generics-to-avoid-duplications-and-make-your-code-better.html>)

Author: Domenico Luciani

Published: 2025-04-10T22:00:00Z

Content type: tutorial

Language: en

Sources: [Domenico Luciani](<https://devfeed.tech/sources/domenico-luciani.md>)

Topics: [generic programming](<https://devfeed.tech/topics/generic-programming.md>), [Go Language](<https://devfeed.tech/topics/go-language.md>), [interface](<https://devfeed.tech/topics/interface.md>), [JSON:API](<https://devfeed.tech/topics/json-api.md>), [factory function](<https://devfeed.tech/topics/factory-function.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [create](<https://devfeed.tech/tags/create.md>), [generics](<https://devfeed.tech/tags/generics.md>), [go](<https://devfeed.tech/tags/go.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [interfaces](<https://devfeed.tech/tags/interfaces.md>), [like](<https://devfeed.tech/tags/like.md>), [refactor](<https://devfeed.tech/tags/refactor.md>)

### AI overview

A Go tutorial explains how generics can reduce duplicated method implementations when multiple response structs must satisfy the same interfaces. It demonstrates applying a reusable generic response to JSON:API-formatted responses and adding a factory function for readability.

### Source excerpt

I recently worked on a project that had a lot of code duplication due to repeated implementations of the same interfaces. I quickly realized it was a great opportunity to refactor...

## Resisting the Urge to Document Everything Everywhere

DevFeed: [Resisting the Urge to Document Everything Everywhere](<https://devfeed.tech/articles/resisting-the-urge-to-document-everything-everywhere-28958.md>)

Original publisher: [Read original article](<https://blog.jooq.org/resisting-the-urge-to-document-everything-everywhere/>)

Author: lukaseder

Published: 2025-02-28T10:39:07Z

Content type: opinion

Language: en

Sources: [jOOQ](<https://devfeed.tech/sources/jooq.md>)

Topics: [jooq](<https://devfeed.tech/topics/jooq.md>), [SQL](<https://devfeed.tech/topics/sql.md>), [generic programming](<https://devfeed.tech/topics/generic-programming.md>)

Tags: [caveat](<https://devfeed.tech/tags/caveat.md>), [documentation](<https://devfeed.tech/tags/documentation.md>), [generics](<https://devfeed.tech/tags/generics.md>), [jooq](<https://devfeed.tech/tags/jooq.md>), [jooq-development](<https://devfeed.tech/tags/jooq-development.md>), [quirk](<https://devfeed.tech/tags/quirk.md>), [sql](<https://devfeed.tech/tags/sql.md>), [stack-overflow](<https://devfeed.tech/tags/stack-overflow.md>), [xyproblem](<https://devfeed.tech/tags/xyproblem.md>)

### AI overview

The article argues that product teams should resist documenting every workaround alongside the feature that exposed a user's problem. Using jOOQ as an example, it explains that unrelated features can be difficult to discover even when one helps address a quirk or limitation in another.

### Source excerpt

Every product manager knows this situation: This is such a common pattern, and while it's perfectly understandable for such a user to request this, it is so terribly wrong to give in to this user's request. Why is it wrong? The features are unrelated Most of the time, the two features X1 and X2 are ... Continue reading Resisting the Urge to Document Everything Everywhere ->

## Making sense of TypeScript generics

DevFeed: [Making sense of TypeScript generics](<https://devfeed.tech/articles/making-sense-of-typescript-generics-20098.md>)

Original publisher: [Read original article](<https://medium.com/jobteaser-dev-team/making-sense-of-typescript-generics-6b830e66eeff?source=rss----bd77d16a0035---4>)

Author: Clément Gateaud

Published: 2024-07-04T16:12:05Z

Content type: tutorial

Language: en

Sources: [JobTeaser](<https://devfeed.tech/sources/jobteaser.md>)

Topics: [TypeScript](<https://devfeed.tech/topics/typescript.md>), [generic programming](<https://devfeed.tech/topics/generic-programming.md>), [Code](<https://devfeed.tech/topics/code.md>), [software-development](<https://devfeed.tech/topics/software-development.md>)

Tags: [code](<https://devfeed.tech/tags/code.md>), [development](<https://devfeed.tech/tags/development.md>), [errors](<https://devfeed.tech/tags/errors.md>), [generics](<https://devfeed.tech/tags/generics.md>), [generics-in-typescript](<https://devfeed.tech/tags/generics-in-typescript.md>), [type-parameter](<https://devfeed.tech/tags/type-parameter.md>), [type-safety](<https://devfeed.tech/tags/type-safety.md>), [types](<https://devfeed.tech/tags/types.md>), [typescript](<https://devfeed.tech/tags/typescript.md>), [web-development](<https://devfeed.tech/tags/web-development.md>)

### AI overview

This tutorial explains TypeScript generics through a simple JavaScript function that returns the first element of an array. It contrasts generics with using any, explicit lists of possible types, and type assertions, emphasizing improved type inference and type safety.

### Source excerpt

TypeScript significantly improved JavaScript development with enhanced code reliability and maintainability, ensuring fewer runtime errors and greater productivity for developers. But when you start working with it, the syntax can sometimes feel overwhelming. One of the most intimidating features in TypeScript is "generics". Look at the example below 🤯 aren't you afraid ? Types declarations from @tanstack/react-query (library) that can feel overwhelming But don't worry, we will go step by step and once you understand generics, you'll see how powerful they are. The best any alternative Imagine this very simple JavaScript function that returns the first element of an array. (I agree, this function is not very useful, but it's for the sake of explanation). How could we type it? 🤔 What would be the type of the array? Well, in this function it could be an array of anything (a string, a number, an object). So it could be tempting to type it like this, using the type whose name must not be spoken: any 😱 But this is very bad typing. Why? Because TypeScript won't be able to properly infer the return type of this function. So maybe we could specify all the different types it could be? Not a good idea. First, because it would force you to maintain a huge list of all the possible types for this function. But more importantly, because it doesn't solve our inference issue. TypeScript is not smart enough to guess the type when calling the function. So maybe we could use casting with as to help TypeScript? But that's cheating! With this type assertion, you are telling TypeScript: "Stop type checking and trust me, I know what I'm doing". This weakens type safety which is the core purpose of using TypeScript. Don't do that! There's a way safer and cleaner way to type this. Guess how it's named? ✨ Generics✨ Introducing generics Let's keep our previous example. What we want to tell our function is: "You will take as a parameter an array of SOMETHING, and you will return a SOMETHING ele

## The problem of union types for type systems

DevFeed: [The problem of union types for type systems](<https://devfeed.tech/articles/the-problem-of-union-types-for-type-systems-39390.md>)

Original publisher: [Read original article](<https://kt.academy/article/union-types-into>)

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

Content type: opinion

Language: en

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

Topics: [union types](<https://devfeed.tech/topics/union-types.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [subtype](<https://devfeed.tech/topics/subtype.md>), [generic programming](<https://devfeed.tech/topics/generic-programming.md>)

Tags: [generics](<https://devfeed.tech/tags/generics.md>), [inference](<https://devfeed.tech/tags/inference.md>), [interfaces](<https://devfeed.tech/tags/interfaces.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [programming](<https://devfeed.tech/tags/programming.md>), [programming-languages](<https://devfeed.tech/tags/programming-languages.md>), [smart-cast](<https://devfeed.tech/tags/smart-cast.md>), [static](<https://devfeed.tech/tags/static.md>), [subtype](<https://devfeed.tech/tags/subtype.md>), [type](<https://devfeed.tech/tags/type.md>), [types](<https://devfeed.tech/tags/types.md>), [union](<https://devfeed.tech/tags/union.md>), [workshop-learning-programming](<https://devfeed.tech/tags/workshop-learning-programming.md>)

### AI overview

This article explains why general union types are difficult to add to Kotlin and other statically typed systems. It discusses ambiguity in subtype relationships and generic type inference, including the claim that inference is NP-hard, then describes Kotlin's proposed limited use of union types for representing errors through rich errors.

### Source excerpt

Why union types are not such a good idea for static type systems.

## Generic Variance

DevFeed: [Generic Variance](<https://devfeed.tech/articles/generic-variance-25066.md>)

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

Author: author@typealias.com (Dave Leeds)

Published: 2024-04-23T00:00:00Z

Content type: article

Language: en

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

Topics: [generic programming](<https://devfeed.tech/topics/generic-programming.md>), [Generic Variance](<https://devfeed.tech/topics/generic-variance.md>), [Contravariance](<https://devfeed.tech/topics/contravariance.md>), [interface](<https://devfeed.tech/topics/interface.md>), [subtype](<https://devfeed.tech/topics/subtype.md>)

Tags: [advanced-kotlin-concepts](<https://devfeed.tech/tags/advanced-kotlin-concepts.md>), [arguments](<https://devfeed.tech/tags/arguments.md>), [base](<https://devfeed.tech/tags/base.md>), [classes](<https://devfeed.tech/tags/classes.md>), [contravariance](<https://devfeed.tech/tags/contravariance.md>), [covariance](<https://devfeed.tech/tags/covariance.md>), [extend](<https://devfeed.tech/tags/extend.md>), [generic](<https://devfeed.tech/tags/generic.md>), [generic-variance](<https://devfeed.tech/tags/generic-variance.md>), [generics](<https://devfeed.tech/tags/generics.md>), [implement](<https://devfeed.tech/tags/implement.md>), [interfaces](<https://devfeed.tech/tags/interfaces.md>), [introduction](<https://devfeed.tech/tags/introduction.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-generics](<https://devfeed.tech/tags/kotlin-generics.md>), [kotlin-type-safety](<https://devfeed.tech/tags/kotlin-type-safety.md>), [learn-to-program](<https://devfeed.tech/tags/learn-to-program.md>), [programming](<https://devfeed.tech/tags/programming.md>), [programming-language-type-systems](<https://devfeed.tech/tags/programming-language-type-systems.md>), [software-development](<https://devfeed.tech/tags/software-development.md>), [subtype](<https://devfeed.tech/tags/subtype.md>), [subtyping-in-kotlin](<https://devfeed.tech/tags/subtyping-in-kotlin.md>), [type](<https://devfeed.tech/tags/type.md>), [type-parameters](<https://devfeed.tech/tags/type-parameters.md>), [types](<https://devfeed.tech/tags/types.md>), [variance](<https://devfeed.tech/tags/variance.md>)

### AI overview

The excerpt introduces Kotlin generic variance: a parameterized type is not automatically a subtype just because its type argument is. Its vending-machine example illustrates covariance: a machine contractually returning any snack can be replaced by one that returns only candy bars, since a candy bar is a snack. The excerpt cuts off during the example and does not provide the promised three rules or discuss contravariance in detail.

### Source excerpt

We've seen how we can implement interfaces and extend classes to create subtypes. However, with generic types, we sometimes want to create a subtype based on the type arguments instead of the base types. Kotlin gives us a few different tools to achieve this, and in this chapter we'll learn all about them. In order to understand how this is possible, we'll first need to understand the principles of variance. Then, we'll look at three simple rules that explain when one parameterized type can be the subtype of another.

## Generics in Kotlin

DevFeed: [Generics in Kotlin](<https://devfeed.tech/articles/generics-in-kotlin-39335.md>)

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

Published: 2024-03-18T00:01:00Z

Content type: tutorial

Language: en

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

Topics: [generic programming](<https://devfeed.tech/topics/generic-programming.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Type Parameter](<https://devfeed.tech/topics/type-parameter.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [class](<https://devfeed.tech/topics/class.md>), [function](<https://devfeed.tech/topics/function.md>), [interface](<https://devfeed.tech/topics/interface.md>)

Tags: [classes](<https://devfeed.tech/tags/classes.md>), [functions](<https://devfeed.tech/tags/functions.md>), [generics](<https://devfeed.tech/tags/generics.md>), [interfaces](<https://devfeed.tech/tags/interfaces.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-compiler](<https://devfeed.tech/tags/kotlin-compiler.md>), [programming](<https://devfeed.tech/tags/programming.md>), [type-parameter](<https://devfeed.tech/tags/type-parameter.md>), [workshop-learning-programming](<https://devfeed.tech/tags/workshop-learning-programming.md>)

### AI overview

This tutorial explains how generics work in Kotlin. It covers generic functions, classes, and interfaces, including type parameters, type arguments, explicit specification, compiler inference, and relationships between argument and result types.

### Source excerpt

The essence of how generics work in Kotlin.

## Sealed Generics and SKIE - Paul Hawke

DevFeed: [Sealed Generics and SKIE - Paul Hawke](<https://devfeed.tech/articles/sealed-generics-and-skie-paul-hawke-38314.md>)

Original publisher: [Read original article](<https://touchlab.co/sealed-generics-and-skie>)

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

Content type: tutorial

Language: en

Sources: [Touchlab](<https://devfeed.tech/sources/touchlab-enterprise-mobile-innovation-development.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [generic programming](<https://devfeed.tech/topics/generic-programming.md>), [Swift](<https://devfeed.tech/topics/swift.md>), [class](<https://devfeed.tech/topics/class.md>), [Xcode](<https://devfeed.tech/topics/xcode.md>)

Tags: [apis](<https://devfeed.tech/tags/apis.md>), [classes](<https://devfeed.tech/tags/classes.md>), [generics](<https://devfeed.tech/tags/generics.md>), [kmp](<https://devfeed.tech/tags/kmp.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-multiplatform](<https://devfeed.tech/tags/kotlin-multiplatform.md>), [sealed](<https://devfeed.tech/tags/sealed.md>), [sealed-classes](<https://devfeed.tech/tags/sealed-classes.md>), [skie](<https://devfeed.tech/tags/skie.md>), [swift](<https://devfeed.tech/tags/swift.md>), [type](<https://devfeed.tech/tags/type.md>), [xcode](<https://devfeed.tech/tags/xcode.md>)

### AI overview

This tutorial explores how SKIE improves the use of Kotlin sealed classes with generics when exposing Kotlin Multiplatform code to Swift. It discusses type discovery in Xcode, Swift interoperability, and concurrency-related code paths.

### Source excerpt

Sealed Classes and Generics are both very useful for Kotlin APIs, and very painful with KMP and Swift. One of SKIE's lesser known benefits is the restoration of using Sealed Classes with generics, along with proper type discovery in Xcode.

## Relationship Structures: Let's Talk About Schemas

DevFeed: [Relationship Structures: Let's Talk About Schemas](<https://devfeed.tech/articles/relationship-structures-let-s-talk-about-schemas-81436.md>)

Original publisher: [Read original article](<https://stack.convex.dev/relationship-structures-let-s-talk-about-schemas>)

Author: Stack

Published: 2023-05-09T17:00:00Z

Content type: tutorial

Language: en

Sources: [Stack](<https://devfeed.tech/sources/stack.md>)

Topics: [data-modeling](<https://devfeed.tech/topics/data-modeling.md>), [generic programming](<https://devfeed.tech/topics/generic-programming.md>), [Drizzle](<https://devfeed.tech/topics/drizzle.md>)

Tags: [convex](<https://devfeed.tech/tags/convex.md>), [database](<https://devfeed.tech/tags/database.md>), [fundamentals](<https://devfeed.tech/tags/fundamentals.md>), [patterns](<https://devfeed.tech/tags/patterns.md>), [relationships](<https://devfeed.tech/tags/relationships.md>)

### AI overview

The post explains ways to model one-to-one, one-to-many, and many-to-many relationships in Convex, using references, indexes, arrays, and join tables. It describes tradeoffs such as lookup direction, array limits, scan costs, and keeping duplicated references in sync.

### Source excerpt

In this post we'll look at some patterns for structuring relationships in the Convex database.

## Polymorphic, Recursive Interfaces Using Go Generics

DevFeed: [Polymorphic, Recursive Interfaces Using Go Generics](<https://devfeed.tech/articles/polymorphic-recursive-interfaces-using-go-generics-29342.md>)

Original publisher: [Read original article](<https://multithreaded.stitchfix.com/blog/2023/02/01/go-polymorphic-interfaces/>)

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

Content type: tutorial

Language: en

Sources: [Stitch Fix](<https://devfeed.tech/sources/stitch-fix.md>)

Topics: [Go Language](<https://devfeed.tech/topics/go-language.md>), [generic programming](<https://devfeed.tech/topics/generic-programming.md>), [interface](<https://devfeed.tech/topics/interface.md>)

Tags: [code](<https://devfeed.tech/tags/code.md>), [generics](<https://devfeed.tech/tags/generics.md>), [go](<https://devfeed.tech/tags/go.md>), [interfaces](<https://devfeed.tech/tags/interfaces.md>)

### AI overview

The article explains how Go generics enable polymorphic interfaces whose methods return the concrete receiver type, using logger implementations as an example. It also discusses the limitations of Go's type inference, which can require explicit type parameters when using these interfaces.

### Source excerpt

I did a bit of experimenting over the weekend in an attempt to figure out how to write an interface that abstracted over methods whose return type was identical to the receiver's type. This is frequently a thing that one wants to do when abstracting over self-cloning objects, or things that implement the Builder pattern. For example, suppose we have a struct through which we log stuff: type StdoutLogger struct { out ioutil.Writer outMu sync.Mutex fields map[string]interface{} } func (n *StdoutLogger) WithFields(fields map[string]interface{}) (out *StdoutLogger) { for k, v := range fields { out.fields[k] = v } return } func (n *StdoutLogger) Infof(format string, args ...interface{}) { n.outMu.Lock() defer n.outMu.Unlock() s := fmt.Sprintf(format, args...) if len(n.fields) > 0 { s += " " } for k, v := range n.fields { s += fmt.Sprintf("%s=%+v", k, v) } n.out.Write([]byte(s)) } ...and we've got some other struct that we use during test which ignores all requests to log stuff: type NoopLogger struct {} func (n *NoopLogger) WithFields(fields map[string]interface{}) *NoopLogger { return n } func (n NoopLogger) Infof(format string, args ...interface{}) { return } Before Go Generics Before the Go "generics" feature was released, defining an interface that abstracted over both structs was not possible (link). For example, if we had a pre-generics interface that looked like: type Logger interface { WithFields(fields map[string]interface{}) Logger Infof(format string, args ...interface{}) } ...there would be no way to satisfy it with types that had these signatures: func (n *NoopLogger) WithFields(fields map[string]interface{}) *NoopLogger func (n *StdoutLogger) WithFields(fields map[string]interface{}) *StdoutLogger ...because of the different return types of each struct's WithFields method. Polymorphic Interfaces Now that generics have landed, we can define an interface that abstracts over both of these structs: type Logger[T any] interface { WithFields(fields map[string]interface

## Type-safe React Query

DevFeed: [Type-safe React Query](<https://devfeed.tech/articles/type-safe-react-query-48247.md>)

Original publisher: [Read original article](<https://tkdodo.eu/blog/type-safe-react-query>)

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

Content type: tutorial

Language: en

Sources: [TkDodo](<https://devfeed.tech/sources/tkdodo-s-blog.md>)

Topics: [TypeScript](<https://devfeed.tech/topics/typescript.md>), [React](<https://devfeed.tech/topics/react.md>), [generic programming](<https://devfeed.tech/topics/generic-programming.md>), [Code](<https://devfeed.tech/topics/code.md>), [Code review](<https://devfeed.tech/topics/code-review.md>), [ESLint](<https://devfeed.tech/topics/eslint.md>)

Tags: [code-reviews](<https://devfeed.tech/tags/code-reviews.md>), [eslint](<https://devfeed.tech/tags/eslint.md>), [generics](<https://devfeed.tech/tags/generics.md>), [react](<https://devfeed.tech/tags/react.md>), [type-safety](<https://devfeed.tech/tags/type-safety.md>), [typescript](<https://devfeed.tech/tags/typescript.md>)

### AI overview

This tutorial explains the difference between merely having TypeScript types and achieving reliable type safety in React Query. It discusses strict compiler settings, ESLint, code reviews, generics, and typing functions so React Query can infer returned data correctly.

### Source excerpt

About the difference between "having types" and "being type-safe"...

## Generics vs. Interfaces

DevFeed: [Generics vs. Interfaces](<https://devfeed.tech/articles/generics-vs-interfaces-22185.md>)

Original publisher: [Read original article](<https://www.ardanlabs.com/blog/2022/12/generic-vs-interfaces.html>)

Published: 2022-12-16T00:00:00Z

Content type: article

Language: en

Sources: [William Kennedy](<https://devfeed.tech/sources/william-kennedy.md>)

Topics: [generic programming](<https://devfeed.tech/topics/generic-programming.md>), [api server](<https://devfeed.tech/topics/api-server.md>), [Back end](<https://devfeed.tech/topics/backend.md>)

Tags: [abstract](<https://devfeed.tech/tags/abstract.md>), [adapter](<https://devfeed.tech/tags/adapter.md>), [adapter-pattern](<https://devfeed.tech/tags/adapter-pattern.md>), [api-server](<https://devfeed.tech/tags/api-server.md>), [bridge](<https://devfeed.tech/tags/bridge.md>), [business-logic](<https://devfeed.tech/tags/business-logic.md>), [decoding](<https://devfeed.tech/tags/decoding.md>), [encoding](<https://devfeed.tech/tags/encoding.md>), [generics](<https://devfeed.tech/tags/generics.md>), [go](<https://devfeed.tech/tags/go.md>), [go-api-server](<https://devfeed.tech/tags/go-api-server.md>), [gorm](<https://devfeed.tech/tags/gorm.md>), [http](<https://devfeed.tech/tags/http.md>), [pprof](<https://devfeed.tech/tags/pprof.md>), [reusable-code](<https://devfeed.tech/tags/reusable-code.md>), [solid](<https://devfeed.tech/tags/solid.md>), [solid-principles](<https://devfeed.tech/tags/solid-principles.md>)

### AI overview

Paulo refactors a Go API server that uses standard HTTP handlers and GORM by introducing adapter functions between API handlers and business logic. The adapter separates request processing from service logic and supports reuse across API callers. The video also covers launching the server with PPROF to evaluate performance and using a generic method to streamline data encoding and decoding.

### Source excerpt

Introduction In this video, Paulo shows the benefit of leveraging generic functions to write less code that does more. He starts by walking you through an API server he initially wrote that makes use of Go's default HTTP handlers with a sprinkle of GORM to manage database transactions. He then refactors that code by introducing the concept of adapter functions. Paulo's approach consists of decoupling his business logic with his API code. To achieve this, he defines an adapter function that will establish a bridge between his business logic and API server handlers. This proves to be an effective way to abstract request processing and handling. This approach also promotes code reusability because the business logic is loosely coupled with the API service invoking it.

## What I would change about PHP

DevFeed: [What I would change about PHP](<https://devfeed.tech/articles/what-i-would-change-about-php-44233.md>)

Original publisher: [Read original article](<https://stitcher.io/blog/php-reimagined-part-2>)

Author: Brent

Published: 2022-08-17T00:00:00Z

Content type: opinion

Language: en

Sources: [Stitcher](<https://devfeed.tech/sources/stitcher-io.md>)

Topics: [PHP](<https://devfeed.tech/topics/php.md>), [generic programming](<https://devfeed.tech/topics/generic-programming.md>), [Compiler](<https://devfeed.tech/topics/compiler.md>), [syntax](<https://devfeed.tech/topics/syntax.md>)

Tags: [compiler](<https://devfeed.tech/tags/compiler.md>), [generics](<https://devfeed.tech/tags/generics.md>), [language](<https://devfeed.tech/tags/language.md>), [opinion](<https://devfeed.tech/tags/opinion.md>), [php](<https://devfeed.tech/tags/php.md>), [static-analysis](<https://devfeed.tech/tags/static-analysis.md>), [syntax](<https://devfeed.tech/tags/syntax.md>)

### AI overview

An opinionated wishlist for PHP proposes generics, eliminating runtime type checks through optional static analysis, a PHP superset language, cascading attributes, scalar objects, and a pipe operator. The author frames these ideas as language-design thought experiments rather than definite plans for PHP.

### Source excerpt

Read the full post on https://stitcher.io/blog/php-reimagined-part-2

## Making reusable composables using Generics

DevFeed: [Making reusable composables using Generics](<https://devfeed.tech/articles/making-reusable-composables-using-generics-22651.md>)

Original publisher: [Read original article](<https://www.valueof.io/blog/compose-composable-function-generics>)

Author: James Shvarts

Published: 2022-04-29T20:02:08Z

Content type: tutorial

Language: en

Sources: [Android Blog - Mobile Dev Notes](<https://devfeed.tech/sources/android-blog-mobile-dev-notes.md>)

Topics: [generic programming](<https://devfeed.tech/topics/generic-programming.md>), [Jetpack Compose](<https://devfeed.tech/topics/jetpack-compose.md>), [Java](<https://devfeed.tech/topics/java.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>)

Tags: [component](<https://devfeed.tech/tags/component.md>), [compose](<https://devfeed.tech/tags/compose.md>), [dialog](<https://devfeed.tech/tags/dialog.md>), [generics](<https://devfeed.tech/tags/generics.md>), [java](<https://devfeed.tech/tags/java.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [viewmodel](<https://devfeed.tech/tags/viewmodel.md>)

### AI overview

This tutorial shows how to use Java Generics with Jetpack Compose to build reusable composable components that support different model objects. It demonstrates a shared delete-confirmation dialog, call sites, optional properties, and state handling in a ViewModel.

### Source excerpt

Using Java Generics to create reusable shared components in Compose

## The case for PHP generics

DevFeed: [The case for PHP generics](<https://devfeed.tech/articles/the-case-for-php-generics-44131.md>)

Original publisher: [Read original article](<https://stitcher.io/blog/generics-in-php-4>)

Author: Brent

Published: 2022-03-25T00:00:00Z

Content type: article

Language: en

Sources: [Stitcher](<https://devfeed.tech/sources/stitcher-io.md>)

Topics: [generic programming](<https://devfeed.tech/topics/generic-programming.md>), [PHP](<https://devfeed.tech/topics/php.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [Refactoring](<https://devfeed.tech/topics/refactoring.md>)

Tags: [generics](<https://devfeed.tech/tags/generics.md>), [php](<https://devfeed.tech/tags/php.md>), [programming](<https://devfeed.tech/tags/programming.md>), [refactoring](<https://devfeed.tech/tags/refactoring.md>)

### AI overview

The article argues that PHP should pursue statically checked generics rather than monomorphized or reified generics. It explains that runtime type checks mainly help with debugging, while static analysis provides most of the value of PHP's type system, and discusses possible roles for PHP internals and community tools.

### Source excerpt

Read the full post on https://stitcher.io/blog/generics-in-php-4

## Why we can't have generics in PHP

DevFeed: [Why we can't have generics in PHP](<https://devfeed.tech/articles/why-we-can-t-have-generics-in-php-44130.md>)

Original publisher: [Read original article](<https://stitcher.io/blog/generics-in-php-3>)

Author: Brent

Published: 2022-03-24T00:00:00Z

Content type: article

Language: en

Sources: [Stitcher](<https://devfeed.tech/sources/stitcher-io.md>)

Topics: [generic programming](<https://devfeed.tech/topics/generic-programming.md>), [PHP](<https://devfeed.tech/topics/php.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [Refactoring](<https://devfeed.tech/topics/refactoring.md>)

Tags: [generics](<https://devfeed.tech/tags/generics.md>), [performance](<https://devfeed.tech/tags/performance.md>), [php](<https://devfeed.tech/tags/php.md>), [programming](<https://devfeed.tech/tags/programming.md>), [programming-languages](<https://devfeed.tech/tags/programming-languages.md>)

### AI overview

This article explains why PHP does not support generics as first-class language features by examining monomorphized and reified implementations. It discusses their memory, compilation, runtime type-checking, performance, and code-refactoring implications, contrasting PHP with Rust, C#, and Kotlin.

### Source excerpt

Read the full post on https://stitcher.io/blog/generics-in-php-3

## Generics in PHP: Static Analysis and Generic Functions

DevFeed: [Generics in PHP: Static Analysis and Generic Functions](<https://devfeed.tech/articles/generics-in-depth-44129.md>)

Original publisher: [Read original article](<https://stitcher.io/blog/generics-in-php-2>)

Author: Brent

Published: 2022-03-23T00:00:00Z

Content type: tutorial

Language: en

Sources: [Stitcher](<https://devfeed.tech/sources/stitcher-io.md>)

Topics: [generic programming](<https://devfeed.tech/topics/generic-programming.md>), [PHP](<https://devfeed.tech/topics/php.md>), [ide](<https://devfeed.tech/topics/ide.md>), [phpstorm](<https://devfeed.tech/topics/phpstorm.md>), [Laravel](<https://devfeed.tech/topics/laravel.md>)

Tags: [code](<https://devfeed.tech/tags/code.md>), [generics](<https://devfeed.tech/tags/generics.md>), [ide](<https://devfeed.tech/tags/ide.md>), [php](<https://devfeed.tech/tags/php.md>), [phpstorm](<https://devfeed.tech/tags/phpstorm.md>), [type-checks](<https://devfeed.tech/tags/type-checks.md>)

### AI overview

This tutorial explains generics in PHP through collections and generic functions whose return types depend on the supplied class name. It describes how PHP static analyzers and IDEs use docblock annotations to infer types and detect potential bugs, while noting that PHP itself does not enforce these generic types at runtime.

### Source excerpt

Read the full post on https://stitcher.io/blog/generics-in-php-2

[Next page](<https://devfeed.tech/topics/generic-programming.md?cursor=WyIyMDIyLTAzLTIzVDAwOjAwOjAwKzAwOjAwIiwgImQ0MDIzNjViLTI3YjgtNGE0Mi04M2I2LTZkZTAzM2NjNDMzMiJd>)