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.

Google SWE points 48 AI agents at NASA Lidar, finds unmapped Maya pyramid in 72h

https://pietromiotti.com/latest/maya-site/?maya
629•eyvindn•4h ago•246 comments

Pharo in the Browser with WebAssembly

https://massimo-nocentini.github.io/pharo-vm/world.html
67•xkriva11•2h ago•16 comments

Atuin Threads: All your agent sessions on every machine

https://blog.atuin.sh/threads-agent-sessions/
66•linsomniac•2h ago•29 comments

Can a Linear Program Do Weight-Space Programming?

https://nathan.rs/posts/weight-space-lp/
141•emschwartz•4h ago•21 comments

Hyper-Realistic Sand with WebGL2

https://av.github.io/safe-sand/
78•everlier•2h ago•16 comments

Using voltage glitching to unleash the A100 in my mining card

https://blog.kate.land/posts/using-voltage-glitching-to-unlock-the-a100/
153•lae•5h ago•58 comments

I asked every TV manufacturer 17 questions about how they spy on you

https://www.theverge.com/tech/1012372/tv-privacy-acr-questions
176•Brajeshwar•2h ago•89 comments

Show HN: Godbolt-in-a-floating-window for Neovim (C, C++, Rust)

https://github.com/0xdeadf1sh/AssemblyForNeovim
34•0xdeadf1sh•3h ago•4 comments

Protecting SSH Keys with macOS Secure Enclave

https://gatezh.com/posts/macos-secure-enclave-ssh-keys/
339•js2•12h ago•121 comments

Apple is killing its Support Community forum next week

https://www.theverge.com/tech/1031507/apple-community-support-forum-shutting-down
124•saikatsg•2h ago•69 comments

We need more goat sacrifices

https://www.experimental-history.com/p/we-need-more-goat-sacrifices
73•iamnothere•4h ago•43 comments

EventSourcingDB 1.3.0 Is Available

https://www.eventfoundation.io/resources/blog/eventsourcingdb-1-3-0-is-available
19•goloroden•3h ago•0 comments

Peer-to-peer WebRTC connections with built-in signaling and discovery

https://github.com/lukks/like-webrtc
34•LuKks•2d ago•10 comments

In Defense of Giving a Shit

https://www.possibilityspace.org/blog/posts/in-defence-of-giving-a-shit/
66•mrkn1•4h ago•43 comments

Tinfoil (YC P25) is hiring an applied AI security engineer in San Francisco

1•FrasiertheLion•4h ago

Next-Level Benchmarking Overfitting – Thomas Neumann

http://databasearchitects.blogspot.com/2026/11/next-level-benchmarking-overfitting.html
45•artrax•4h ago•7 comments

Apple has new Mac app coming to make running local AI models easy

https://9to5mac.com/2026/11/10/apple-has-new-mac-app-coming-to-make-running-local-ai-models-easy/
435•linolevan•19h ago•452 comments

Scion is back and is going to sell a kei truck in America

https://www.theautopian.com/scion-is-back-and-its-going-to-sell-a-freaking-kei-truck-in-america/
533•NaOH•20h ago•369 comments

Attention to Mamba: A Recipe for Cross-Architecture Distillation

https://machinelearning.apple.com/research/attention-mamba-distillation
11•zerop•3h ago•1 comments

Open research, stronger privacy: Making Firefox users harder to fingerprint

https://blog.mozilla.org/security/2026/11/10/open-research-stronger-privacy-making-firefox-users-...
102•Vinnl•3h ago•24 comments

Physically Controllable Relighting of Photographs

https://yaksoy.github.io/PhysicalRelighting/
44•summarity•4h ago•9 comments

Welcome to Ed and Sam's great adventure

https://www.hintz.org/trip/
3•mooreds•1d ago•0 comments

Six Math Essentials

https://teorth.github.io/tao-web/six-math-essentials.html
314•digital55•19h ago•58 comments

Greg Kurtzer's Ginux is now a userspace kernel

https://github.com/gmkurtzer/ginux
109•d3Xt3r•11h ago•70 comments

Starlink Mini 2

https://starlink.com/mini-2
486•robertjfclarke•22h ago•540 comments

A great old-timey game-programming hack (2013)

https://blog.moertel.com/posts/2013-12-14-great-old-timey-game-programming-hack.html
234•palsecam•14h ago•52 comments

Make this forward pass as fast as possible

https://ianbarber.blog/2026/11/09/make-this-forward-pass-as-fast-as-possible/
28•matt_d•1d ago•4 comments

Show HN: Black Ops II statically recompiled to native ARM64 macOS

https://github.com/adrbn/bo2-mac
106•adrbn•11h ago•47 comments

Synaptics patent claims stop work on DisplayLink drivers

https://lwn.net/SubscriberLink/1102549/acbc92e00cee3a3f/
458•speckx•22h ago•256 comments

Why I wrote the BEAM book (2025)

https://happihacking.com/blog/posts/2025/why_I_wrote_theBEAMBook/
168•zenincognito•2d ago•33 comments