# Effective Kotlin Item 32: Consider factory functions instead of secondary constructors

DevFeed: [Effective Kotlin Item 32: Consider factory functions instead of secondary constructors](<https://devfeed.tech/articles/effective-kotlin-item-32-consider-factory-functions-instead-of-secondary-constructors-39279.md>)

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

Published: 2021-07-25T00:00:00Z

Content type: tutorial

Language: en

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

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [functions](<https://devfeed.tech/topics/functions.md>), [constructor](<https://devfeed.tech/topics/constructor.md>), [object](<https://devfeed.tech/topics/object.md>), [interface](<https://devfeed.tech/topics/interface.md>), [Optimization](<https://devfeed.tech/topics/optimization.md>)

Tags: [constructor](<https://devfeed.tech/tags/constructor.md>), [functions](<https://devfeed.tech/tags/functions.md>), [interface](<https://devfeed.tech/tags/interface.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [object](<https://devfeed.tech/tags/object.md>), [optimization](<https://devfeed.tech/tags/optimization.md>), [workshop-learning-programming](<https://devfeed.tech/tags/workshop-learning-programming.md>)

## AI overview

This article explains why Kotlin factory functions are often preferable to secondary constructors for complex object creation. It covers clearer naming, avoiding constructor conflicts, returning subtype implementations behind interfaces, and allowing platform-specific or optimized implementations.

## Source excerpt

What factory functions are and why they are so important patterns for object creation.