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.

Substack writers, you need a website

https://elizabethtai.com/2026/06/10/substack-writers-you-need-a-website/
239•speckx•3h ago•139 comments

Steel Bank Common Lisp version 2.6.7

https://sbcl.org/all-news.html?2.6.7
130•tmtvl•3h ago•42 comments

MCP 2026-07-28 Specification: transport going stateless

https://blog.modelcontextprotocol.io/posts/2026-07-28/
56•Eldodi•2h ago•20 comments

Kimi K3 Architecture Overview and Notes

https://sebastianraschka.com/blog/2026/kimi-k3-architecture-notes.html
182•ModelForge•5h ago•20 comments

Delayed Gratification – Proud to Be 'Last to Breaking News'

https://www.slow-journalism.com/
173•speerer•4h ago•91 comments

The iPhone Upgrade Program is being replaced by Apple Upgrade

https://www.apple.com/shop/iphone/iphone-upgrade-program
66•lkurtz•3h ago•133 comments

The Fabled Flatbreads of Uzbekistan (2015)

https://www.aramcoworld.com/articles/2015/the-fabled-flatbreads-of-uzbekistan
29•jxub•4d ago•14 comments

Zig's Incremental Compilation Internals

https://mlugg.co.uk/posts/incremental-compilation-internals/
137•garyhtou•5h ago•95 comments

Discovering Cryptographic Weaknesses with Claude

https://www.anthropic.com/research/discovering-cryptographic-weaknesses
106•gslin•3h ago•53 comments

How Do I Profile eBPF Code?

https://naveensrinivasan.com/posts/2026-07-22-how-do-i-profile-ebpf-code/
89•snaveen•4h ago•6 comments

New HIV vaccine shows unprecedented success in preclinical study

https://www.lji.org/news-events/news/post/new-hiv-vaccine-shows-unprecedented-success-in-preclini...
455•codebyaditya•7h ago•216 comments

Show HN: XY – A Fast, composable, GPU-accelerated interactive plotting library

https://github.com/reflex-dev/xy
84•apetuskey•4h ago•30 comments

Kimi Linear: An Expressive, Efficient Attention Architecture (2025)

https://arxiv.org/abs/2510.26692
248•ronfriedhaber•9h ago•107 comments

Now Is the Time to Give LLMs Access to the ACM Digital Library

https://cacm.acm.org/opinion/now-is-the-time-to-give-llms-access-to-the-acm-digital-library/
82•rbanffy•5h ago•51 comments

WOFF 1.0: a milestone on W3C's journey of fonts on the web

https://www.w3.org/blog/2026/woff-1-0-a-milestone-on-w3cs-journey-of-fonts-on-the-web/
44•hn_acker•3h ago•1 comments

Uv 0.12.0

https://github.com/astral-sh/uv/releases/tag/0.12.0
62•hallvard•1h ago•29 comments

Harmony Explained: Progress Towards a Scientific Theory of Music (2012)

https://arxiv.org/abs/1202.4212
73•surprisetalk•5h ago•53 comments

Anthropeum – Where in the world, and when, does this human artifact belong?

https://anthropeum.com/
113•bookofjoe•5h ago•32 comments

Pacing the Frontier

https://www.pacingthefrontier.com/
7•reducesuffering•40m ago•0 comments

Una GPS smart watch – Repairable, USB-C charging, developer-friendly

https://unawatch.com/
79•pimterry•6h ago•59 comments

How to survive boiling water

https://taxa.substack.com/p/how-to-survive-boiling-water
403•cainxinth•4d ago•87 comments

The most advanced robotic servicing satellite–that we know about

https://arstechnica.com/space/2026/07/this-is-the-worlds-most-advanced-robotic-servicing-satellit...
24•GlenTheMachine•4d ago•1 comments

DMARC has been public since 2012 but most company domains still don't enforce it

https://ciphercue.com/blog/dmarc-enforcement-gap-rua-fragmentation-2026
157•adulion•10h ago•98 comments

Stop Killing the Internet: No Digital ID and No Age Verification

https://citizens-initiative.europa.eu/initiatives/details/2026/000011_en
350•doener•5h ago•105 comments

Hulios: An eBPF-powered, transparent Tor gateway for Linux

https://github.com/ghaziwali/Hulios
6•ghaziwali•55m ago•0 comments

So, you want to make a game engine (2023)

https://lisyarus.github.io/blog/posts/so-you-want-to-make-a-game-engine.html#part-3
48•kugurerdem•5h ago•29 comments

A walk through of the DeltaNet family of linear attention variants

https://blog.doubleword.ai/you-could-have-come-up-with-kimi-delta-attention
271•AnhTho_FR•4h ago•111 comments

Recursion Is Lying to You

https://blog.gaborkoos.com/posts/2026-05-09-Your-Recursion-Is-Lying-to-You/
4•theanonymousone•29m ago•1 comments

7.1 Earthquake in Japan

https://www.data.jma.go.jp/multi/quake/quake_detail.html?eventID=20260728163528&lang=en
752•krembo•13h ago•195 comments

Donate to GrapheneOS

https://grapheneos.org/donate
185•charliebwrites•1h ago•48 comments