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.

GPT‑6.2 Astra and Sol

https://openai.com/index/introducing-gpt-6-2-astra-sol/
921•jasondavies•4h ago•566 comments

Java4Shell: RCE in OpenJDK when processing Base64

https://calif.io/java4shell/
136•werrett•1h ago•19 comments

jQuery 4.1.0

https://github.com/jquery/jquery/releases/tag/4.1.0
174•petecooper•2h ago•78 comments

MAI Code 2 and Code 2 Flash

https://microsoft.ai/news/introducing-mai-code-2-and-mai-code-2-flash/
211•lemonish97•3h ago•103 comments

Nvidia stopped disclosing Singapore sales as revenues hit $104B

https://www.ft.com/content/dbde7a30-548c-4f9d-a4be-7898a0c24dcf
245•louiereederson•5h ago•131 comments

350 years ago, Ole Rømer discovered that light has a finite speed

https://www.sciencenorway.no/culture-history-history-of-science/350-years-ago-this-man-discovered...
158•dxs•2h ago•52 comments

Phrack 73 Released

https://phrack.org/issues/73/introduction_md
185•notmine1337•3h ago•15 comments

Web Browser Engineering (2021)

https://browser.engineering/
84•ibobev•2h ago•10 comments

Highly classified US national security communications network goes down

https://www.cnn.com/2026/11/17/politics/highly-classified-national-security-communications-networ...
363•monkeydust•6h ago•483 comments

Solid 2.0

https://www.solidjs.com/blog/solid-2-0-the-long-hold/
153•pier25•3h ago•35 comments

Java4Shell: pre-auth RCE flaw in Java 17 puts servers at risk (CVE-2026-114938)

https://www.aikido.dev/blog/java-17-rce-vulnerability-cve-2026-114938
91•b33f•7h ago•29 comments

Apple Services Down

https://developer.apple.com/system-status/
542•willy_k•4h ago•300 comments

What is the best harness for each model?

https://runta.com/blog/introducing-frontierharness-eval-v1-1/
301•Edward40•7h ago•106 comments

Effects of a Nuclear Detonation in Low Earth Orbit

https://arxiv.org/abs/2611.09827
41•PaulHoule•2h ago•15 comments

Who Builds the Machines That Build the Machines?

https://read.corematter.com/p/section-232-us-machine-tools
62•gmays•4h ago•19 comments

YC wrote software to run our internship expo – and an 8-bit SIM to show it off

1•ryankicks•5h ago

Launch HN: StarSling (YC P25) – Self-improving CI for agent-volume repos

https://starsling.dev
32•yonasb•3h ago•19 comments

Mouse Party

https://aboard.com/lets-have-a-mouse-party/
34•bookofjoe•3d ago•5 comments

Show HN: Alloy CSS, dialogs, menus and tabs that work with JavaScript off

https://alloyhtml.com/example.html
160•prafandy•7h ago•27 comments

Not Everything Needs an LLM

https://newsletter.posthog.com/p/decision-models
38•speckx•3h ago•6 comments

New Evidence Shows School Phone Bans Are Gradually Improving Test Scores

https://www.nytimes.com/2026/11/17/upshot/school-phone-bans-study-scores.html
1093•donohoe•10h ago•538 comments

How the Claude Code team thinks about verification

https://claude.dev/blog/how-the-claude-code-team-thinks-about-verification/
236•craigmart•11h ago•183 comments

Show HN: TrnRT – An open-source LLM inference engine for AWS Trainium

https://github.com/RunanywhereAI/trnrt
35•sanchitmonga22•6h ago•5 comments

Fixing a WebKit bug to see if promises are made of train tracks

https://alistair.sh/thenables
21•dverlaeckt80•3d ago•1 comments

Advancing computer-use agents for healthcare teams

https://openai.com/index/advancing-computer-use-for-healthcare-teams/
25•gmays•3h ago•17 comments

Zoltraak and the Dynamics of Military Innovation

https://jgeekstudies.org/2026/11/15/zoltraak-military-innovation-in-frieren/
14•zdw•1d ago•3 comments

First Photos of the Poles of a Rod-Shaped Bacterium

https://nautil.us/check-out-the-first-photos-of-the-poles-of-a-rod-shaped-bacterium-1286664
105•dustfinger•1d ago•23 comments

Elephant-Goldfish Model

https://egm.dev/
62•_tk_•1d ago•22 comments

Human.md

https://www.human-md.ai/
40•ray__•1h ago•25 comments

VisualBasic.World: A gallery of Planet Source Code programs from 1997 to 2012

https://visualbasic.world/
204•broast•1d ago•79 comments