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.

Parley: Federated, decentralised chat that speaks plain IRC

https://git.mills.io/prologic/parley
210•davidcollantes•5h ago•103 comments

What Heraldry and Mon Can Teach Us About Building Visual-Identity Generators

https://benovermyer.com/blog/2026/09/japanese-vs-western-heraldry/
16•bovermyer•1h ago•4 comments

Coding Is Not Solved

https://blog.alexewerlof.com/p/coding-is-not-solved
220•firstSpeaker•2h ago•210 comments

Kids turned low-traffic NPR Spotify comments into a secret group chat

https://www.thisamericanlife.org/897/transcript
32•simonpure•32m ago•8 comments

Nvidia wants to put a watchdog chip next to every AI agent

https://madrobot.blog/2026/09/28/nvidia-open-agent-safety-platform-openshell-sentry-rogue-ai-agents/
8•jonbaer•21m ago•9 comments

37,500 border drawings: a map of the world as people remember it

https://www.habibicode.org/thedrawnworld
115•nicocarsui•7h ago•28 comments

Show HN: PaperMono, e-ink fridge magnet shopping list with mobile web page

https://github.com/seamusc/papermono-shopping-list
62•seamus_c•5h ago•20 comments

Footguns with Postgres "at time zone 'UTC'"

https://bookofrevenue.com/blog/6ab81e9a97a13f0001f7e4e1/postgres-at-time-zone-u-does-not-do-what-...
116•birdculture•1d ago•59 comments

Owed a billion dollars in Nvidia stock

https://colo.to/nvidia-stock-narrative.html
948•Eric_Gullichsen•14h ago•401 comments

Ember-1

https://fireworks.ai/blog/ember-1
551•gmays•22h ago•237 comments

When did Google get so weird?

https://sancho.bearblog.dev/google-weird/
1605•sancho-panza•19h ago•862 comments

Nissan's third generation e-POWER powertrain

https://www.nissan-global.com/EN/INNOVATION/TECHNOLOGY/ARCHIVE/E_POWER_GEN3/
129•mroche•13h ago•281 comments

Show HN: Hntui – A TUI for Hacker News

https://github.com/ahmd-sh/hntui
87•ahmd-sh•3h ago•41 comments

Show HN: Free alternative to graphics design giants

https://scissor.studio/
35•sia_xi•7h ago•9 comments

What Would a Serious AI Product Look Like?

https://blog.glyph.im/2026/09/serious-ai-product.html
14•lumpa•5h ago•1 comments

Thinking fast and slow in AI: The role of metacognition (2021)

https://arxiv.org/abs/2110.01834
150•teleforce•12h ago•60 comments

Self-Hosting on the Dark Web

https://david.alvarezrosa.com/posts/self-hosting-on-the-dark-web/
305•mooreds•20h ago•101 comments

Malleable software: Restoring user agency in a world of locked-down apps (2025)

https://www.inkandswitch.com/essay/malleable-software/
137•evakhoury•21h ago•68 comments

Alan Kay's answer to “Did the ENIAC have a BIOS”?

https://www.quora.com/Did-the-ENIAC-have-a-BIOS/answer/Alan-Kay-11
168•midnightfish•20h ago•56 comments

Guitar amp and effects pedal built on the Waveshare ESP32-S3-Touch-AMOLED-2.06

https://github.com/dashersw/coyopedal
134•arbayi•2d ago•69 comments

I Switched to Brave Browser

https://kevquirk.com/i-switched-to-brave-browser
23•mindracer•1h ago•23 comments

Functional Mechanical Sympathy [video]

https://www.youtube.com/watch?v=jSHmDnUZCm8
57•surprisetalk•2d ago•11 comments

MongoDB CEO resigns "effective immediately" to join Meta, stock drops 20%

https://www.reuters.com/technology/mongodb-ceo-desai-steps-down-lead-metas-enterprise-platform-20...
68•diek•1h ago•71 comments

Don't couple your Go code to GitHub

https://iain.rocks/blog/dont-couple-your-go-code-to-github
302•birdculture•23h ago•158 comments

Lunar Terminator Paradox

https://notes.secretsauce.net/notes/2026/09/27_lunar-terminator-paradox.html
94•dima55•19h ago•64 comments

Made by Mechanical Means

https://felixrieseberg.com/made-by-mechanical-means/
61•cocoflunchy•9h ago•23 comments

The state of SIMD in Rust in 2026

https://shnatsel.github.io/state-of-simd-rust-2026/
190•verdagon•3d ago•47 comments

In an $80 motel room, a discovery to shed light on the origins of life

https://www.nytimes.com/2026/09/26/science/motel-science-discovery.html
283•danso•1d ago•108 comments

Reading’s Bayeux Tapestry

https://diamondgeezer.blogspot.com/2026/09/readings-bayeux-tapestry.html
73•zeristor•2d ago•27 comments

Replacing the old battery on rechargeable bike lights

https://jvns.ca/blog/2026/09/27/replacing-the-old-battery-on-rechargeable-bike-lights/
201•surprisetalk•1d ago•114 comments