41 lines
2.7 KiB
Markdown
41 lines
2.7 KiB
Markdown
---
|
|
title: "An example of this - a classic way to construct a tree in code is with push / pop style calls."
|
|
type: archive
|
|
source: twitter
|
|
source_url: "https://x.com/nicbarkeragain/status/2084851804224004329"
|
|
author: "Nic Barker"
|
|
handle: nicbarkeragain
|
|
post_id: "2084851804224004329"
|
|
date: 2026-08-05
|
|
archived: 2026-08-25
|
|
draft: false
|
|
tags:
|
|
- archive
|
|
- twitter
|
|
- nicbarkeragain
|
|
description: "An example of this - a classic way to construct a tree in code is with push / pop style calls."
|
|
in_reply_to: ""
|
|
---
|
|
|
|
## Source
|
|
|
|
- URL: https://x.com/nicbarkeragain/status/2084851804224004329
|
|
- Author: Nic Barker (@nicbarkeragain)
|
|
- Posted: 2026-08-05 03:59:39
|
|
|
|
## Thread
|
|
|
|
**1/** **@nicbarkeragain** ^2084851804224004329
|
|
|
|
An example of this - a classic way to construct a tree in code is with push / pop style calls. Forgetting to call pop() or close() can be annoying to debug, and you can make this much easier just enforcing matching string tags on open / close. Also enforces readability:
|
|
|
|

|
|
|
|
Branches: [[archive/threads/nicbarkeragain/2026-08-05-an-example-of-this-a-classic-way-to-construct-a/2026-08-05-lionkimbro10x-i-love-everything-about-this-and-i-agree-its-fine]], [[archive/threads/nicbarkeragain/2026-08-05-an-example-of-this-a-classic-way-to-construct-a/2026-08-05-hasen_95dx-this-particular-case-though-is-easily-solved-with]], [[archive/threads/nicbarkeragain/2026-08-05-an-example-of-this-a-classic-way-to-construct-a/2026-08-05-choco_dolphin7-1-got-into-the-habit-of-immediately-writing-free]], [[archive/threads/nicbarkeragain/2026-08-05-an-example-of-this-a-classic-way-to-construct-a/2026-08-05-borrowck_novel-thanks-a-lot-for-the-example]], [[archive/threads/nicbarkeragain/2026-08-05-an-example-of-this-a-classic-way-to-construct-a/2026-08-05-plasm_nl-thats-a-great-tip-i-always-used-comments-but-this]], [[archive/threads/nicbarkeragain/2026-08-05-an-example-of-this-a-classic-way-to-construct-a/2026-08-05-datgame-ah-matching-strings-just-like-xml]], [[archive/threads/nicbarkeragain/2026-08-05-an-example-of-this-a-classic-way-to-construct-a/2026-08-05-rep_movsd-or-you-could-use-c-with-raii-and-not-have-to-tie]], [[archive/threads/nicbarkeragain/2026-08-05-an-example-of-this-a-classic-way-to-construct-a/2026-08-05-eta9499-deferloop-is-super-useful-for-this]], [[archive/threads/nicbarkeragain/2026-08-05-an-example-of-this-a-classic-way-to-construct-a/2026-08-05-windless_mill-tangently-this-example-illustates-pretty-good-why]], [[archive/threads/nicbarkeragain/2026-08-05-an-example-of-this-a-classic-way-to-construct-a/2026-08-06-real_philogy-rusts-ownership-raii-makes-such-patterns-really]]
|
|
|
|
**2/** **@exacoustics** ^2084859876430536882
|
|
|
|
**@nicbarkeragain**
|
|
|
|
Stealing this idea
|