some nic barker posts.

This commit is contained in:
ed committed 2026-08-25 15:54:26 -04:00
1 parent 6922d52b5e
commit 0dd4a41807
30 files changed
+1093

No files matched your search

+1
View File
@@ -26,6 +26,7 @@ Example of the note shape (single spine, no branches): [[archive/threads/How to
- [[archive/threads/VictorTaelin]]
- [[archive/threads/kenpex]]
- [[archive/threads/mmalex]]
- [[archive/threads/nicbarkeragain]]
- [[archive/threads/rianflo]]
- [[archive/threads/simplex_fx]]
- [[archive/threads/valigo]]
@@ -0,0 +1,37 @@
---
title: "@nicbarkeragain I do and access it via 9p."
type: archive
source: twitter
source_url: "https://x.com/BurnZeZ/status/2084148778316034483"
author: "BurnZeZ"
handle: BurnZeZ
post_id: "2084148778316034483"
date: 2026-08-03
archived: 2026-08-25
draft: false
tags:
- archive
- twitter
- nicbarkeragain
description: "@nicbarkeragain I do and access it via 9p."
in_reply_to: ""
parent_post_id: "2084072929780998198"
---
## Source
- URL: https://x.com/BurnZeZ/status/2084148778316034483
- Author: BurnZeZ (@BurnZeZ)
- Posted: 2026-08-03 05:26:05
## Branch
**1/** @BurnZeZ
@nicbarkeragain
I do and access it via 9p.
## Related
- Spine: [[archive/threads/nicbarkeragain/2026-08-03-imo-basically-every-object-creation-api-you-have]]
@@ -0,0 +1,37 @@
---
title: "@nicbarkeragain brb adding this to my codebase"
type: archive
source: twitter
source_url: "https://x.com/DjMolehill/status/2084151008817553509"
author: "DJ Molehill"
handle: DjMolehill
post_id: "2084151008817553509"
date: 2026-08-03
archived: 2026-08-25
draft: false
tags:
- archive
- twitter
- nicbarkeragain
description: "@nicbarkeragain brb adding this to my codebase"
in_reply_to: ""
parent_post_id: "2084072929780998198"
---
## Source
- URL: https://x.com/DjMolehill/status/2084151008817553509
- Author: DJ Molehill (@DjMolehill)
- Posted: 2026-08-03 05:34:56
## Branch
**1/** @DjMolehill
@nicbarkeragain
brb adding this to my codebase
## Related
- Spine: [[archive/threads/nicbarkeragain/2026-08-03-imo-basically-every-object-creation-api-you-have]]
@@ -0,0 +1,37 @@
---
title: "@nicbarkeragain You can also implicitly pass the source code location from creation so there's no need for explicit labeling a lot of the time."
type: archive
source: twitter
source_url: "https://x.com/Leonardo_Temp/status/2084214550358876592"
author: "leotmp"
handle: Leonardo_Temp
post_id: "2084214550358876592"
date: 2026-08-03
archived: 2026-08-25
draft: false
tags:
- archive
- twitter
- nicbarkeragain
description: "@nicbarkeragain You can also implicitly pass the source code location from creation so there's no need for explicit labeling a lot of the time."
in_reply_to: ""
parent_post_id: "2084072929780998198"
---
## Source
- URL: https://x.com/Leonardo_Temp/status/2084214550358876592
- Author: leotmp (@Leonardo_Temp)
- Posted: 2026-08-03 09:47:26
## Branch
**1/** @Leonardo_Temp
@nicbarkeragain
You can also implicitly pass the source code location from creation so there's no need for explicit labeling a lot of the time. Odin makes this easy with "loc := #caller_location"
## Related
- Spine: [[archive/threads/nicbarkeragain/2026-08-03-imo-basically-every-object-creation-api-you-have]]
@@ -0,0 +1,37 @@
---
title: "@nicbarkeragain This is the way!"
type: archive
source: twitter
source_url: "https://x.com/MikeyBally/status/2084242087419969733"
author: "Mike Ball"
handle: MikeyBally
post_id: "2084242087419969733"
date: 2026-08-03
archived: 2026-08-25
draft: false
tags:
- archive
- twitter
- nicbarkeragain
description: "@nicbarkeragain This is the way!"
in_reply_to: ""
parent_post_id: "2084072929780998198"
---
## Source
- URL: https://x.com/MikeyBally/status/2084242087419969733
- Author: Mike Ball (@MikeyBally)
- Posted: 2026-08-03 11:36:51
## Branch
**1/** @MikeyBally
@nicbarkeragain
This is the way!
## Related
- Spine: [[archive/threads/nicbarkeragain/2026-08-03-imo-basically-every-object-creation-api-you-have]]
@@ -0,0 +1,37 @@
---
title: "@nicbarkeragain I don't suppose you could demonstrate this with a small code snippet/example that shows HOW one can label an allocation?"
type: archive
source: twitter
source_url: "https://x.com/RazorSharpFang/status/2084147756646670657"
author: "RazorSharpFang"
handle: RazorSharpFang
post_id: "2084147756646670657"
date: 2026-08-03
archived: 2026-08-25
draft: false
tags:
- archive
- twitter
- nicbarkeragain
description: "@nicbarkeragain I don't suppose you could demonstrate this with a small code snippet/example that shows HOW one can label an allocation?"
in_reply_to: ""
parent_post_id: "2084072929780998198"
---
## Source
- URL: https://x.com/RazorSharpFang/status/2084147756646670657
- Author: RazorSharpFang (@RazorSharpFang)
- Posted: 2026-08-03 05:22:01
## Branch
**1/** @RazorSharpFang
@nicbarkeragain
I don't suppose you could demonstrate this with a small code snippet/example that shows HOW one can label an allocation?
## Related
- Spine: [[archive/threads/nicbarkeragain/2026-08-03-imo-basically-every-object-creation-api-you-have]]
@@ -0,0 +1,37 @@
---
title: "@nicbarkeragain Isn't this just a Python-style docstring with extra steps?"
type: archive
source: twitter
source_url: "https://x.com/RealOtisCrune/status/2084110760872128905"
author: "Otis Crune 🇺🇲🌎🚀"
handle: RealOtisCrune
post_id: "2084110760872128905"
date: 2026-08-03
archived: 2026-08-25
draft: false
tags:
- archive
- twitter
- nicbarkeragain
description: "@nicbarkeragain Isn't this just a Python-style docstring with extra steps?"
in_reply_to: ""
parent_post_id: "2084072929780998198"
---
## Source
- URL: https://x.com/RealOtisCrune/status/2084110760872128905
- Author: Otis Crune 🇺🇲🌎🚀 (@RealOtisCrune)
- Posted: 2026-08-03 02:55:00
## Branch
**1/** @RealOtisCrune
@nicbarkeragain
Isn't this just a Python-style docstring with extra steps?
## Related
- Spine: [[archive/threads/nicbarkeragain/2026-08-03-imo-basically-every-object-creation-api-you-have]]
@@ -0,0 +1,37 @@
---
title: "@nicbarkeragain https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/wdm/nf-wdm-exallocatepool2 🤘"
type: archive
source: twitter
source_url: "https://x.com/_can1357/status/2084128363652775945"
author: "Can Bölük"
handle: _can1357
post_id: "2084128363652775945"
date: 2026-08-03
archived: 2026-08-25
draft: false
tags:
- archive
- twitter
- nicbarkeragain
description: "@nicbarkeragain https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/wdm/nf-wdm-exallocatepool2 🤘"
in_reply_to: ""
parent_post_id: "2084072929780998198"
---
## Source
- URL: https://x.com/_can1357/status/2084128363652775945
- Author: Can Bölük (@_can1357)
- Posted: 2026-08-03 04:04:57
## Branch
**1/** @_can1357
@nicbarkeragain
https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/wdm/nf-wdm-exallocatepool2 🤘
## Related
- Spine: [[archive/threads/nicbarkeragain/2026-08-03-imo-basically-every-object-creation-api-you-have]]
@@ -0,0 +1,37 @@
---
title: "@nicbarkeragain Can you post an example of how you would implement it?"
type: archive
source: twitter
source_url: "https://x.com/borrowck_novel/status/2084191310303399995"
author: "borrowck-novel"
handle: borrowck_novel
post_id: "2084191310303399995"
date: 2026-08-03
archived: 2026-08-25
draft: false
tags:
- archive
- twitter
- nicbarkeragain
description: "@nicbarkeragain Can you post an example of how you would implement it?"
in_reply_to: ""
parent_post_id: "2084072932293386379"
---
## Source
- URL: https://x.com/borrowck_novel/status/2084191310303399995
- Author: borrowck-novel (@borrowck_novel)
- Posted: 2026-08-03 08:15:05
## Branch
**1/** @borrowck_novel
@nicbarkeragain
Can you post an example of how you would implement it?
## Related
- Spine: [[archive/threads/nicbarkeragain/2026-08-03-imo-basically-every-object-creation-api-you-have]]
@@ -0,0 +1,37 @@
---
title: "@nicbarkeragain IIRC sokol_gfx does this."
type: archive
source: twitter
source_url: "https://x.com/exacoustics/status/2084099272300253636"
author: "exacoustics"
handle: exacoustics
post_id: "2084099272300253636"
date: 2026-08-03
archived: 2026-08-25
draft: false
tags:
- archive
- twitter
- nicbarkeragain
description: "@nicbarkeragain IIRC sokol_gfx does this."
in_reply_to: ""
parent_post_id: "2084072929780998198"
---
## Source
- URL: https://x.com/exacoustics/status/2084099272300253636
- Author: exacoustics (@exacoustics)
- Posted: 2026-08-03 02:09:21
## Branch
**1/** @exacoustics
@nicbarkeragain
IIRC sokol_gfx does this. It’s really nice. I’ve copied the pattern in my own graphics API
## Related
- Spine: [[archive/threads/nicbarkeragain/2026-08-03-imo-basically-every-object-creation-api-you-have]]
@@ -0,0 +1,37 @@
---
title: "@nicbarkeragain When I've seen this they usually require unique names and then you end up recapitulating the entire creation path in the string to make it unique but still readable, which I kinda hate."
type: archive
source: twitter
source_url: "https://x.com/joseph_h_garvin/status/2084138515286081732"
author: "Joseph Garvin"
handle: joseph_h_garvin
post_id: "2084138515286081732"
date: 2026-08-03
archived: 2026-08-25
draft: false
tags:
- archive
- twitter
- nicbarkeragain
description: "@nicbarkeragain When I've seen this they usually require unique names and then you end up recapitulating the entire creation path in the string to make it unique but still readable, which I kinda hate."
in_reply_to: ""
parent_post_id: "2084072929780998198"
---
## Source
- URL: https://x.com/joseph_h_garvin/status/2084138515286081732
- Author: Joseph Garvin (@joseph_h_garvin)
- Posted: 2026-08-03 04:45:18
## Branch
**1/** @joseph_h_garvin
@nicbarkeragain
When I've seen this they usually require unique names and then you end up recapitulating the entire creation path in the string to make it unique but still readable, which I kinda hate. Do you not enforce uniqueness? Also a bunch of code to assemble those strings.
## Related
- Spine: [[archive/threads/nicbarkeragain/2026-08-03-imo-basically-every-object-creation-api-you-have]]
@@ -0,0 +1,43 @@
---
title: "@nicbarkeragain That's actually a smart idea."
type: archive
source: twitter
source_url: "https://x.com/onepopcorn/status/2084163142041427988"
author: "Onepopcorn"
handle: onepopcorn
post_id: "2084163142041427988"
date: 2026-08-03
archived: 2026-08-25
draft: false
tags:
- archive
- twitter
- nicbarkeragain
description: "@nicbarkeragain That's actually a smart idea."
in_reply_to: ""
parent_post_id: "2084072929780998198"
---
## Source
- URL: https://x.com/onepopcorn/status/2084163142041427988
- Author: Onepopcorn (@onepopcorn)
- Posted: 2026-08-03 06:23:09
## Branch
**1/** @onepopcorn
@nicbarkeragain
That's actually a smart idea. Do you have an example of how you would implement that?
**2/** @nicbarkeragain
@onepopcorn
Here's an example I came across just now: https://x.com/nicbarkeragain/status/2084851804224004329?s=20
## Related
- Spine: [[archive/threads/nicbarkeragain/2026-08-03-imo-basically-every-object-creation-api-you-have]]
@@ -0,0 +1,37 @@
---
title: "@nicbarkeragain ya tagging allocations, and frames to actual assets in-game is absolutely necessary for development once your game stops being a small thing"
type: archive
source: twitter
source_url: "https://x.com/petey_fo_really/status/2084134337105314188"
author: "Peterino2"
handle: petey_fo_really
post_id: "2084134337105314188"
date: 2026-08-03
archived: 2026-08-25
draft: false
tags:
- archive
- twitter
- nicbarkeragain
description: "@nicbarkeragain ya tagging allocations, and frames to actual assets in-game is absolutely necessary for development once your game stops being a small thing"
in_reply_to: ""
parent_post_id: "2084072929780998198"
---
## Source
- URL: https://x.com/petey_fo_really/status/2084134337105314188
- Author: Peterino2 (@petey_fo_really)
- Posted: 2026-08-03 04:28:41
## Branch
**1/** @petey_fo_really
@nicbarkeragain
ya tagging allocations, and frames to actual assets in-game is absolutely necessary for development once your game stops being a small thing
## Related
- Spine: [[archive/threads/nicbarkeragain/2026-08-03-imo-basically-every-object-creation-api-you-have]]
@@ -0,0 +1,39 @@
---
title: "@nicbarkeragain I accidentally discovered this myself."
type: archive
source: twitter
source_url: "https://x.com/Mallchad/status/2084546183922426362"
author: "Mallchad 🏴󠁧󠁢󠁥󠁮󠁧󠁿"
handle: Mallchad
post_id: "2084546183922426362"
date: 2026-08-04
archived: 2026-08-25
draft: false
tags:
- archive
- twitter
- nicbarkeragain
description: "@nicbarkeragain I accidentally discovered this myself."
in_reply_to: ""
parent_post_id: "2084072929780998198"
---
## Source
- URL: https://x.com/Mallchad/status/2084546183922426362
- Author: Mallchad 🏴󠁧󠁢󠁥󠁮󠁧󠁿 (@Mallchad)
- Posted: 2026-08-04 07:45:13
## Branch
**1/** @Mallchad
@nicbarkeragain
I accidentally discovered this myself. It just makes everything so much easier, give every single thing a name and log errors instead of continuing silently.
log filtering is better than having no logs "cuz it's too noisy"
## Related
- Spine: [[archive/threads/nicbarkeragain/2026-08-03-imo-basically-every-object-creation-api-you-have]]
@@ -0,0 +1,39 @@
---
title: "@nicbarkeragain function \"draw string, for debug, in my game's 3d graphical space\""
type: archive
source: twitter
source_url: "https://x.com/Tomi_Tapio/status/2084605612764078535"
author: "TomiTapio"
handle: Tomi_Tapio
post_id: "2084605612764078535"
date: 2026-08-04
archived: 2026-08-25
draft: false
tags:
- archive
- twitter
- nicbarkeragain
description: "@nicbarkeragain function \"draw string, for debug, in my game's 3d graphical space\""
in_reply_to: ""
parent_post_id: "2084072929780998198"
---
## Source
- URL: https://x.com/Tomi_Tapio/status/2084605612764078535
- Author: TomiTapio (@Tomi_Tapio)
- Posted: 2026-08-04 11:41:22
## Branch
**1/** @Tomi_Tapio
@nicbarkeragain
function "draw string, for debug, in my game's 3d graphical space"
![](https://pbs.twimg.com/media/HO4BvWcXgAA3tWM?format=jpg&name=orig)
## Related
- Spine: [[archive/threads/nicbarkeragain/2026-08-03-imo-basically-every-object-creation-api-you-have]]
@@ -0,0 +1,37 @@
---
title: "@nicbarkeragain WebGPU has this and it’s a life saver for debugging"
type: archive
source: twitter
source_url: "https://x.com/codeshaunted/status/2084528811509719436"
author: "avery"
handle: codeshaunted
post_id: "2084528811509719436"
date: 2026-08-04
archived: 2026-08-25
draft: false
tags:
- archive
- twitter
- nicbarkeragain
description: "@nicbarkeragain WebGPU has this and it’s a life saver for debugging"
in_reply_to: ""
parent_post_id: "2084072929780998198"
---
## Source
- URL: https://x.com/codeshaunted/status/2084528811509719436
- Author: avery (@codeshaunted)
- Posted: 2026-08-04 06:36:11
## Branch
**1/** @codeshaunted
@nicbarkeragain
WebGPU has this and it’s a life saver for debugging
## Related
- Spine: [[archive/threads/nicbarkeragain/2026-08-03-imo-basically-every-object-creation-api-you-have]]
@@ -0,0 +1,37 @@
---
title: "@nicbarkeragain This just saved me from hours of debugging."
type: archive
source: twitter
source_url: "https://x.com/Drainyard/status/2086199401907638656"
author: "Niels Bross"
handle: Drainyard
post_id: "2086199401907638656"
date: 2026-08-08
archived: 2026-08-25
draft: false
tags:
- archive
- twitter
- nicbarkeragain
description: "@nicbarkeragain This just saved me from hours of debugging."
in_reply_to: ""
parent_post_id: "2084072929780998198"
---
## Source
- URL: https://x.com/Drainyard/status/2086199401907638656
- Author: Niels Bross (@Drainyard)
- Posted: 2026-08-08 21:14:31
## Branch
**1/** @Drainyard
@nicbarkeragain
This just saved me from hours of debugging.
## Related
- Spine: [[archive/threads/nicbarkeragain/2026-08-03-imo-basically-every-object-creation-api-you-have]]
@@ -0,0 +1,38 @@
---
title: "IMO basically every \"object creation API\" you have should take a string label that is for internal use only."
type: archive
source: twitter
source_url: "https://x.com/nicbarkeragain/status/2084072929780998198"
author: "Nic Barker"
handle: nicbarkeragain
post_id: "2084072929780998198"
date: 2026-08-03
archived: 2026-08-25
draft: false
tags:
- archive
- twitter
- nicbarkeragain
description: "IMO basically every \"object creation API\" you have should take a string label that is for internal use only."
in_reply_to: ""
---
## Source
- URL: https://x.com/nicbarkeragain/status/2084072929780998198
- Author: Nic Barker (@nicbarkeragain)
- Posted: 2026-08-03 00:24:41
## Thread
**1/** @nicbarkeragain
IMO basically every "object creation API" you have should take a string label that is for internal use only. You can ifdef them out in release, but it will save you so much grief when debugging. UI elements, mem allocations, input actions, just tag them all with a label / name.
Branches: [[archive/threads/nicbarkeragain/2026-08-03-imo-basically-every-object-creation-api-you-have/2026-08-03-exacoustics-iirc-sokol-gfx-does-this-its-really-nice-ive]], [[archive/threads/nicbarkeragain/2026-08-03-imo-basically-every-object-creation-api-you-have/2026-08-03-RealOtisCrune-isnt-this-just-a-python-style-docstring-with]], [[archive/threads/nicbarkeragain/2026-08-03-imo-basically-every-object-creation-api-you-have/2026-08-03-_can1357-https-learn-microsoft-com-en-us-windows-hardware]], [[archive/threads/nicbarkeragain/2026-08-03-imo-basically-every-object-creation-api-you-have/2026-08-03-petey_fo_really-ya-tagging-allocations-and-frames-to-actual]], [[archive/threads/nicbarkeragain/2026-08-03-imo-basically-every-object-creation-api-you-have/2026-08-03-joseph_h_garvin-when-ive-seen-this-they-usually-require-unique]], [[archive/threads/nicbarkeragain/2026-08-03-imo-basically-every-object-creation-api-you-have/2026-08-03-RazorSharpFang-i-dont-suppose-you-could-demonstrate-this-with-a]], [[archive/threads/nicbarkeragain/2026-08-03-imo-basically-every-object-creation-api-you-have/2026-08-03-BurnZeZ-i-do-and-access-it-via-9p]], [[archive/threads/nicbarkeragain/2026-08-03-imo-basically-every-object-creation-api-you-have/2026-08-03-DjMolehill-brb-adding-this-to-my-codebase]], [[archive/threads/nicbarkeragain/2026-08-03-imo-basically-every-object-creation-api-you-have/2026-08-03-onepopcorn-thats-actually-a-smart-idea-do-you-have-an]], [[archive/threads/nicbarkeragain/2026-08-03-imo-basically-every-object-creation-api-you-have/2026-08-03-Leonardo_Temp-you-can-also-implicitly-pass-the-source-code]], [[archive/threads/nicbarkeragain/2026-08-03-imo-basically-every-object-creation-api-you-have/2026-08-03-MikeyBally-this-is-the-way]], [[archive/threads/nicbarkeragain/2026-08-03-imo-basically-every-object-creation-api-you-have/2026-08-04-codeshaunted-webgpu-has-this-and-its-a-life-saver-for-debugging]], [[archive/threads/nicbarkeragain/2026-08-03-imo-basically-every-object-creation-api-you-have/2026-08-04-Mallchad-i-accidentally-discovered-this-myself-it-just]], [[archive/threads/nicbarkeragain/2026-08-03-imo-basically-every-object-creation-api-you-have/2026-08-04-Tomi_Tapio-function-draw-string-for-debug-in-my-games-3d]], [[archive/threads/nicbarkeragain/2026-08-03-imo-basically-every-object-creation-api-you-have/2026-08-08-Drainyard-this-just-saved-me-from-hours-of-debugging]]
**2/** @nicbarkeragain
There's seriously nothing like going from "we have this memory leak every frame and don't know where tf it is" to "I paused the debugger and inspected the list of allocations, and there are 10,000 of them all labelled 'FormattedUnitName', so I grepped it in 5 seconds"
Branches: [[archive/threads/nicbarkeragain/2026-08-03-imo-basically-every-object-creation-api-you-have/2026-08-03-borrowck_novel-can-you-post-an-example-of-how-you-would]]
@@ -0,0 +1,37 @@
---
title: "@nicbarkeragain Thanks a lot for the example"
type: archive
source: twitter
source_url: "https://x.com/borrowck_novel/status/2084886942253007066"
author: "borrowck-novel"
handle: borrowck_novel
post_id: "2084886942253007066"
date: 2026-08-05
archived: 2026-08-25
draft: false
tags:
- archive
- twitter
- nicbarkeragain
description: "@nicbarkeragain Thanks a lot for the example"
in_reply_to: ""
parent_post_id: "2084851804224004329"
---
## Source
- URL: https://x.com/borrowck_novel/status/2084886942253007066
- Author: borrowck-novel (@borrowck_novel)
- Posted: 2026-08-05 06:19:17
## Branch
**1/** @borrowck_novel
@nicbarkeragain
Thanks a lot for the example
## Related
- Spine: [[archive/threads/nicbarkeragain/2026-08-05-an-example-of-this-a-classic-way-to-construct-a]]
@@ -0,0 +1,37 @@
---
title: "@nicbarkeragain 1."
type: archive
source: twitter
source_url: "https://x.com/choco_dolphin7/status/2084879873491779719"
author: "chocolatedolphin7"
handle: choco_dolphin7
post_id: "2084879873491779719"
date: 2026-08-05
archived: 2026-08-25
draft: false
tags:
- archive
- twitter
- nicbarkeragain
description: "@nicbarkeragain 1."
in_reply_to: ""
parent_post_id: "2084851804224004329"
---
## Source
- URL: https://x.com/choco_dolphin7/status/2084879873491779719
- Author: chocolatedolphin7 (@choco_dolphin7)
- Posted: 2026-08-05 05:51:11
## Branch
**1/** @choco_dolphin7
@nicbarkeragain
1. Got into the habit of immediately writing free()/close()/etc before anything else 2. Leaks are not that common or scary 3. If it was malloc'd memory, clang catches it for me before I even review + commit it 4. Too much hassle and clutter assigning unique strings to everything
## Related
- Spine: [[archive/threads/nicbarkeragain/2026-08-05-an-example-of-this-a-classic-way-to-construct-a]]
@@ -0,0 +1,37 @@
---
title: "@nicbarkeragain Ah, matching strings, just like xml 🙃"
type: archive
source: twitter
source_url: "https://x.com/datgame/status/2084939273095073796"
author: "Niklas Lundberg"
handle: datgame
post_id: "2084939273095073796"
date: 2026-08-05
archived: 2026-08-25
draft: false
tags:
- archive
- twitter
- nicbarkeragain
description: "@nicbarkeragain Ah, matching strings, just like xml 🙃"
in_reply_to: ""
parent_post_id: "2084851804224004329"
---
## Source
- URL: https://x.com/datgame/status/2084939273095073796
- Author: Niklas Lundberg (@datgame)
- Posted: 2026-08-05 09:47:13
## Branch
**1/** @datgame
@nicbarkeragain
Ah, matching strings, just like xml 🙃
## Related
- Spine: [[archive/threads/nicbarkeragain/2026-08-05-an-example-of-this-a-classic-way-to-construct-a]]
@@ -0,0 +1,37 @@
---
title: "@nicbarkeragain DeferLoop is super useful for this"
type: archive
source: twitter
source_url: "https://x.com/eta9499/status/2085004503628071423"
author: "James (η)"
handle: eta9499
post_id: "2085004503628071423"
date: 2026-08-05
archived: 2026-08-25
draft: false
tags:
- archive
- twitter
- nicbarkeragain
description: "@nicbarkeragain DeferLoop is super useful for this"
in_reply_to: ""
parent_post_id: "2084851804224004329"
---
## Source
- URL: https://x.com/eta9499/status/2085004503628071423
- Author: James (η) (@eta9499)
- Posted: 2026-08-05 14:06:25
## Branch
**1/** @eta9499
@nicbarkeragain
DeferLoop is super useful for this
## Related
- Spine: [[archive/threads/nicbarkeragain/2026-08-05-an-example-of-this-a-classic-way-to-construct-a]]
@@ -0,0 +1,66 @@
---
title: "@nicbarkeragain this particular case though is easily solved with `defer` or even `closures`"
type: archive
source: twitter
source_url: "https://x.com/hasen_95dx/status/2084868526515634252"
author: "ハセン حسن"
handle: hasen_95dx
post_id: "2084868526515634252"
date: 2026-08-05
archived: 2026-08-25
draft: false
tags:
- archive
- twitter
- nicbarkeragain
description: "@nicbarkeragain this particular case though is easily solved with `defer` or even `closures`"
in_reply_to: ""
parent_post_id: "2084851804224004329"
---
## Source
- URL: https://x.com/hasen_95dx/status/2084868526515634252
- Author: ハセン حسن (@hasen_95dx)
- Posted: 2026-08-05 05:06:06
## Branch
**1/** @hasen_95dx
@nicbarkeragain
this particular case though is easily solved with `defer` or even `closures`
Container(...., func() {
// container is closed when this func exits
})
**2/** @nicbarkeragain
@hasen_95dx
Yes, I tend to use the "single iteration for loop" macro trick in C to do this exact thing with scope, but there are still a bunch of cases where you might want to have a direct API that you can use to call open / close:
![](https://pbs.twimg.com/media/HO73smTacAAYau2?format=jpg&name=orig)
**3/** @nicbarkeragain
@hasen_95dx
I've also found explicit open / close to be very useful in rendering tree views / arbitrary recursive hierarchy etc.
**4/** @hasen_95dx
@nicbarkeragain
Right. With the closure approach it would have to change.
body := func() { ... }
if condition { Container(...., body) }
else { body() }
## Related
- Spine: [[archive/threads/nicbarkeragain/2026-08-05-an-example-of-this-a-classic-way-to-construct-a]]
@@ -0,0 +1,37 @@
---
title: "I love everything about this."
type: archive
source: twitter
source_url: "https://x.com/lionkimbro10x/status/2084867619786785262"
author: "Lion 10x"
handle: lionkimbro10x
post_id: "2084867619786785262"
date: 2026-08-05
archived: 2026-08-25
draft: false
tags:
- archive
- twitter
- nicbarkeragain
description: "I love everything about this."
in_reply_to: ""
parent_post_id: "2084851804224004329"
---
## Source
- URL: https://x.com/lionkimbro10x/status/2084867619786785262
- Author: Lion 10x (@lionkimbro10x)
- Posted: 2026-08-05 05:02:30
## Branch
**1/** @lionkimbro10x
I love everything about this. And I agree, it's fine. We should do more health-checking within programs, and yes, it can be optimized out.
And if I may grind an axe -- I prefer this kind of voluntary, easy, and clarity-inducing health-check, to the kind of discipline & bondage "regulate EVERYTHING" approach to "safety."
## Related
- Spine: [[archive/threads/nicbarkeragain/2026-08-05-an-example-of-this-a-classic-way-to-construct-a]]
@@ -0,0 +1,37 @@
---
title: "@nicbarkeragain That's a great tip."
type: archive
source: twitter
source_url: "https://x.com/plasm_nl/status/2084924945960759547"
author: "PlasM"
handle: plasm_nl
post_id: "2084924945960759547"
date: 2026-08-05
archived: 2026-08-25
draft: false
tags:
- archive
- twitter
- nicbarkeragain
description: "@nicbarkeragain That's a great tip."
in_reply_to: ""
parent_post_id: "2084851804224004329"
---
## Source
- URL: https://x.com/plasm_nl/status/2084924945960759547
- Author: PlasM (@plasm_nl)
- Posted: 2026-08-05 08:50:17
## Branch
**1/** @plasm_nl
@nicbarkeragain
That's a great tip. I always used comments, but this is better.
## Related
- Spine: [[archive/threads/nicbarkeragain/2026-08-05-an-example-of-this-a-classic-way-to-construct-a]]
@@ -0,0 +1,37 @@
---
title: "@nicbarkeragain Or you could use C++ with RAII and not have to tie yourself in knots"
type: archive
source: twitter
source_url: "https://x.com/rep_movsd/status/2084983215874592848"
author: "boo_ghoul"
handle: rep_movsd
post_id: "2084983215874592848"
date: 2026-08-05
archived: 2026-08-25
draft: false
tags:
- archive
- twitter
- nicbarkeragain
description: "@nicbarkeragain Or you could use C++ with RAII and not have to tie yourself in knots"
in_reply_to: ""
parent_post_id: "2084851804224004329"
---
## Source
- URL: https://x.com/rep_movsd/status/2084983215874592848
- Author: boo_ghoul (@rep_movsd)
- Posted: 2026-08-05 12:41:50
## Branch
**1/** @rep_movsd
@nicbarkeragain
Or you could use C++ with RAII and not have to tie yourself in knots
## Related
- Spine: [[archive/threads/nicbarkeragain/2026-08-05-an-example-of-this-a-classic-way-to-construct-a]]
@@ -0,0 +1,37 @@
---
title: "@nicbarkeragain tangently, this example illustates pretty good why I like syntax with `end` keyword and optional name of closee better than just `{ ..."
type: archive
source: twitter
source_url: "https://x.com/windless_mill/status/2085033979053260826"
author: "μέα κούλπα"
handle: windless_mill
post_id: "2085033979053260826"
date: 2026-08-05
archived: 2026-08-25
draft: false
tags:
- archive
- twitter
- nicbarkeragain
description: "@nicbarkeragain tangently, this example illustates pretty good why I like syntax with `end` keyword and optional name of closee better than just `{ ..."
in_reply_to: ""
parent_post_id: "2084851804224004329"
---
## Source
- URL: https://x.com/windless_mill/status/2085033979053260826
- Author: μέα κούλπα (@windless_mill)
- Posted: 2026-08-05 16:03:33
## Branch
**1/** @windless_mill
@nicbarkeragain
tangently, this example illustates pretty good why I like syntax with `end` keyword and optional name of closee better than just `{ ... }` especially {} when they also used for structure literals -- finding unbalanced scopes becomes such a hassle sometimes
## Related
- Spine: [[archive/threads/nicbarkeragain/2026-08-05-an-example-of-this-a-classic-way-to-construct-a]]
@@ -0,0 +1,37 @@
---
title: "Rust's ownership + RAII makes such patterns really easy and nice to encode statically, no debug strings needed if the compiler guarantees you can't open another object at the same level if the previous one wasn't closed."
type: archive
source: twitter
source_url: "https://x.com/real_philogy/status/2085401818083824080"
author: "philogy"
handle: real_philogy
post_id: "2085401818083824080"
date: 2026-08-06
archived: 2026-08-25
draft: false
tags:
- archive
- twitter
- nicbarkeragain
description: "Rust's ownership + RAII makes such patterns really easy and nice to encode statically, no debug strings needed if the compiler guarantees you can't open another object at the same level if the previous one wasn't closed."
in_reply_to: ""
parent_post_id: "2084851804224004329"
---
## Source
- URL: https://x.com/real_philogy/status/2085401818083824080
- Author: philogy (@real_philogy)
- Posted: 2026-08-06 16:25:12
## Branch
**1/** @real_philogy
Rust's ownership + RAII makes such patterns really easy and nice to encode statically, no debug strings needed if the compiler guarantees you can't open another object at the same level if the previous one wasn't closed.
I'm sure something similar can be achieved in Zig/C++ with defer/RAII but not sure if it ends up being quite as nice
## Related
- Spine: [[archive/threads/nicbarkeragain/2026-08-05-an-example-of-this-a-classic-way-to-construct-a]]
@@ -0,0 +1,40 @@
---
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
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:
![](https://pbs.twimg.com/media/HO7hqaeacAAsCJQ?format=jpg&name=orig)
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
@nicbarkeragain
Stealing this idea
+13
View File
@@ -0,0 +1,13 @@
---
title: nicbarkeragain
type: note
draft: false
description: Archived threads by nicbarkeragain.
tags:
- archive
- twitter
- nicbarkeragain
---
- [[archive/threads/nicbarkeragain/2026-08-03-imo-basically-every-object-creation-api-you-have]]
- [[archive/threads/nicbarkeragain/2026-08-05-an-example-of-this-a-classic-way-to-construct-a]]