# Property (Programming)

> A named value kept in an object, like a dog's name or age.

**Field:** Software Development  
**Category:** Programming Paradigms  
**Also known as:** Object Property, Instance Variable, Field (Programming)

## Think of it like

It is like a name tag and a height chart for a pet. Each pet has its own.

## Definition

A property is a named value that belongs to an object. A dog object might have a name property and an age property. Each object keeps its own values, so two dogs can have different names. You read one with a dot, like dog.name. Some languages call them fields or attributes.

## Example

Emma's game has a player object. Its health property starts at 100 and drops each time the player is hit.

## Example code

```python
class Dog:
    def __init__(self, name):
        self.name = name

rex = Dog("Rex")
print(rex.name)
# Rex
```

Each dog gets its own name property, read with a dot.

## Why it matters

Properties hold the data an object knows about itself. Methods use them to do their work.

## Common mistake

Letting any code change a property at will. Then nothing stops a bug from setting age to minus five.

## Three principles

- **Belongs to an object.** Each object has its own copy.
- **Read with a dot.** Like dog.name or player.health.
- **Guard it.** Check values before they change.

## Related terms

- [Object (Programming)](https://learn.benibix.com/term/development/object)
- [Class](https://learn.benibix.com/term/development/class)
- [Method (Programming)](https://learn.benibix.com/term/development/method)
- [Encapsulation](https://learn.benibix.com/term/development/encapsulation)
- [Variable](https://learn.benibix.com/term/development/variable)
- [Access Modifier](https://learn.benibix.com/term/development/access-modifier)

![A card for a class named Dog. Its top part lists two properties, a public name and a private age. Its lower part lists a method, bark, that uses self.name, and a static method, count, marked as belonging to the class. Two dog objects, Rex and Bella, sit beside it, each with its own name. An arrow from self points at Rex.](https://learn.benibix.com/diagrams/dev7-class-parts.svg)

---

Source: https://learn.benibix.com/term/development/property
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
