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.

One Year of Sponsored Servo Development

https://servo.org/blog/2026/09/15/one-year-of-sponsorship/
66•AshleysBrain•1h ago•28 comments

I didn't sign the Fields medallists' letter

https://gowers.wordpress.com/2026/09/17/why-i-didnt-sign-the-fields-medallists-letter/
22•simianwords•1h ago•34 comments

Nvidia announces native GPU programming in Rust

https://developer.nvidia.com/blog/introducing-cuda-rust-two-tracks-for-writing-gpu-kernels/
691•nonmaskable•22h ago•271 comments

GLM Built Its Own Inference Infrastructure

https://z.ai/blog/glm-built-its-inference-infrastructure
25•whiteros_e•1h ago•0 comments

Keys Not Included: recovering the signing keys for US driver's license barcodes

https://ryan.science/blog/keys-not-included
169•Ryan5453•7h ago•64 comments

The Relation Between Mathematics and Physics by Paul Dirac

https://www.damtp.cam.ac.uk/events/strings02/dirac/speach.html
47•rramadass•3d ago•13 comments

My temporary PHP fix from 2014 has nearly 20M installs. Today I'm deprecating it

https://jakeasmith.com/blog/http-build-url/
105•jakeasmith•1d ago•18 comments

Training a 4B model to produce 81% faster query plans than Postgres

https://rohanbansal.com/qorl
553•polyphilz•15h ago•118 comments

Lucasart's Afterlife

https://togameforlife.wordpress.com/2023/12/09/on-lucasarts-afterlife/
19•Bondi_Blue•1d ago•11 comments

Xiaomi Mimo 2.6 live post-training dashboard

https://mimo.xiaomi.com/rl/
436•krackers•13h ago•113 comments

Comparison of Malloc() Algorithms

https://egbert.net/blog/articles/comparison-of-arena-architecture-in-malloc.html
74•egberts1•1d ago•10 comments

Cloudflare/Security-Audit-Skill

https://github.com/cloudflare/security-audit-skill
60•donk8r•5h ago•12 comments

Backups Aren't Simple

https://filipovski.net/2026/09/16/backups-arent-simple.html
238•afilipovski•13h ago•143 comments

Small programming tricks

https://will-keleher.com/posts/small-programming-tricks-matter/
522•signa11•18h ago•236 comments

Developing provably correct Rust code with Verus

https://www.amazon.science/blog/developing-provably-correct-rust-code-with-verus
114•Betelbuddy•2d ago•18 comments

Breaking the 1.58-bit Barrier for Ternary LLMs

https://arxiv.org/abs/2609.16338
205•matt_d•13h ago•32 comments

OpenAI Model Misalignment Report

https://openai.com/index/model-misalignment-reporting-framework/
14•qprofyeh•2h ago•0 comments

A 32-year-old bug walks into a Telnet server

https://labs.watchtowr.com/a-32-year-old-bug-walks-into-a-telnet-server-gnu-inetutils-telnetd-cve...
60•paimapi•1d ago•26 comments

The engineering behind the US Strategic Petroleum Reserve

https://johnjwang.com/post/2026/09/15/engineering-behind-us-strategic-petroleum-reserve
204•johnjwang•1d ago•78 comments

Back to the future: modules for Guix packages (2022)

https://hpc.guix.info/blog/2022/05/back-to-the-future-modules-for-guix-packages/
5•bmacho•1d ago•0 comments

The Return of Sail Power: Cargo Ships Are Turning Back to the Wind

https://gcaptain.com/the-return-of-sail-power-cargo-ships-are-turning-back-to-the-wind/
94•gumby•9h ago•56 comments

Show HN: An e-ink frame that hears birds and draws them as 1800s illustrations

https://github.com/arnegiacomo/fugleramme
2163•arnemunthekaas•1d ago•243 comments

AI Safety Is Mostly a Sex Cult

https://skywriter.blue/@segyges.bsky.social/3mvom4b4dn22q
80•Tomte•1h ago•28 comments

HarnessTax: How Much Does the Harness Matter for Coding Agents?

https://harnesstax.github.io/
127•matt_d•11h ago•53 comments

PCB is brought to you by Fable 5

https://a6mzero.com/posts/this-pcb-is-brought-to-you-by-fable-5/
108•jasonpeacock•2d ago•51 comments

OpenSpec – A lightweight and configurable AI spec framework

https://openspec.dev/
139•etoxin•10h ago•61 comments

AWS says it can't restore some data from mideast facilities struck by Iran

https://www.wsj.com/world/middle-east/aws-says-it-cant-restore-some-data-from-mideast-facilities-...
404•berkeleyjunk•1d ago•341 comments

US interest rates raised for first time in three years

https://www.bbc.com/news/articles/cw4gmlyvj422o
70•higginsniggins•10h ago•55 comments

Performance Improvements in .NET 11

https://devblogs.microsoft.com/dotnet/performance-improvements-in-net-11/
292•soheilpro•1d ago•61 comments

Japan's book scene is moving from bookstores to libraries

https://untranslatedjp.substack.com/p/japans-book-scene-is-quietly-moving
190•herbertl•4d ago•79 comments