I always fall for it

This title could be clearer and more informative.Try out Clickbait Shieldfor free (5 uses left this month).

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.

2h 4m watch time

Sort: