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.

OpenPrinter

https://www.opentools.studio/
389•bouh•4h ago•105 comments

Al Vigier: Canada's AI strategy shouldn't include secret Palantir bills

https://www.readtheline.ca/p/al-vigier-canadas-ai-strategy-shouldnt
55•ClearwayLaw•1h ago•14 comments

Has_not_been_viewed_much

https://iamwillwang.com/notes/has-not-been-viewed-much/
57•wxw•1h ago•7 comments

Organic Maps

https://organicmaps.app/
798•tosh•11h ago•223 comments

Show HN: Homegames. An open-source game platform I've been making for 8 years

https://homegames.io
84•homegamesjoseph•3h ago•29 comments

Completing a computer science degree on Coursera

https://notesbylex.com/completing-a-computer-science-degree-on-coursera
91•lexandstuff•3h ago•57 comments

Connections in Math: the two kinds of random

https://stillthinking.net/posts/connections-in-math-two-kinds-of-random/
14•pcael•1h ago•9 comments

The future of Flipper Zero development

https://blog.flipper.net/future-of-flipper-zero-development/
225•croes•6h ago•93 comments

New AI tutor achieves 0.71-1.30 SD effect size in Dartmouth course [pdf]

https://intextbooks.science.uu.nl/workshop2026/files/itb26_s1s2.pdf
123•jonahbard•6h ago•78 comments

Composite Video on the NES: Why's it so wobbly?

https://nicole.express/2026/phase-altering-by-line.html
40•zdw•3h ago•5 comments

It's not about physical vs. digital games, it's about ownership

https://popcar.bearblog.dev/its-about-ownership/
307•popcar2•10h ago•231 comments

Starring the Computer

https://www.starringthecomputer.com/computers.html
164•gitowiec•7h ago•40 comments

Mr. Baby Paint and accidentally discovering a new cellular automata

https://tekstien-marginaalien-keskus.aalto.fi/residenssi/heikki/blog/004-december-2/
108•jfil•2d ago•21 comments

The Private Capture of Public Genius

https://www.wysr.xyz/p/the-private-capture-of-public-genius
8•martialg•1h ago•0 comments

Dungeon Proof Crawler: learn how to write proofs with RPG

https://dhilst.github.io/algae/game/index.html
35•SchwKatze•4h ago•12 comments

Cursed circuits #5: capacitance multiplier

https://lcamtuf.substack.com/p/cursed-circuits-capacitance-multiplier
52•surprisetalk•5h ago•3 comments

Delta flight hit by firework while landing at Midway Airport on Fourth of July

https://www.nbcchicago.com/news/local/delta-flight-hit-by-firework-while-landing-at-midway-airpor...
62•randycupertino•5h ago•62 comments

DNSGlobe – Rust TUI to watch DNS propagate around the world

https://github.com/514-labs/dnsglobe
19•Callicles•3h ago•14 comments

Zuckerberg says AI agent development going slower than expected

https://www.reuters.com/business/zuckerberg-says-ai-agent-development-going-slower-than-expected-...
80•cwwc•3d ago•223 comments

The Writers Who Wrote the Most in History

https://brennan.day/compulsion-the-writers-who-wrote-the-most-in-history/
7•bookofjoe•4d ago•2 comments

Dependencies should be fetched directly from VCS

https://www.arp242.net/deps-vcs.html
35•mrngm•4h ago•22 comments

You need a webring

https://shub.club/writings/2026/july/you-need-a-webring/
58•forthwall•6h ago•36 comments

Introduction to Compilers and Language Design (2021)

https://dthain.github.io/books/compiler/
272•AlexeyBrin•13h ago•45 comments

Zero-copy in Go: sendfile, splice, and the cost of io.Copy

https://segflow.github.io/post/zero-copy-sendfile-splice/
58•mrngm•4h ago•10 comments

CoCom regulations and GPS receivers for balloons and cubesats

https://space.stackexchange.com/questions/14687/current-situation-with-cocom-regulations-and-gps-...
16•vinnyglennon•3h ago•4 comments

Show HN: Osint tool that finds exposed files on domains

https://search.cerast-intelligence.com/
22•PatchRequest•4h ago•8 comments

Does Code Cleanliness Affect Coding Agents?

https://arxiv.org/abs/2605.20049
9•softwaredoug•2h ago•0 comments

The AI Compass Quiz

https://bambamramfan.github.io/ai-compass/
14•ai_critic•2h ago•7 comments

Run Windows 2000 on a DEC Alpha with a new es40 fork

https://raymii.org/s/blog/Run_Windows_2000_for_Dec_Alpha_on_a_new_es40_fork.html
102•jandeboevrie•11h ago•56 comments

Egg companies made $1.22B in profit off $6 carton

https://fortune.com/2026/07/02/egg-price-fixing-crisis-cover-cash-and-eggs/
17•gscott•1h ago•0 comments