# Field defaults

**URL:** <https://ziggit.dev/t/field-defaults/17755>\
**Category:** Explain\
**Tags:** language\
**Created:** [September 29, 2026, 2:55pm UTC](https://ziggit.dev/t/field-defaults/17755 "2026-09-29T14:55:26Z")\
**Posts on this page:** 1\
**Page:** 2

<div class="post-metadata">

**Author:** ![chung-leong](https://ziggit.dev/user_avatar/ziggit.dev/chung-leong/32/999_2.png) [@chung-leong](https://ziggit.dev/u/chung-leong)\
**Post date:** [October 2, 2026, 9:36pm UTC](https://ziggit.dev/t/field-defaults/17755/21 "2026-10-02T21:36:24Z")

</div>

The cleanest way to deal with this, I think, is to always have a `init` function that accepts an option struct. To initialize something to its default state (whatever that means), you do this:

```zig
const bar: Bar = .init(.default);

```

If it’s something that can be empty, you can make it so by doing this:

```zig
const bar: Bar = .init(.empty);

```

Translated into English, “initialize an instance of Bar using the default options and save the result to bar” is far clearer than “bar is an instance of Bar–it’s initialized”.

With this arrangement, programmers always know where to look in the documentation. It’s always going to the under `init`.

[Previous page](https://ziggit.dev/t/field-defaults/17755.md?page=1)
