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•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.

Ntsc-rs – open-source video emulation of analog TV and VHS artifacts

https://ntsc.rs/
230•gregsadetsky•4h ago•51 comments

Meta confirms 1000s of Instagram accounts were hacked by abusing its AI chatbot

https://this.weekinsecurity.com/meta-confirms-thousands-of-instagram-accounts-were-hacked-by-abus...
351•speckx•5h ago•127 comments

Moving beyond fork() + exec()

https://lwn.net/SubscriberLink/1076018/16f01bbbb8e0d1f0/
225•jwilk•9h ago•247 comments

Zeroserve: A zero-config web server you can script with eBPF

https://su3.io/posts/introducing-zeroserve
180•losfair•9h ago•45 comments

DoD Officially Drops 180 Faiths from Military's Recognized Religion List

https://www.military.com/dod-officially-drops-180-faiths-from-militarys-recognized-religion-list
19•Balgair•26m ago•6 comments

Nvidia is proposing a beast of a CPU system for Windows PCs

https://twitter.com/lemire/status/2062880075117113739
218•tosh•11h ago•408 comments

New U.S. college grads now have higher unemployment than the average worker

https://www.randalolson.com/2026/06/04/recent-grad-unemployment-flip/
121•davidbarker•3h ago•100 comments

You Can Run

https://magazine.atavist.com/2026/mccann-cocaine-fugitives
91•bryanrasmussen•8h ago•43 comments

Sem: New primitive for code understanding – not LSPs, but entities on top of Git

https://ataraxy-labs.github.io/sem/
31•rohanucla•4h ago•17 comments

Computex 2026: Are We Heading for the Agentic PC Era Yet?

https://www.eetimes.com/computex-2026-are-we-heading-for-the-agentic-pc-era-yet/
20•rbanffy•3h ago•21 comments

Pokemon Emerald Ported to WebAssembly (100k FPS)

https://pokeemerald.com/
259•tripplyons•12h ago•71 comments

PyTorch Custom Operation

https://leimao.github.io/blog/PyTorch-Custom-Operation/
16•eigenBasis•5d ago•2 comments

Show HN: Infinite canvas notes in the non-Euclidean Poincaré disk

https://uonr.github.io/poincake/
110•uonr•4d ago•18 comments

Home alone: Remote work, isolation, and mental health

https://www.science.org/doi/10.1126/science.aec7671
110•speckx•4h ago•105 comments

Google to pay SpaceX $920M a month for compute capacity at xAI data centers

https://www.cnbc.com/2026/06/05/google-to-pay-spacex-920-million-a-month-for-xai-compute-capacity...
120•toephu2•1d ago•691 comments

Pentagon raised threat of Israeli spying on U.S. to highest level, sources say

https://www.nbcnews.com/politics/national-security/pentagon-raised-threat-israeli-spying-us-highe...
370•MilnerRoute•5h ago•261 comments

Benchmarks in Leipzig

https://arxiv.org/abs/2606.05818
121•root-parent•10h ago•44 comments

Unicode Fonts and Tools for X11

https://www.cl.cam.ac.uk/~mgk25/ucs-fonts.html
6•kristianp•1d ago•0 comments

The new bibliomaniacs

https://engelsbergideas.com/notebook/the-new-bibliomaniacs/
61•RickJWagner•12h ago•51 comments

Ask HN: What was your "oh shit" moment with GenAI?

533•andrehacker•2d ago•931 comments

Motorola effectively bricked its entire line of WiFi routers without explanation

https://mashable.com/tech/motorola-wifi-routers-stop-working-motosync-plus-app-down
45•thisislife2•9h ago•14 comments

Running Python code in a sandbox with MicroPython and WASM

https://simonwillison.net/2026/Jun/6/micropython-in-a-sandbox/
70•theanonymousone•9h ago•21 comments

Static Devirtualization of Themida

https://back.engineering/blog/09/05/2026/
18•homarp•4d ago•2 comments

S&P 500 rejects SpaceX, also blocking entry for OpenAI and Anthropic

https://arstechnica.com/tech-policy/2026/06/sp-500-blocks-fast-spacex-entry-wont-waive-rule-for-u...
1342•maltalex•19h ago•465 comments

WoofWare.PawPrint, a Deterministic .NET Runtime

https://www.patrickstevens.co.uk/posts/2026-06-04-announcing-woofware-pawprint/
48•Smaug123•2d ago•15 comments

Building Rust Procedural Macros from the Grounds Up

https://www.learnix-os.com/ch02-03-implementing-the-bitfields-proc-macro.html
82•Sagi21805•6d ago•15 comments

Mbodi AI (YC P25) Is Hiring Founding Machine Learning Engineer (Robotics)

https://www.ycombinator.com/companies/mbodi-ai/jobs/WYAcNkX-founding-machine-learning-engineer
1•chitianhao•12h ago

Summer of '85: DOSBOS is rejected by ANALOG Computing

https://www.goto10retro.com/p/summer-of-85-dosbos-is-rejected-by
49•ibobev•2d ago•11 comments

Ask HN: Why is the HN crowd so anti-AI?

369•Ekami•21h ago•611 comments

How to make firecracker faster to start Chromium in < 20ms

https://www.kernel.sh/blog/firecracker-faster
6•juecd•1d ago•3 comments