<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/i-always-fall-for-it-ji9iymae2" -->

---
title: I always fall for it | daily.dev
description: A live coding session where the author refactors a D-Bus library written in Zig, replacing a metaprogramming-based type deduction serialization approach with...
canonical: https://daily.dev/posts/i-always-fall-for-it-ji9iymae2
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: I always fall for it | daily.dev
og:description: A live coding session where the author refactors a D-Bus library written in Zig, replacing a metaprogramming-based type deduction serialization approach with...
og:url: https://daily.dev/posts/i-always-fall-for-it-ji9iymae2
og:image: https://api.daily.dev/og/posts/jI9iYMae2.png
og:image:alt: I always fall for it
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# I always fall for it

**[sphaerophoria](https://daily.dev/sources/sphaerophoria)** · 124 min read · 7 upvotes · 0 comments

## Summary

A live coding session where the author refactors a D-Bus library written in Zig, replacing a metaprogramming-based type deduction serialization approach with an explicit builder-style API. The author argues that metaprogramming for serialization is overly complex, hard to debug, and not worth the 'cool factor.' The session walks through designing a BodySerializer struct with explicit add_string, add_i64, add_f64, add_byte, start_array, start_element, and end_array methods that build both the type signature string and the serialized body incrementally. Key challenges addressed include handling the D-Bus header/body ordering problem using vectored writes, tracking array nesting depth for type string consistency checking, and correctly writing the array length field back after serialization. The session ends with arrays working correctly after discovering a missing 'a' prefix in the type string for arrays.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.youtube.com/watch?v=EQ6yGh0FOXM>

---

Tags: [#architecture](https://daily.dev/tags/architecture), [#zig](https://daily.dev/tags/zig)

[View this post on daily.dev](https://daily.dev/posts/i-always-fall-for-it-ji9iymae2)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"I always fall for it","url":"https://daily.dev/posts/i-always-fall-for-it-ji9iymae2","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/i-always-fall-for-it-ji9iymae2"},"datePublished":"2026-03-21T22:53:42.989Z","dateModified":"2026-03-22T00:40:54.945Z","description":"A live coding session where the author refactors a D-Bus library written in Zig, replacing a metaprogramming-based type deduction serialization approach with...","image":"https://i.ytimg.com/vi/EQ6yGh0FOXM/sddefault.jpg","thumbnailUrl":"https://i.ytimg.com/vi/EQ6yGh0FOXM/sddefault.jpg","isAccessibleForFree":true,"articleSection":"sphaerophoria","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"sphaerophoria","logo":"https://media.daily.dev/image/upload/s--dgPUg2T7--/f_auto/v1728806109/logos/sphaerophoria","url":"https://daily.dev/sources/sphaerophoria"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/i-always-fall-for-it-ji9iymae2","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":7},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"architecture,zig","timeRequired":"PT124M","video":{"@type":"VideoObject","name":"I always fall for it","description":"A live coding session where the author refactors a D-Bus library written in Zig, replacing a metaprogramming-based type deduction serialization approach with...","thumbnailUrl":"https://i.ytimg.com/vi/EQ6yGh0FOXM/sddefault.jpg","uploadDate":"2026-03-21T22:53:42.989Z","duration":"PT124M","url":"https://api.daily.dev/r/jI9iYMae2","embedUrl":"https://www.youtube.com/embed/EQ6yGh0FOXM"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"sphaerophoria","item":"https://daily.dev/sources/sphaerophoria"},{"@type":"ListItem","position":3,"name":"I always fall for it"}]}
```

