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.

ZCode: Claude Code from the Makers of GLM

https://zcode.z.ai/cn
158•handfuloflight•1h ago•58 comments

For first time, a cell built from scratch grows and divides

https://www.quantamagazine.org/for-the-first-time-a-cell-built-from-scratch-grows-and-divides-202...
575•defrost•6h ago•197 comments

What to Learn to Be a Graphics Programmer

https://blog.demofox.org/2026/07/01/what-to-learn-to-be-a-graphics-programmer/
125•atan2•2h ago•50 comments

FFmpeg 9.1's new AAC encoder

https://hydrogenaudio.org/index.php/topic,129691.0.html
163•ledoge•6h ago•61 comments

Physical disc production ending in Jan 2028 for new games on PlayStation

https://blog.playstation.com/2026/07/01/physical-disc-production-ending-in-january-2028-for-new-g...
421•Tiberium•8h ago•492 comments

Claude Fable 5 Promotional Access

https://support.claude.com/en/articles/15424964-claude-fable-5-promotional-access
62•zbikowski•1h ago•29 comments

Box3D, an open source 3D physics engine

https://box2d.org/posts/2026/06/announcing-box3d/
333•makepanic•8h ago•73 comments

How We Made IPFS Content Publishing 10x Faster

https://probelab.io/blog/optimistic-provide/
112•dennis-tra•5h ago•32 comments

Internal Combustion Engine

https://ciechanow.ski/internal-combustion-engine/
213•StefanBatory•7h ago•46 comments

Monetization Gateway

https://blog.cloudflare.com/monetization-gateway/
190•soheilpro•6h ago•103 comments

Ask HN: Who is hiring? (July 2026)

109•whoishiring•5h ago•125 comments

Fable 5 Is Back

https://twitter.com/claudeai/status/2072402636813607381
144•mfiguiere•1h ago•96 comments

Show HN: Z-Jail – A 130 KB Linux sandbox-C99 with 7 defense layers and zero deps

https://github.com/Division-36/Z-Jail/
11•Zierax•1h ago•6 comments

Mortality associated with non-optimal ambient temperatures from 2000 to 2019

https://www.researchgate.net/publication/353058947_Global_regional_and_national_burden_of_mortali...
26•simonebrunozzi•3h ago•0 comments

Hanami 3.0: In Full Bloom

https://hanakai.org/blog/2026/06/30/hanami-3-0-in-full-bloom
39•PuercoPop•2h ago•7 comments

Ask HN: Who wants to be hired? (July 2026)

82•whoishiring•5h ago•181 comments

1-Bit Pixel Art Emojis

https://hypertalking.com/2023/05/15/1-bit-pixel-art-emojis/
107•surprisetalk•6d ago•16 comments

A complete ClickHouse OLAP engine, compiled to WebAssembly

https://wasm.chdb.io/
30•porridgeraisin•3h ago•3 comments

Building Gin: Simple over Easy

https://manualmeida.dev/articles/gin-simple-over-easy/
49•manucorporat•2h ago•14 comments

Generating Images with a 2025 Android

https://www.duration.ai/blog/generating-images-with-a-2025-android
5•sudb•1d ago•0 comments

Manufact (YC S25) Is Hiring a Developer Advocate in SF

https://www.ycombinator.com/companies/manufact/jobs/4cyWd6S-developer-advocate-partnerships-devrel
1•luigipederzani•7h ago

Sony Deletes 551 Movies PlayStation Owners Paid For

https://reclaimthenet.org/sony-deletes-551-studiocanal-movies-playstation-owners-paid-for
375•bilsbie•6h ago•178 comments

Launch HN: Parsewise (YC P25) – Reason Across Documents with an API

39•gergelycsegzi•6h ago•36 comments

Fixing a kubelet memory leak in Kubernetes 1.36

https://heyoncall.com/blog/fixing-kubernetes-kubelet-memory-leak
58•compumike•18h ago•12 comments

Reduce GVisor Cold Starts with GPU Snapshotting

https://cerebrium.ai/blog/reducing-gpu-cold-starts-with-memory-snapshots-restoring-cuda-workloads...
41•jono_irwin•4h ago•15 comments

Apple 'Hide My Email' vulnerability reveals peoples' real email addresses

https://easyoptouts.com/guides/apple-hide-my-email-is-leaking-email-addresses
200•sashk•10h ago•44 comments

Asahi Linux 7.1 Progress Report

https://asahilinux.org/2026/06/progress-report-7-1/
496•pantalaimon•10h ago•181 comments

Show HN: QR code renderer in a TrueType font

https://qr.jim.sh/
59•foodevl•3d ago•11 comments

Newly discovered spider builds spring loaded snare to catch ants

https://phys.org/news/2026-06-newly-australian-ballista-spider-snare.html
230•chimpanzee•3d ago•58 comments

Most rewrites serve the engineer, not the business

https://anatoliybabushka.com/blog/when-to-rewrite-working-code.html
8•bbsnly•2h ago•6 comments