HeadlinesBriefing favicon HeadlinesBriefing.com

Data Representation in Programming

Hacker News •
×

The article explores how data is represented in programming systems, focusing on application-level data manipulation, viewing, storage, and transmission. It contrasts the experience of writing Rust code, where data requires separate notations for creation, in-memory representation, and printed output, with Clojure.

In Clojure, the code used to express data structures is identical to their printed representation, thanks to the Extensible Data Notation (EDN). This consistency allows for seamless copying between the REPL, code, and logs, and crucially, it makes the textual representation an effective proxy for thinking about the in-memory data. This is analogous to how symbolic notation aids mathematical problem-solving.

The author argues that carefully designed notations, like EDN in Clojure, simplify data modeling by embedding good defaults and using the notation pervasively. This is compared to JavaScript/JSON, which achieved similar success more accidentally. Other areas where data notations are crucial include databases, network transmission, debuggers, configuration files, and even whiteboards, highlighting a general need for human-friendly representations even for binary data.