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.

Anonymous GitHub account mass-dropping undisclosed 0-days

https://github.com/bikini/exploitarium
378•binyu•4h ago•156 comments

OpenRA

https://www.openra.net/
394•tosh•6h ago•76 comments

AI Is Designing Radio Chips That Humans Couldn't Even Imagine

https://spectrum.ieee.org/ai-radio-chip-design
70•Brajeshwar•3d ago•31 comments

DSpark: Speculative decoding accelerates LLM inference [pdf]

https://github.com/deepseek-ai/DeepSpec/blob/main/DSpark_paper.pdf
670•aurenvale•9h ago•267 comments

Suspicious Discontinuities (2020)

https://danluu.com/discontinuities/
138•tosh•5h ago•39 comments

Fintech Engineering Handbook

https://w.pitula.me/fintech-engineering-handbook/
361•signa11•8h ago•115 comments

Post-Mythos Cybersecurity: Keep calm and carry on

https://cephalosec.com/blog/cybersecurity-in-the-post-mythos-era-keep-calm-and-carry-on/
83•Versipelle•4h ago•27 comments

Turn your site into a place people can bump into each other

https://cauenapier.com/blog/townsquare_release/
21•eustoria•1h ago•7 comments

Zuckerberg's Increasingly Bizarre War on Whistleblowers

https://pluralistic.net/2026/06/27/zuckerstreisand-2/
401•HotGarbage•4h ago•154 comments

Supabase (YC S20) Is Hiring for Multigres

https://jobs.ashbyhq.com/supabase/2e718684-4f75-4a99-8d6b-3b6bd44e4228
1•awalias•2h ago

One man, two kernels, and a lot of RISC-V

https://www.theregister.com/software/2026/06/26/one-man-two-kernels-and-a-lot-of-risc-v/5262858
48•LorenDB•1d ago•4 comments

If you can't hold it, you don't own it

https://dervis.de/physical/
255•cemdervis•7h ago•168 comments

Previewing GPT‑5.6 Sol: a next-generation model

https://openai.com/index/previewing-gpt-5-6-sol/
1091•minimaxir•1d ago•695 comments

Reducing tick density along recreational trails in Ottawa, Canada

https://www.sciencedirect.com/science/article/pii/S1877959X26000476
74•bushwart•3d ago•38 comments

A History of Menus Is a Menu of History

https://pudding.cool/2026/06/menu-story/
6•surprisetalk•2d ago•1 comments

Long Wave radio era set to end with switch-off

https://www.economist.com/britain/2026/06/25/the-bbc-switches-off-its-oldest-service
137•edward•2d ago•130 comments

How Many Elementary Particles Are There, Really?

https://www.quantamagazine.org/how-many-elementary-particles-are-there-really-20260615/
91•rwmj•6h ago•73 comments

Researchers have developed pixels that can emit and analyse light together

https://ethz.ch/en/news-and-events/eth-news/news/2026/06/a-new-type-of-pixel.html
20•tspng•11h ago•12 comments

The Card That Made the Apple II Serious

https://www.wiseowl.com/articles/a2fpga-videx-01-the-card-that-made-the-apple-ii-serious/
3•js2•1h ago•0 comments

The US Army Issued Ocarinas to Soldiers in World War II

https://www.flutetunes.com/articles/my-flute-goes-to-war/
109•tomcam•2d ago•60 comments

Linux on Older Hardware: The Complete Revival Guide

https://www.fosslinux.com/158206/linux-on-older-hardware-revival-guide.htm
166•tapanjk•2d ago•97 comments

Task Failed Successfully: Saturating NIC and Disk Bandwidth

https://blog.mrcroxx.com/posts/task-failed-successfully-saturating-nic-and-disk-bandwidth/
27•MrCroxx•4d ago•7 comments

Streaming services' obnoxiously loud ads become illegal on July 1 in California

https://arstechnica.com/gadgets/2026/06/streaming-services-obnoxiously-loud-ads-become-illegal-on...
179•speckx•6h ago•41 comments

Why does kinetic energy increase quadratically, not linearly, with speed? (2011)

https://physics.stackexchange.com/questions/535/why-does-kinetic-energy-increase-quadratically-no...
326•ProxyTracer•20h ago•174 comments

Beer CSS – Build material design in record time

https://www.beercss.com
111•Seb-C•10h ago•57 comments

WordStar: A Writer's Word Processor (1996)

https://www.sfwriter.com/wordstar.htm
156•droidjj•15h ago•86 comments

Screen time can damage under-twos' development, landmark study suggests

https://www.theguardian.com/society/2026/jun/27/screen-time-damage-under-twos-development-study
23•Brajeshwar•2h ago•1 comments

Doctors suspected man had brain cancer. He had worms

https://arstechnica.com/health/2026/06/doctors-suspected-man-had-brain-cancer-he-actually-had-worms/
36•Bender•2h ago•14 comments

Cultures of Making and Relating

https://blog.khinsen.net/posts/2026/06/25/cultures.html
41•akkartik•2d ago•2 comments

Faster KNN search in Manticore: 2-pass HNSW, batched distances, and AVX-512

https://medium.com/@s_nikolaev/faster-knn-search-in-manticore-2-pass-hnsw-batched-distances-and-a...
52•snikolaev•1d ago•3 comments