Question d’entretien chez OKG

Explain the difference between Generics vs Trait Objects

Réponse à la question d'entretien

Utilisateur anonyme

11 févr. 2026

Generics - Faster compile, larger binaries. Used when types are known and performance matters. Basically a normal fn function that takes arguments Trait Objects - When flexibility at runtime is needed with not always known variables. Slower performance but less binary size. More concerned with what things do. Nuanced and dependent on situation.