# constructor

A constructor is a specialized function or class method that initializes and creates an object instance.

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

## 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.

## 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.

## Elliptic Curves as Python Objects

DevFeed: [Elliptic Curves as Python Objects](<https://devfeed.tech/articles/elliptic-curves-as-python-objects-40347.md>)

Original publisher: [Read original article](<https://www.jeremykun.com/2014/02/24/elliptic-curves-as-python-objects/>)

Published: 2014-02-24T10:00:28Z

Content type: tutorial

Language: en

Sources: [Jeremy Kun](<https://devfeed.tech/sources/jeremy-kun.md>)

Topics: [Python](<https://devfeed.tech/topics/python.md>), [Algorithm](<https://devfeed.tech/topics/algorithm.md>), [Code](<https://devfeed.tech/topics/code.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [classes](<https://devfeed.tech/topics/classes.md>), [object](<https://devfeed.tech/topics/object.md>), [constructor](<https://devfeed.tech/topics/constructor.md>), [test](<https://devfeed.tech/topics/test.md>), [unit test](<https://devfeed.tech/topics/unit-test.md>)

Tags: [algorithm](<https://devfeed.tech/tags/algorithm.md>), [classes](<https://devfeed.tech/tags/classes.md>), [code](<https://devfeed.tech/tags/code.md>), [constructor](<https://devfeed.tech/tags/constructor.md>), [elliptic-curves](<https://devfeed.tech/tags/elliptic-curves.md>), [groups](<https://devfeed.tech/tags/groups.md>), [object](<https://devfeed.tech/tags/object.md>), [programming](<https://devfeed.tech/tags/programming.md>), [python](<https://devfeed.tech/tags/python.md>), [test](<https://devfeed.tech/tags/test.md>), [unit-test](<https://devfeed.tech/tags/unit-test.md>)

### AI overview

This tutorial translates elliptic-curve point addition from its geometric and formal description into Python code. It introduces curve and point classes, associates each point with its curve, implements relevant operators, and includes checks that points lie on smooth curves.

### Source excerpt

Last time we saw a geometric version of the algorithm to add points on elliptic curves. We went quite deep into the formal setting for it (projective space $ \mathbb{P}^2$), and we spent a lot of time talking about the right way to define the "zero" object in our elliptic curve so that our issues with vertical lines would disappear. With that understanding in mind we now finally turn to code, and write classes for curves and points and implement the addition algorithm.

## Design Patterns: Singleton

DevFeed: [Design Patterns: Singleton](<https://devfeed.tech/articles/design-patterns-singleton-40676.md>)

Original publisher: [Read original article](<https://radek.io/posts/design-patterns-singleton/>)

Published: 2011-07-21T00:00:00Z

Content type: tutorial

Language: en

Sources: [Radek Pazdera](<https://devfeed.tech/sources/radek-pazdera.md>)

Topics: [Architecture & Design](<https://devfeed.tech/topics/architecture-design.md>), [C++](<https://devfeed.tech/topics/c-plus-plus.md>), [Python](<https://devfeed.tech/topics/python.md>), [Software](<https://devfeed.tech/topics/software.md>), [class](<https://devfeed.tech/topics/class.md>), [constructor](<https://devfeed.tech/topics/constructor.md>), [Exception](<https://devfeed.tech/topics/exception.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>), [constructor](<https://devfeed.tech/tags/constructor.md>), [design](<https://devfeed.tech/tags/design.md>), [design-patterns](<https://devfeed.tech/tags/design-patterns.md>), [implementation](<https://devfeed.tech/tags/implementation.md>), [python](<https://devfeed.tech/tags/python.md>)

### AI overview

This tutorial explains the Singleton design pattern, which provides one globally accessible instance of a class. It outlines the required static storage, access method, and constructor restrictions, then discusses implementations in C++ and Python.

### Source excerpt

Software design patterns by example

## Satirical announcement about modifying access modifiers in open-source Java projects

DevFeed: [Satirical announcement about modifying access modifiers in open-source Java projects](<https://devfeed.tech/articles/wikileaks-to-leak-5000-open-source-java-projects-with-all-that-private-final-bullshit-removed-38773.md>)

Original publisher: [Read original article](<https://steve-yegge.blogspot.com/2010/07/wikileaks-to-leak-5000-open-source-java.html>)

Author: Steve Yegge (noreply@blogger.com)

Published: 2010-07-28T20:40:00Z

Content type: opinion

Language: en

Sources: [Steve Yegge](<https://devfeed.tech/sources/steve-yegge.md>)

Topics: [Java](<https://devfeed.tech/topics/java.md>), [Open Source](<https://devfeed.tech/topics/open-source.md>), [Code](<https://devfeed.tech/topics/code.md>), [Java Language](<https://devfeed.tech/topics/java-language.md>), [class](<https://devfeed.tech/topics/class.md>), [constructor](<https://devfeed.tech/topics/constructor.md>), [deprecated](<https://devfeed.tech/topics/deprecated.md>), [Perl](<https://devfeed.tech/topics/perl.md>)

Tags: [class](<https://devfeed.tech/tags/class.md>), [code](<https://devfeed.tech/tags/code.md>), [constructor](<https://devfeed.tech/tags/constructor.md>), [deprecated](<https://devfeed.tech/tags/deprecated.md>), [java](<https://devfeed.tech/tags/java.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [perl](<https://devfeed.tech/tags/perl.md>), [projects](<https://devfeed.tech/tags/projects.md>), [source](<https://devfeed.tech/tags/source.md>)

### AI overview

This satirical article describes a purported Wikileaks announcement to re-release open-source Java projects after changing access modifiers, removing most final and deprecated declarations, adding public constructors, and exposing fields.

### Source excerpt

EYJAFJÖLL, ICELAND -- Java programmers around the globe are in a panic today over a Wikileaks press release issued at 8:15am GMT. Wikileaks announced that they will re-release the source code for thousands of Open Source Java projects, making all access modifiers 'public' and all classes and members non-'final'. Agile Java Developer Johnnie Garza of Irvine, CA condemns the move. "They have no right to do this. Open Source does not mean the source is somehow 'open'. That's my code, not theirs. If I make something private, it means that no matter how desperately you need to call it, I should be able to prevent you from doing so, even long after I've gone to the grave." According to the Wikileaks press release, millions of Java source files have been run through a Perl script that removes all 'final' keywords except those required for hacking around the 15-year-old Java language's "fucking embarrassing lack of closures." Moreover, the Perl script gives every Java class at least one public constructor, and turns all fields without getters/setters into public fields. "The script yanks out all that @deprecated shit, too," claims the controversial announcement. Longtime Java programmer Ronnie Lloyd of Austin, TX is offended by the thought of people instantiating his private classes. "It's just common sense," said Lloyd, who is 37. "If I buy you a house and put the title in your name, but I mark some of the doors 'Employees Only', then you're not allowed to open those doors, even though it's your house. Because it's really my house, even though I gave it to you to live in." Pacing and frowning thoughtfully, Lloyd continued: "Even if I go away forever and you live there for 20 years and you know exactly what's behind the doors -- heck, even if it's a matter of life and death -- plain old common sense still dictates that you're never, ever allowed to open them for any reason." "It's for your own protection," Lloyd added. Wesley Doyle, a Java web developer in Toronto, Canada is m