frontpage.
newsnewestaskshowjobs

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.

Nobody ever gets credit for fixing problems that never happened (2001) [pdf]

https://web.mit.edu/nelsonr/www/Repenning=Sterman_CMR_su01_.pdf
211•sam_bristow•3h ago•75 comments

Show HN: Homebrew 6.0.0

https://brew.sh/2026/06/11/homebrew-6.0.0/
1067•mikemcquaid•15h ago•245 comments

Claude Fable is relentlessly proactive

https://simonwillison.net/2026/Jun/11/fable-is-relentlessly-proactive/
220•lumpa•3h ago•174 comments

Show HN: FablePool – pool money behind a prompt, and Fable builds it in public

https://fablepool.com
311•matthewbarras•7h ago•174 comments

If you are asking for human attention, demonstrate human effort

https://tombedor.dev/human-attention-and-human-effort/
381•jjfoooo4•5h ago•121 comments

MiMo Code is now released and open-source

https://mimo.xiaomi.com/mimocode
446•apeters•14h ago•253 comments

Anthropic apologizes for invisible Claude Fable guardrails

https://www.theverge.com/ai-artificial-intelligence/948280/anthropic-claude-fable-invisible-disti...
352•rarisma•16h ago•350 comments

Petition to Withdraw Canada's Bill C-22

https://www.ourcommons.ca/petitions/en/Petition/Sign/e-7416
392•hmokiguess•12h ago•135 comments

A jacket that harvests drinking water from the air

https://news.utexas.edu/2026/06/11/this-jacket-pulls-drinking-water-from-thin-air/
65•ilreb•5h ago•43 comments

WikiLambda the Ultimate

https://en.wikipedia.org/wiki/Wikipedia:Wikipedia_Signpost/2026-05-22/Recent_research
11•Antibabelic•11h ago•2 comments

Ear Training Practice

https://tonedear.com/
187•mattbit•3d ago•92 comments

Software is made between commits

https://zed.dev/blog/introducing-deltadb
228•jeremy_k•12h ago•167 comments

macOS 27 Beta breaks the ability to boot Asahi Linux

https://www.phoronix.com/news/macOS-27-Beta-Breaks-Asahi
266•josephcsible•2d ago•114 comments

Emacs appearances in pop culture

https://ianyepan.github.io/posts/emacs-in-pop-culture/
284•ggcr•1d ago•81 comments

The RCE that AMD wouldn't fix

https://mrbruh.com/amd2/
243•MrBruh•12h ago•106 comments

Lines of code got a better publicist

https://curlewis.co.nz/posts/lines-of-code-got-a-better-publicist/
375•RyeCombinator•16h ago•257 comments

Claude Fable 5: mid-tier results on coding tasks

https://www.endorlabs.com/learn/claude-fable-5-mythos-grade-hype
263•bugvader•12h ago•117 comments

How we made hit video game Prince of Persia

https://www.theguardian.com/culture/2026/jan/05/raiders-of-the-lost-ark-hit-video-game-prince-of-...
9•msephton•2d ago•0 comments

Developer gets Half-Life running at 30 FPS on a Nokia N95

https://www.tomshardware.com/video-games/handheld-gaming/developer-gets-half-life-running-at-30-f...
236•ljf•3d ago•76 comments

Reading for pleasure is sharply down among schoolkids, report shows

https://www.nbcnews.com/data-graphics/kids-reading-less-lower-levels-department-education-study-r...
108•freejoe76•1d ago•132 comments

How a new DSL may survive in the era of LLMs

https://www.williamcotton.com/articles/how-a-new-dsl-survives-in-the-era-of-llms
28•williamcotton•13h ago•9 comments

Waymo Premier

https://waymo.com/blog/2026/06/waymo-premier/
170•boulos•12h ago•420 comments

Removing 'um' from a recording is harder than it sounds

https://doug.sh/posts/erm-a-local-cli-that-strips-ums-uhs-and-erms-from-speech/
31•dougcalobrisi•3h ago•11 comments

Show HN: Boo – Screen-style terminal multiplexer built on libghostty

https://github.com/coder/boo
61•kylecarbs•7h ago•20 comments

Faking keyword arguments to functions in C++

https://nibblestew.blogspot.com/2026/06/faking-keyword-arguments-to-functions.html
18•ibobev•2d ago•13 comments

Making a vintage LLM from scratch

https://crlf.link/log/entries/260525-1/
33•croqaz•19h ago•5 comments

A greyscale iPhone setup that works in everyday life

https://www.fabianhemmert.com/opinions/a-greyscale-iphone-setup-that-works-in-everyday-life
79•hemmert•21h ago•48 comments

FPS.cob: A first person shooter in COBOL

https://github.com/icitry/FPS.cob
110•MBCook•13h ago•63 comments

Apple didn't revolutionize power supplies; new transistors did (2012)

https://www.righto.com/2012/02/apple-didnt-revolutionize-power.html
103•geerlingguy•10h ago•9 comments

Open Reproduction of DeepSeek-R1

https://github.com/huggingface/open-r1
211•yogthos•15h ago•17 comments