frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Throwaway Code: Don't recycle, throw it away (2017)

https://www.sung.codes/blog/2017/throwaway-code-dont-recycle-throw-away
26•sails•1y ago

Comments

RedShift1•1y ago
It'll be a cold day in hell before I start throwing away my 80+ "New" notepad++ tabs.
notTooFarGone•1y ago
i feel called out.

I had to manage my 350 notepad++ new tabs as I migrated to a new PC - it was not pretty.

mehulashah•1y ago
There’s something beautiful about not being riddled with previous artifacts and starting clean with how you imagine you want to build your system. If the system is large enough, you can’t do it that often.
gherkinnn•1y ago
It is a mistake to believe that the code written is the only valuable artefact.

What you've learned along the way is so much more important.

eternityforest•1y ago
I usually find most of the learning happens a year later when I see if my approach is maintainable and handles new requirements.

When I'm actually coding, I'm usually not learning as much, because I'm generally intentionally choosing boring tech everyone already knows.

Most of the learning is less about deeply internalizing concepts and more about things like new features in the Python stdlib.

gitroom•1y ago
Ive got a million messy files saved up, honestly, even when I know just letting go could help me think clearer. Ever wonder if holding onto old stuff slows you down or actually helps you get smarter over time?
1dom•1y ago
I don't think the author is necessarily advocating the throwing away of code here, they're advocating the value of being able to rapidly prototype and move on from seemingly incomplete things.

The whole value proposition of the digital world is that we can store and manipulate it for virtually nothing: there isn't the same cost to having digital stuff, and so there isn't the same gains from throwing it away IMO.

athrowaway3z•1y ago
Create a ~/Archive and throw it in there.

A quick grep every blue moon can be faster than wrangling a LLM into place, and as an added bonus you can look back and laugh at how big of an idiot you were.

klabb3•1y ago
In my experience, if you have a medium sized task with multiple unknowns, it is best to prototype aggressively without a thought about quality, and then start a second iteration with quality in mind. The purpose of the prototyping is learning.

It’s faster (yes) than prototype-then-fixup. Why? Because the ”live refactor” is harder than the greenfield writing phase. The new knowledge often makes the impl straightforward.

It’s also better quality than design-then-build. The optimal architecture and modularization change with knowledge increase, which is best to get via experience. You can design fully upfront but it’s riddled with analysis paralysis - it’s notoriously hard (and slow) to predict unknowns.

Sounds like good advice? Well, the hardest part isn’t to follow it – it’s to know upfront what size of task it is. If it turns out to be easier, you waste a bit of work (prototype-fixup is faster). However, if it’s bigger than you thought – you’re in the best possible position to break down the new problem into subtasks, with no wasted work.

perrygeo•1y ago
If you could package this up in a motivational poster, it belongs in every company meeting room. Speed and quality are not two opposing forces to tradeoff. We can have both.

But we need to get rid of this silly, infantile, unwavering attachment to our source code files. Throw code away. All. the. time. The first version of code is, by definition, being built in the absence of critical information. Why on earth would we get so attached to that which was built in ignorance? In this case we're not "reusing code", we're throwing away knowledge!

Why would you discard everything valuable you learned in favor of a code artifact written before you learned it? Throw away the code instead! Surely the code written AFTER gaining the knoweldge will be both faster and better quality. (and more clear, less tech debt, etc)

dsabanin•1y ago
Very well said. This is such an important point.

I believe that if you truly accept what Hemingway said, that writing is rewriting, you get less attached to the idea of reaching the best design on the first try, and feel better when starting with a suboptimal solution.

Of course this sometimes conflicts with organizational pressures, where that quick and dirty solution may be deemed as enough by some and you won't get to finish with the proper design. For me the trick is to consider first version just an internal stage of work on a feature, not even communicated outwards most of the times, until the appropriate design is reached.

cadamsdotcom•1y ago
We need better words for the different code written for different purposes.

Code written to learn and explore a problem space? Sure.

Code written in response to a prompt, which could easily be rewritten - things like a throwaway “please tell me a story about the contents of this CSV for me and also write code to graph it”. Yep throw it away.

Or keep it as an example for a later model.

That’s very different to code written to high standards intended for others’ use.

We need different words for all of those 3 varieties of code.

The 29th International Obfuscated C Code Contest (IOCCC) 2025 Winners

https://www.ioccc.org/2025/
222•matt_d•6h ago•54 comments

Win16 Memory Management

http://www.os2museum.com/wp/win16-memory-management/
52•supermatou•2d ago•15 comments

Speculative KV coding: losslessly compressing KV cache by up to ~4×

https://fergusfinn.com/blog/kv-entropy-coder/
67•kkm•2d ago•11 comments

