Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Christopher Alexander (the architect) wrote a paper called A City Is Not A Tree. I don't know of any paper called A Program Is Not A Tree, but one could be written. Programs are fundamentally messy tangles of references, as far as I can tell! Compile-time structures are utterly different from run-time structures. Some languages have both dynamic and lexical scoping. Etc.


you can reduce an individual function to a a directed graph (not a tree). But once you have more than one function? That's graphs referencing graphs. That definitely doesn't reduce to a tree.

The only parts of a program that reduce to a tree are incidental to their functionality - the nesting-block structure of procedural, C-derived languages, and the tree structure of a filesystem.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: