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: TRELLIS.2 image-to-3D running on Mac Silicon – no Nvidia GPU needed

https://github.com/shivampkumar/trellis-mac
75•shivampkumar•3h ago•14 comments

A Brief History of Fish Sauce

https://www.legalnomads.com/fish-sauce/
98•vinhnx•18h ago•44 comments

Vercel April 2026 security incident

https://www.bleepingcomputer.com/news/security/vercel-confirms-breach-as-hackers-claim-to-be-sell...
584•colesantiago•13h ago•331 comments

The insider trading suspicions looming over Trump's presidency

https://www.bbc.com/news/articles/cge0grppe3po
165•blondie9x•1h ago•66 comments

The Bromine Chokepoint

https://warontherocks.com/cogs-of-war/the-bromine-chokepoint-how-strife-in-the-middle-east-could-...
166•crescit_eundo•9h ago•77 comments

Mechanical Keyboard Sounds - A listening Museum

https://sheets.works/data-viz/keyboard-sounds
43•akashwadhwani35•4d ago•12 comments

Turtle WoW classic server announces shutdown after Blizzard wins injunction

https://www.pcgamer.com/games/world-of-warcraft/turtle-wow-classic-server-announces-shutdown-afte...
142•Brajeshwar•11h ago•119 comments

Swiss AI Initiative (2023)

https://www.swiss-ai.org
26•doener•4h ago•7 comments

Ex-CEO, ex-CFO of bankrupt AI company charged with fraud

https://www.reuters.com/legal/government/ex-ceo-ex-cfo-bankrupt-ai-company-charged-with-fraud-202...
146•1vuio0pswjnm7•4h ago•61 comments

Changes in the system prompt between Claude Opus 4.6 and 4.7

https://simonwillison.net/2026/Apr/18/opus-system-prompt/
237•pretext•16h ago•136 comments

2,100 Swiss municipalities showing which provider handles their official email

https://mxmap.ch/
82•doener•4h ago•22 comments

Stop trying to engineer your way out of listening to people

https://ashley.rolfmore.com/stop-trying-to-engineer-your-way-out-of-listening-to-people/
45•walterbell•7h ago•4 comments

Claude Token Counter, now with model comparisons

https://simonwillison.net/2026/Apr/20/claude-token-counts/
13•twapi•2h ago•1 comments

Show HN: A lightweight way to make agents talk without paying for API usage

https://juanpabloaj.com/2026/04/16/a-lightweight-way-to-make-agents-talk-without-paying-for-api-u...
12•juanpabloaj•3h ago•4 comments

Prove you are a robot: CAPTCHAs for agents

https://browser-use.com/posts/prove-you-are-a-robot
62•lukasec•4d ago•32 comments

Interesting Map Geometry and Mathematics

https://www.markrjohnsongames.com/2026/04/11/ultima-ratio-regum-0-11-update-57-interesting-map-ge...
13•Hooke•1d ago•0 comments

Scientific datasets are riddled with copy-paste errors

https://www.sciencedetective.org/scientific-datasets-are-riddled-with-copy-paste-errors/
45•jruohonen•8h ago•8 comments

Six Levels of Dark Mode (2024)

https://cssence.com/2024/six-levels-of-dark-mode/
59•Akcium•8h ago•25 comments

Anthropic installed a spyware bridge on my machine?

https://www.thatprivacyguy.com/blog/anthropic-spyware/
36•twapi•47m ago•8 comments

The RAM shortage could last years

https://www.theverge.com/ai-artificial-intelligence/914672/the-ram-shortage-could-last-years
220•omer_k•20h ago•230 comments

I wrote a CHIP-8 emulator in my own programming language

https://github.com/navid-m/chip8emu
50•pizza_man•8h ago•13 comments

Archive of BYTE magazine, starting with issue #1 in 1975

https://archive.org/details/byte-magazine-1975-09
547•DamnInteresting•2d ago•142 comments

Show HN: A working reference implementation of context engineering

https://github.com/outcomeops/context-engineering
33•linsys•2d ago•10 comments

The seven programming ur-languages (2022)

https://madhadron.com/programming/seven_ur_languages.html
298•helloplanets•19h ago•116 comments

Sudo for Windows

https://github.com/microsoft/sudo
12•luispa•3h ago•3 comments

Nanopass Framework: Clean Compiler Creation Language

https://nanopass.org/
124•NordStreamYacht•4d ago•28 comments

Recovering Windows Live Writer Files

https://benovermyer.com/blog/2026/04/recovering-windows-live-writer-files/
11•bovermyer•5d ago•3 comments

Show HN: Faceoff – A terminal UI for following NHL games

https://www.vincentgregoire.com/faceoff/
104•vcf•9h ago•35 comments

Canada's PM calls economic ties with US a weakness that must be corrected

https://abcnews.com/Business/wireStory/canadas-prime-minister-economic-ties-us-weakness-corrected...
48•jmward01•3h ago•2 comments

Creating a Bootable Backup USB with Encryption (for Pop!OS Linux)

https://hajo.me/blog/2026/02/16/popos-linux-creating-bootable-backup-USB-with-encryption/
9•fxtentacle•2d ago•1 comments