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.

ElevenLabs, TwelveLabs, ThirteenLabs

https://quantumi.sh/public/labs.html
99•jemoka•2h ago•38 comments

A Kantian Critique of "Sorry" by Justin Bieber

https://decodingvibes.com/blog/a-kantian-critique-of-sorry-by-justin-bieber/
160•altmanaltman•4h ago•73 comments

A Friendly Introduction to Racket

https://geometridae.bearblog.dev/a-friendly-introduction-to-racket/
54•signa11•3h ago•12 comments

The New MCP Roadmap

https://blog.modelcontextprotocol.io/posts/mcp-roadmap/
118•pentagrama•4h ago•93 comments

Munder Difflin – Agent harness to run an office of your clones

https://munderdiffl.in/
189•simonpure•7h ago•78 comments

Z80 – The 1970s Microprocessor Still Alive (2021)

https://www.computer.org/csdl/magazine/mi/2021/06/09623402/1yJTvlRLmhi
86•asdefghyk•7h ago•38 comments

Anthropic appears to be A/B testing reduced effort levels in Claude Code

https://twitter.com/argofowl/status/2091150597374537729
23•matthieu_bl•46m ago•9 comments

Belgian car salesman becomes prince after DNA test proves royal parentage

https://www.cnn.com/2026/08/22/europe/prince-belgium-secret-son-scli-intl
19•MilnerRoute•35m ago•6 comments

Show HN: Rotation via Double Reflection

https://static.laszlokorte.de/rotor-reflect/
33•laszlokorte•1d ago•7 comments

Learning about "The Unix Time-Sharing System"

https://playtechnique.io/long/the-unix-time-sharing-system.html
6•gwynforthewyn•1h ago•2 comments

Rust Glancer: Rust LSP using 100x less RAM

https://rust-glancer.github.io/blog/hello-world/
365•matklad•21h ago•76 comments

Felony Bench

https://www.felonybench.com/
801•colinprince•1d ago•319 comments

Kobo can run apps now

https://bandarlabs.github.io/Cobalt/
628•thepoet•1d ago•200 comments

Felony charges for citizen deleting phone data at US Border

https://www.nytimes.com/2026/08/21/us/politics/samuel-tunick-deleted-phone-felony.html
987•floathub•1d ago•1214 comments

Stop Making TUIs

https://sockpuppet.org/blog/2026/08/20/stop-making-tuis/
335•underdeserver•1d ago•431 comments

Hook, hold, harvest and hide: Meta's alleged strategy laid out in first week

https://www.theguardian.com/technology/2026/aug/22/meta-trial-children-privacy
166•sbulaev•5h ago•125 comments

I accidentally logged hundreds of thousands of phone calls to military bases

https://lina.sh/blog/hijacking-e164-arpa
633•gavide•1d ago•81 comments

Kagi added a setting for removing paywalled links from search results

https://kagi.com/changelog#11296
1208•speckx•1d ago•377 comments

There's no reason for software to be slow anymore

https://danluu.com/perf-opt/
585•Jach•16h ago•427 comments

Zig’s Io.Threaded is neat

https://matklad.github.io/2026/08/06/neat-io-threaded.html
132•chilipepperhott•1d ago•75 comments

Anthropic IPO filing will show AI backlash as a risk factor, sources say

https://www.cnbc.com/2026/08/21/-anthropic-ipo-filing-will-show-ai-backlash-as-risk-sources-say.html
30•newsomix9xl•1h ago•40 comments

Scientists release biggest 2D map of the universe

https://newscenter.lbl.gov/2026/08/10/scientists-release-biggest-2d-map-of-the-universe/
241•NKosmatos•23h ago•65 comments

OTel isn’t going well

https://matduggan.com/otel-isnt-going-well-and-i-made-a-spreadsheet-about-it/
195•hn_acker•23h ago•97 comments

Embedded AI

https://nostarch.com/embedded-ai
28•0x54MUR41•8h ago•9 comments

How Thailand Resisted Colonization

https://worksinprogress.co/issue/how-thailand-resisted-colonization/
102•karakoram•23h ago•35 comments

AI boosted homework scores, then exam scores dropped: study

https://www.economist.com/graphic-detail/2026/08/18/does-ai-stop-children-from-learning
361•dash2•3d ago•360 comments

Claudette: Make Claude stop talking like a BuzzFeed article

https://github.com/adnanakil/nobuzz/blob/main/README.md
335•aakil•1d ago•218 comments

I'm becoming AI-blind

https://cymerys.com/w/im-becoming-ai-blind
460•rcymerys•1d ago•468 comments

Early-life stress leaves a 'scar' inside brain cells in mice

https://medicine.washu.edu/news/how-early-life-stress-leaves-a-scar-inside-brain-cells/
132•gmays•1d ago•63 comments

People of ACM – Russ Cox

https://www.acm.org/articles/people-of-acm/2026/russ-cox
162•signa11•5d ago•20 comments