frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

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•7mo ago

Comments

RedShift1•7mo ago
It'll be a cold day in hell before I start throwing away my 80+ "New" notepad++ tabs.
notTooFarGone•7mo 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•7mo 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•7mo 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•7mo 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•7mo 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•7mo 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•7mo 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•7mo 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•7mo 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•7mo 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•7mo 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.

Netflix: Open Content

https://opencontent.netflix.com/
279•tosh•4h ago•40 comments

Non-Zero-Sum Games

https://nonzerosum.games/
127•8organicbits•3h ago•28 comments

Times New American: A Tale of Two Fonts

https://hsu.cy/2025/12/times-new-american/
54•firexcy•1h ago•25 comments

The British Empire's Resilient Subsea Telegraph Network

https://subseacables.blogspot.com/2025/12/the-british-empires-resilient-subsea.html
27•giuliomagnifico•1h ago•3 comments

Approachable Swift Concurrency

https://fuckingapproachableswiftconcurrency.com/en/
33•wrxd•1h ago•2 comments

Win32 is the stable Linux ABI

https://loss32.org/
91•krautburglar•1h ago•41 comments

Hive (YC S14) Is Hiring a Staff Software Engineer (Data Systems)

https://jobs.ashbyhq.com/hive.co/cb0dc490-0e32-4734-8d91-8b56a31ed497
1•patman_h•17m ago

Google is dead. Where do we go now?

https://www.circusscientist.com/2025/12/29/google-is-dead-where-do-we-go-now/
933•tomjuggler•18h ago•737 comments

No strcpy either

https://daniel.haxx.se/blog/2025/12/29/no-strcpy-either/
60•firesteelrain•1h ago•19 comments

Go Away Python

https://lorentz.app/blog-item.html?id=go-shebang
153•baalimago•5h ago•86 comments

GOG is getting acquired by its original co-founder

https://www.gog.com/blog/gog-is-getting-acquired-by-its-original-co-founder-what-it-means-for-you/
765•haunter•22h ago•450 comments

Show HN: One clean, developer-focused page for every Unicode symbol

https://fontgenerator.design/symbols
83•yarlinghe•4d ago•40 comments

Stranger Things creator says turn off "garbage" settings

https://screenrant.com/stranger-things-creator-turn-off-settings-premiere/
264•1970-01-01•14h ago•466 comments

Hacking Washing Machines [video]

https://media.ccc.de/v/39c3-hacking-washing-machines
162•clausecker•13h ago•32 comments

Tesla's 4680 battery supply chain collapses as partner writes down deal by 99%

https://electrek.co/2025/12/29/tesla-4680-battery-supply-chain-collapses-partner-writes-down-dea/
534•coloneltcb•20h ago•598 comments

ManusAI Joins Meta

https://manus.im/blog/manus-joins-meta-for-next-era-of-innovation
267•gniting•16h ago•161 comments

UNIX Fourth Edition

http://squoze.net/UNIX/v4/README
78•dcminter•1w ago•6 comments

The future of software development is software developers

https://codemanship.wordpress.com/2025/11/25/the-future-of-software-development-is-software-devel...
288•cdrnsf•19h ago•295 comments

Charm Ruby – Glamorous Terminal Libraries for Ruby

https://charm-ruby.dev/
50•todsacerdoti•7h ago•7 comments

AI is forcing us to write good code

https://bits.logic.inc/p/ai-is-forcing-us-to-write-good-code
232•sgk284•19h ago•164 comments

Groq investor sounds alarm on data centers

https://www.axios.com/2025/12/29/groq-alex-davis-data-center-concerns
27•giuliomagnifico•2h ago•19 comments

Graph Algorithms in Rayon

https://davidlattimore.github.io/posts/2025/11/27/graph-algorithms-in-rayon.html
28•PaulHoule•4d ago•0 comments

Turning an old Amazon Kindle into a eInk development platform (2021)

https://blog.lidskialf.net/2021/02/08/turning-an-old-kindle-into-a-eink-development-platform/
38•fanf2•4d ago•7 comments

Concurrent Hash Table Designs

https://bluuewhale.github.io/posts/concurrent-hashmap-designs/
7•signa11•3d ago•0 comments

MongoDB Server Security Update, December 2025

https://www.mongodb.com/company/blog/news/mongodb-server-security-update-december-2025
96•plorkyeran•14h ago•40 comments

MH370 vanished in 2014.New search aims to find answers families desperately want

https://www.abc.net.au/news/2025-12-30/mh370-search-resumes-for-malaysia-airlines-missing-plane/1...
10•evolve2k•1h ago•1 comments

Outside, Dungeon, Town: Integrating the Three Places in Videogames (2024)

https://keithburgun.net/outside-dungeon-town-integrating-the-three-places-in-videogames/
88•vector_spaces•13h ago•39 comments

Incremental Backups of Gmail Takeouts

https://baecher.dev/stdout/incremental-backups-of-gmail-takeouts/
107•pbhn•5d ago•49 comments

Singapore Study Links Heavy Infant Screen Time to Teen Anxiety

https://www.bloomberg.com/news/articles/2025-12-30/singapore-study-links-heavy-infant-screen-time...
13•1vuio0pswjnm7•2h ago•1 comments

Static Allocation with Zig

https://nickmonad.blog/2025/static-allocation-with-zig-kv/
201•todsacerdoti•22h ago•95 comments