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.

Claude Sonnet 5

https://www.anthropic.com/news/claude-sonnet-5
329•marinesebastian•58m ago•156 comments

Claude Code is steganographically marking requests

https://thereallo.dev/blog/claude-code-prompt-steganography
728•kirushik•3h ago•218 comments

We Are the Last People Who Know How It Works

https://unix.foo/posts/last-people-who-know-how-it-works/
142•cylo•1h ago•79 comments

Claude Science

https://claude.com/product/claude-science
144•lebovic•1h ago•57 comments

Nano Banana 2 Lite

https://deepmind.google/models/gemini-image/flash-lite/
142•minimaxir•2h ago•39 comments

I built a mmWave material classification radar

https://gauthier-lechevalier.com/radar
43•GL26•1h ago•7 comments

Looking Ahead to Postgres 19

https://www.snowflake.com/en/blog/engineering/postgresql-19-features-beta/
174•thinkingemote•4h ago•103 comments

Xsnow "protestware" in Debian

https://lwn.net/SubscriberLink/1079385/3d7a57da58b41aa9/
78•6581•2h ago•50 comments

County with 37 Data Centers Asks Schools to 'Conserve Electricity'

https://www.404media.co/henrico-virginia-datacenter-energy-cost-email/
215•01-_-•2h ago•108 comments

Memoirs of Extraordinary Popular Delusions and the Madness of Crowds (1852)

https://www.gutenberg.org/ebooks/24518
127•lstodd•6h ago•38 comments

Knoppix

https://www.knopper.net/knoppix/index-en.html
148•hoangvmpc•6h ago•73 comments

Crypto firms have spent $189M so far on 2026 US election, report says

https://www.reuters.com/world/crypto-firms-have-spent-189-million-so-far-2026-us-election-report-...
114•tartoran•2h ago•47 comments

Open Source Low Tech

https://opensourcelowtech.org/
561•grep_it•4d ago•114 comments

Building a custom octocopter from scratch with no prior hardware experience

https://karolina.mgdubiel.com/drone/
260•noleary•2d ago•56 comments

Don't Make Gates Optional, Make Them Flexible

https://wakamoleguy.com/p/flexible-gates
17•wakamoleguy•3d ago•1 comments

Factorio 2.1 Experimental Release

https://factorio.com/blog/post/fff-444
87•ibobev•3d ago•44 comments

European digital ID wallets rely on safety services of Google and Apple

https://waag.org/en/article/european-digital-id-wallets-are-gift-google-and-apple/
632•donohoe•8h ago•275 comments

Zluda 6 release (run unmodified CUDA applications on non-Nvidia GPUs)

https://vosen.github.io/ZLUDA/blog/zluda-update-q1q2-2026/
113•Tiberium•8h ago•10 comments

Tell HN: Installing Cursor on iOS irreversibly changes your privacy settings

23•zkldi•24m ago•5 comments

Qwen 3.6 27B is the sweet spot for local development

https://quesma.com/blog/qwen-36-is-awesome/
1105•stared•1d ago•699 comments

LongCat-2.0, a large-scale MoE model with 1.6T total and 48B Active

https://longcat.chat/blog/longcat-2.0/
249•benjiro29•18h ago•73 comments

We moved our Bluesky data to Eurosky

https://waag.org/en/article/why-we-moved-our-bluesky-data-eurosky/
110•dotcoma•3h ago•96 comments

Mathematics: Its Content, Methods and Meaning

https://old.maa.org/press/maa-reviews/mathematics-its-content-methods-and-meaning
48•teleforce•3d ago•16 comments

Amazon Seller Reveals Rare Glimpse of Shadow Bribery Market

https://www.bloomberg.com/news/articles/2026-06-24/inside-the-shadow-market-selling-access-to-ama...
17•petethomas•45m ago•2 comments

.self: A new top-level domain designed to support self-hosting

https://hccf.onmy.cloud/2026/06/21/reclaiming-our-digital-selves-hccfs-vision-for-a-human-centere...
637•HumanCCF•23h ago•356 comments

Free the Icons

https://weblog.rogueamoeba.com/2026/06/26/free-the-icons/
632•zdw•3d ago•231 comments

Exercise intensity influences body composition in healthy older adults (2025)

https://www.maturitas.org/article/S0378-5122(25)00571-7/fulltext
174•bookofjoe•8h ago•149 comments

The labor share of income in the US is at its lowest post-war level

https://libertystreeteconomics.newyorkfed.org/2026/06/the-post-covid-decline-in-the-labor-share/
392•loughnane•3h ago•397 comments

I'm building a Space Cadet Pinball Machine! [video]

https://www.youtube.com/watch?v=lHQ8c8i42VE
64•skibz•4d ago•11 comments

Memory Safe Context Switching

https://fil-c.org/context_switches
196•modeless•18h ago•29 comments