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.

Pre-Release of Polars 2.0

https://pola.rs/posts/announcing-polars-2/
97•komape•2h ago•13 comments

The Browser's Main Thread Is Expensive

https://kciter.so/posts/the-expensive-main-thread/en/
20•kciter•1d ago•3 comments

Three schoolgirls in Kinsale pulled up a pea plant covered in warts (2016)

https://scienceblog.com/b-three-schoolgirls-in-kinsale-pulled-up-a-pea-plant-covered-in-warts-and...
36•DamonHD•2h ago•9 comments

Muse Spark 1.3

https://developer.meta.com/ai/models/muse-spark/
568•bvaldivielso•13h ago•379 comments

Gemini 3.8 Flash and 3.8 Flash Cyber

https://blog.google/innovation-and-ai/models-and-research/gemini-models/3-8-flash-and-3-8-flash-c...
1005•bratao•17h ago•567 comments

LLMs and Self-Referentiality

https://scottaaronson.blog/?p=10046
37•mavdol04•1d ago•21 comments

The Computer Museum of America reclamation project

https://computer-museum.org/wp/
41•rbanffy•2d ago•12 comments

Holden's Lightning Flight

https://en.wikipedia.org/wiki/Holden%27s_Lightning_flight
151•ColinWright•2d ago•33 comments

Three sites made 215,128 “best software” pages for AI. Perplexity cites them

https://trellner.com/reports/manufactured-sources-behind-ai-recommendations/
408•jakobgreenfeld•19h ago•199 comments

Google avoids a breakup of its ad tech business

https://www.nytimes.com/2026/09/02/technology/google-ad-tech-remedies.html
371•donohoe•18h ago•277 comments

Can I opt out of my input or output data being used for training?

https://help.mistral.ai/en/articles/455207-can-i-opt-out-of-my-input-or-output-data-being-used-fo...
440•teekert•20h ago•198 comments

Higher Multipoles of the Cow

https://arxiv.org/abs/2504.00506
66•MrOrelliOReilly•1d ago•20 comments

Reverse Engineering Unknown File Formats with ImHex

https://werwolv.net/posts/file_format_reverse_engineering/
197•carlos-menezes•2d ago•34 comments

Fable 5.1 World Modeling

https://github.com/PhiloLabs/fable51-worlds
238•surreal_•13h ago•70 comments

Launch HN: RonanRX (YC S26) – Personalized Peptides and GLP-1s

58•lloydarmbrust•10h ago•66 comments

Show HN: OwnTime – a chess clock for your day's priorities

https://owntime.app/
75•fmos•1d ago•37 comments

Biggest dark matter detector spots a single weird particle

https://www.science.org/content/article/world-s-biggest-dark-matter-detector-spots-single-weird-p...
292•randycupertino•19h ago•102 comments

Wendell Berry has died

https://www.nytimes.com/2026/08/31/us/wendell-berry-dead.html
186•Curiositry•2d ago•97 comments

Aging brains blend memories together instead of just forgetting them

https://studyfinds.com/aging-brains-blend-memories-together-instead-of-forgetting-them-study-finds/
275•mdp2021•20h ago•117 comments

Qantas Airbus A380 engine failure in 2010 (2023)

https://admiralcloudberg.medium.com/a-matter-of-millimeters-the-story-of-qantas-flight-32-bdaa62d...
131•gumby•14h ago•81 comments

Engineering of the fastest WebAssembly interpreters

https://wasmi-labs.github.io/blog/posts/wasmi-v2.0/
90•herobird•1d ago•8 comments

Exit the Cave

https://turtlespace.blog/p/exit-the-cave
258•akkartik•18h ago•92 comments

Async Rust vs RTOS showdown (2022)

https://tweedegolf.nl/en/blog/65/async-rust-vs-rtos-showdown/
88•kooi•14h ago•43 comments

Altair Basic Interpreter Source Code (1975) [pdf]

https://images.gatesnotes.com/12514eb8-7b51-008e-41a9-512542cf683b/34d561c8-cf5c-4e69-af47-3782ea...
59•Eridanus2•13h ago•33 comments

A Selection of Los Alamos Rolodex Business Cards

https://clui.org/collections/los-alamos-business-cards/selection-cards
166•1970-01-01•2d ago•46 comments

We could save petabytes of cache storage with Zstandard and Pingora

https://blog.cloudflare.com/cache-transcoding/
110•torutofu•1d ago•46 comments

Poisson Disk Sampling

https://stripeacross.com/posts/poisson-disk-sampling/
161•vismit2000•19h ago•19 comments

Nango (YC W23) is hiring across eng, product and GTM (SF and remote)

https://nango.dev/careers
1•bastienbeurier•12h ago

Reasons robotics is hard

https://secondthoughts.ai/p/14-reasons-robotics-is-hard
92•ddp26•11h ago•51 comments

WebLLM: high-performance in-browser LLM inference engine

https://github.com/mlc-ai/web-llm
115•saikatsg•19h ago•20 comments