Scientists ejected from diabetes conference for distributing journal reprints

https://arstechnica.com/science/2026/06/scientists-ejected-from-diabetes-conference-for-distribut...
128•BerislavLopac•2h ago•43 comments

Valve P2P networking broken for more than 2 months

https://github.com/ValveSoftware/GameNetworkingSockets/issues/398
202•babuskov•8h ago•88 comments

My Software North Star

https://kristoff.it/blog/north-star/
110•kristoff_it•3d ago•54 comments

9 Mothers (YC P26) Is Hiring

https://9mothers.com/careers
1•ukd1•19m ago

Field of clones: How horse replicas came to dominate polo

https://knowablemagazine.org/content/article/technology/2026/cloned-polo-horses
104•gscott•9h ago•46 comments

Tokenomics: Quantifying Where Tokens Are Used in Agentic Software Engineering

https://arxiv.org/abs/2601.14470
118•Anon84•10h ago•48 comments

The Secret Life of Circuits with lcamtuf / Michał Zalewski (Audio Interview)

https://theamphour.com/725-the-secret-life-of-circuits-with-lcamtuf-michal-zalewski/
7•ChrisGammell•2d ago•2 comments

Ntsc-rs – open-source video emulation of analog TV and VHS artifacts

https://ntsc.rs/
361•gregsadetsky•17h ago•99 comments

Public Domain Image Archive

https://pdimagearchive.org/
149•davidbarker•11h ago•22 comments

Symbolica 2.0: Programmable Symbols for Python and Rust

https://symbolica.io/posts/symbolica_2_0_release/
97•mmastrac•1d ago•8 comments

Harness engineering: Leveraging Codex in an agent-first world

https://openai.com/index/harness-engineering/
224•pramodbiligiri•1d ago•143 comments

Biohub releases a world model of protein biology

https://biohub.org/news/world-model-of-protein-biology/
96•gmays•3d ago•11 comments

How Liminalism Became the Defining Aesthetic of Our Time

https://hyperallergic.com/how-liminalism-became-the-defining-aesthetic-of-our-time/
84•zeech•10h ago•45 comments

Efficient and Training-Free Single-Image Diffusion Models

https://arxiv.org/abs/2606.04299
11•yorwba•2h ago•0 comments

Moving beyond fork() + exec()

https://lwn.net/SubscriberLink/1076018/16f01bbbb8e0d1f0/
316•jwilk•21h ago•299 comments

Introducing Boron Buckyballs: Theory that B80 cages can’t be made is disproved

https://cen.acs.org/materials/nanomaterials/buckyballs-boron-buckminster-fullerene-nanomaterials/...
92•crescit_eundo•2d ago•23 comments

Nvidia is proposing a beast of a CPU system for Windows PCs

https://twitter.com/lemire/status/2062880075117113739
299•tosh•23h ago•489 comments

I design with Claude more than Figma now

https://blog.janestreet.com/i-design-with-claude-code-more-than-figma-now-index/
190•MrBuddyCasino•7h ago•164 comments

Games Between Programs: The Ruliology of Competition

https://writings.stephenwolfram.com/2026/06/games-between-programs-the-ruliology-of-competition/
14•surprisetalk•2d ago•1 comments

Arithmetic Without Numbers – How LLMs Do Math

https://alvaro-videla.com/llm-arithmetic-internals/article_interactive/article.html
38•old_sound•2d ago•11 comments

Google to pay SpaceX $920M a month for compute capacity at xAI data centers

https://www.cnbc.com/2026/06/05/google-to-pay-spacex-920-million-a-month-for-xai-compute-capacity...
263•toephu2•1d ago•851 comments

Zeroserve: A zero-config web server you can script with eBPF

https://su3.io/posts/introducing-zeroserve
245•losfair•21h ago•56 comments

Meta confirms 1000s of Instagram accounts were hacked by abusing its AI chatbot

https://this.weekinsecurity.com/meta-confirms-thousands-of-instagram-accounts-were-hacked-by-abus...
624•speckx•17h ago•228 comments

Sem: New primitive for code understanding – not LSPs, but entities on top of Git

https://ataraxy-labs.github.io/sem/
132•rohanucla•16h ago•49 comments

Firefox confirms working on own adblocker [video]

https://www.youtube.com/watch?v=Qd5_5hXa8Zc
4•HelloUsername•33m ago•1 comments

Ask HN: What was your "oh shit" moment with GenAI?

642•andrehacker•2d ago•1026 comments

Motorola effectively bricked its entire line of WiFi routers without explanation

https://mashable.com/tech/motorola-wifi-routers-stop-working-motosync-plus-app-down
171•thisislife2•21h ago•89 comments