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.

Did AI rediscover a cryptographic attack NSA had known since 2015?

https://an.dywa.ng/ecc.html
122•cbeuw•57m ago•71 comments

CleanYourTV: Remove Ads and Bloat from Android TV and Google TV

https://cleanyour.tv
52•kls0e•1h ago•18 comments

Wax: A User-Friendly Syntax for WebAssembly

https://tarides.com/blog/2026-11-26-wax/
54•theanonymousone•1h ago•13 comments

Got PQC?

https://www.gotpqc.com
193•owenthejumper•5h ago•100 comments

Examining a vintage RAM chip, I find a counterfeit with a different die (2017)

https://www.righto.com/2017/08/inside-fake-ram-chip-i-found-something.html
53•dverlaeckt80•1d ago•7 comments

How I almost found the eMudhra d=4 Private Key

https://blog.hboeck.de/archives/910-How-I-almost-found-the-eMudhra-d4-Private-Key.html
283•hannob•7h ago•47 comments

Google sent me to collections: GCP's 20-min AI alert fired 10h late ($76K bill)

https://www.reddit.com/r/googlecloud/comments/1yazk1p/google_sent_me_to_collections_20min_vertex_ai/
351•sheep1165•3h ago•170 comments

HN Jobs Trends

https://hnjobs.mathieularose.com/
58•rzk•59m ago•27 comments

An OS with no threads: The Actor Model

https://www.timdbg.com/posts/dbgos-actor-model/
218•ingve•7h ago•106 comments

US banks are sharing Social Security numbers with advertising giants Reddit, X

https://www.melurna.com/research/psa-online-forms-can-collect-your-data-even-if-you-never-hit-sub...
307•DeepLogin•4h ago•101 comments

Keeping HTTPS Connections Safe in Chrome

https://blog.google/security/keeping-https-connections-safe-in-chrome/
433•arwt•11h ago•232 comments

Richest 0.01% of Americans now hold their largest share of wealth in US history

https://bsky.app/profile/steverattner.bsky.social/post/3n3txzafd7s2j
251•afavour•2h ago•158 comments

I pen plotted secp256k1 (Bitcoin's elliptic curve)

https://harmonique.one/posts/i-pen-plotted-secp256k1-bitcoin-s-elliptic-curve
4•futurecat•10m ago•0 comments

Fears over OpenAI missing revenue targets prompt tech sell-off

https://www.theguardian.com/technology/2026/dec/04/openai-missing-revenue-targets-tech-sell-off
117•jcolot•3h ago•76 comments

Avoiding embarrassment is getting expensive

https://tornikeo.com/avoiding-embarrassment/
325•tornikeo•9h ago•201 comments

How far behind are open-weight models?

https://sebastianraschka.com/blog/2026/how-far-behind-are-open-weight-models.html
766•ModelForge•1d ago•598 comments

Rex is now available to everyone

https://www.superlogical.com/updates/rex-available-to-everyone
1007•kylebarron•23h ago•351 comments

Show HN: Weavon, 99.93% Pandoc in 9.3 MB of Rust, 15-50x faster, PDF without TeX

https://github.com/weavon/weavon
5•deyvium•54m ago•0 comments

Unmodified 748B DeepSeek-v4.1-Flash on one RTX 4090

https://axel-labs.com/research/deepseek-v4-1-flash-on-one-rtx-4090
380•bobbitybobob•20h ago•96 comments

Cloudflare will be fully post-quantum in 2027

https://blog.cloudflare.com/project-quantum-leap/
897•jupenur•1d ago•446 comments

Memtest86+ v9.10 adds NUMA support for multi-socket servers

https://github.com/memtest86plus/memtest86plus/releases/tag/v9.10
137•FiderHi•12h ago•6 comments

Plain Text Accounting

https://plaintextaccounting.org/
131•saikatsg•12h ago•52 comments

I quit big tech to build with AI

https://drawsolve.com/blog/building-with-ai
783•James_Stryker_D•16h ago•405 comments

Post-quantum key exchange in Tailscale v1.106

https://tailscale.com/blog/pqc-key-exchange
488•tatersolid•22h ago•94 comments

Intellectual Debt After Generative AI

https://www.noemamag.com/intellectual-debt-after-generative-ai/
323•theanonymousone•9h ago•266 comments

MiniMax-M4, an open-weight, natively multimodal Mixture-of-Experts model

https://github.com/MiniMax-AI/MiniMax-M4
549•cmrdporcupine•1d ago•189 comments

Qwen4-35B-A3B

https://huggingface.co/Qwen/Qwen4-35B-A3B
895•Philpax•14h ago•218 comments

Why Aren't We Working Less?

https://teodordermendzhiev.com/writing/why-arent-we-working-less/
253•tdermendjiev•3h ago•362 comments

Am I a developer or just a good Googler? (2013)

https://www.hanselman.com/blog/am-i-really-a-developer-or-just-a-good-googler
153•bariumbitmap•15h ago•80 comments

Laravel for COBOL

https://github.com/pihedy/laravel-cobol
468•choult•1d ago•166 comments