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

Comments

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

Show HN: WhatCable, a tiny menu bar app for inspecting USB-C cables

https://github.com/darrylmorley/whatcable
69•sleepingNomad•2h ago•15 comments

Show HN: Perfect Bluetooth MIDI for Windows

22•mayerwin•52m ago•2 comments

Auto Polo

https://en.wikipedia.org/wiki/Auto_polo
55•canjobear•2d ago•14 comments

If I could make my own GitHub

https://matduggan.com/if-i-could-make-my-own-github/
58•vinhnx•4h ago•38 comments

How Mark Klein told the EFF about Room 641A [book excerpt]

https://thereader.mitpress.mit.edu/the-whistleblower-who-uncovered-the-nsas-big-brother-machine/
607•the-mitr•18h ago•200 comments

After dissing Anthropic for limiting Mythos, OpenAI restricts access to Cyber

https://techcrunch.com/2026/04/30/after-dissing-anthropic-for-limiting-mythos-openai-restricts-ac...
4•gbourne1•17m ago•0 comments

New copy of earliest poem in English, written 1,3k years ago, discovered in Rome

https://www.tcd.ie/news_events/articles/2026/caedmons-hymn-discovery/
67•giuliomagnifico•1d ago•35 comments

For Linux kernel vulnerabilities, there is no heads-up to distributions

https://www.openwall.com/lists/oss-security/2026/04/30/10
509•ori_b•18h ago•398 comments

Grok 4.3

https://docs.x.ai/developers/models/grok-4.3
85•simianwords•2h ago•93 comments

The Rotary Un-Smartphone

https://skysedge.com/telecom/RUSP/index.html
12•tzury•1h ago•1 comments

OpenWarp

https://openwarp.zerx.dev
96•zero-lab•8h ago•78 comments

Opus 4.7 knows the real Kelsey

https://www.theargumentmag.com/p/i-can-never-talk-to-an-ai-anonymously
359•ilamont•1d ago•185 comments

Shai-Hulud Themed Malware Found in the PyTorch Lightning AI Training Library

https://semgrep.dev/blog/2026/malicious-dependency-in-pytorch-lightning-used-for-ai-training/
397•j12y•18h ago•141 comments

Softmax, can you derive the Jacobian? And should you care?

https://idlemachines.co.uk/essays/softmax
49•smaddrellmander•3d ago•4 comments

Maladaptive Frugality

https://herbertlui.net/maladaptive-frugality/
106•herbertl•2d ago•85 comments

CPanel and WHM Authentication Bypass – CVE-2026-41940

https://labs.watchtowr.com/the-internet-is-falling-down-falling-down-falling-down-cpanel-whm-auth...
109•zikani_03•11h ago•45 comments

Claude Code refuses requests or charges extra if your commits mention "OpenClaw"

https://twitter.com/theo/status/2049645973350363168
1172•elmean•20h ago•641 comments

How an oil refinery works

https://www.construction-physics.com/p/how-an-oil-refinery-works
426•chmaynard•20h ago•134 comments

I built a Game Boy emulator in F#

https://nickkossolapov.github.io/fame-boy/building-a-game-boy-emulator-in-fsharp/
280•elvis70•17h ago•66 comments

Can I disable all data collection from my vehicle?

https://rivian.com/support/article/can-i-disable-all-data-collection-from-my-vehicle
634•Cider9986•14h ago•263 comments

How we run iSCSI over the internet

https://scsipub.com/blog/how-we-run-iscsi-over-the-internet
14•qdotme•1d ago•7 comments

You can beat the binary search

https://lemire.me/blog/2026/04/27/you-can-beat-the-binary-search/
321•vok•3d ago•143 comments

Roboticist-Turned-Teacher Built a Life-Size Replica of Eniac

https://spectrum.ieee.org/roboticist-turned-teacher-eniac-replica
31•oldnetguy•1d ago•8 comments

Reverse Engineering SimTower

https://phulin.me/blog/simtower
205•patrickhulin•2d ago•44 comments

New mechanical panoramic film camera from Jeff Bridges

https://wideluxx.com
150•armadsen•2d ago•68 comments

Canonical/Ubuntu have been under DDoS for more than 15h

https://status.canonical.com/#/incident/KNms6QK9ewuzz-7xUsPsNylV20jEt5kyKsd8A-3ptQEHpOd8VQ40ZQs-K...
51•jtlebigot•3h ago•14 comments

The Hearts of the Super Nintendo (2024)

https://fabiensanglard.net/snes_hearts/
29•droppedasbaby•8h ago•5 comments

Your Biggest Vulnerability is your Shitty Compensation

https://green.spacedino.net/your-biggest-vulnerability-is-your-shitty-compensation/
30•jfil•6h ago•13 comments

Using a 1978 terminal in 2026 (DEC VT-100)

https://nikhiljha.com/posts/vt100/
36•ninjha•2d ago•11 comments

Apple Says Mac Studio and Mac Mini Will Be in Short Supply for Months

https://www.macrumors.com/2026/04/30/mac-studio-mac-mini-constrained-months/
81•tosh•4h ago•64 comments