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.

How Delhi cut electricity loss from 50 to 5 percent

https://spectrum.ieee.org/delhi-electricity-loss
272•rbanffy•3h ago•157 comments

A Privacy Analysis of Web and Mobile Conversational AI Agents [pdf]

https://jorgegarciaherrero.com/wp-content/interactivos/20260916-Prompt-like-a-butterfly-sting-lik...
360•damaru2•7h ago•116 comments

Jeeves. Reasoning improves Jev-like decision models

https://github.com/PostHog/jeeves
171•nicowaltz•5h ago•70 comments

Without the Hot Air

https://www.withouthotair.com/
79•0sake_rs•4h ago•42 comments

Walking Men

https://bookofjoe2.blogspot.com/2026/09/walking-men.html
23•surprisetalk•1d ago•2 comments

You are no longer invited to dinner

https://www.derekthompson.org/p/the-death-of-the-american-host
498•barry-cotter•5h ago•437 comments

Using any C++ library in Godot

https://blog.conan.io/cpp/conan/gamedev/godot/cmake/2026/09/29/Using-Any-Cpp-Library-In-Godot.html
131•czoido•8h ago•37 comments

Digital Audio on the ZX Spectrum's 1-Bit Beeper

https://bumbershootsoft.wordpress.com/2026/09/26/digital-audio-on-the-zx-spectrums-1-bit-beeper/
32•ibobev•1d ago•12 comments

Phyllotaxis: An audio-reactive LED display

https://jagi.studio/posts/phyllotaxis/
212•evakhoury•1d ago•31 comments

Why Doesn't Anyone Want to Fix One of America's Scariest Roads?

https://www.newyorker.com/magazine/2026/10/05/why-doesnt-anyone-want-to-fix-one-of-americas-scari...
28•adrianhon•2h ago•39 comments

Google ending ChromeOS support two years early

https://www.theregister.com/os-platforms/2026/09/29/google-ending-chromeos-support-two-years-earl...
86•rbanffy•2h ago•53 comments

macOS Golden Gate Is a Buggy Mess

https://www.squareorbits.com/blog/2026/09/macos-golden-gate-is-a-buggy-mess/
263•SquareOrbits•2h ago•178 comments

1 in 8 cancer cases worldwide are caused by infections, study finds

https://www.cbc.ca/lite/story/9.7361622
112•colinprince•4h ago•74 comments

Show HN: Jevstiller – Distill Jev into a local model, with a disagreement bound

https://jevstiller.pages.dev/posts/the-guarantee/
31•tgluck•4h ago•4 comments

Virus Stole a Human Gene and Won't Let Go of It

https://www.nytimes.com/2026/09/28/science/virus-molluscum-human-gene.html
4•gumby•20h ago•0 comments

Georeferencing Chernarus and visiting in real life (2021)

https://longcreek.me/blog/2021/chernarus-irl
15•carlos-menezes•1d ago•4 comments

Booted up in 1993, this server still runs – but not for much longer (2017)

https://www.computerworld.com/article/1673071/booted-up-in-1993-this-server-still-runs-but-not-fo...
150•doener•1d ago•74 comments

California farmers are struggling to sell grapes as demand for wine drops

https://www.kqed.org/news/12101534/california-farmers-are-struggling-to-sell-grapes-as-demand-for...
331•randycupertino•20h ago•792 comments

500k facial scans at UK stations yield no arrests, 1 false positive

https://www.theguardian.com/technology/2026/sep/29/trial-live-facial-recognition-cameras-london-s...
354•ilamont•5h ago•226 comments

Show HN: Raven – The harness of harnesses, built for RSI

https://github.com/EverMind-AI/Raven
48•cyfyifanchen•6h ago•37 comments

The systems that no one will test

https://blog.christianperone.com/2026/09/the-systems-that-no-one-will-test/
127•perone•1d ago•57 comments

Software occlusion culling in Block Game

https://enikofox.com/posts/software-rendered-occlusion-culling-in-block-game/
74•airhangerf15•2d ago•7 comments

Show HN: NSL – WSL for Linux

https://frostyard.github.io/nsl/
12•bketelsen•1h ago•9 comments

Pirating the Pirates

https://mubi.com/en/notebook/posts/pirating-the-pirates
667•piotrgrabowski•1d ago•339 comments

DraftKings Is Using AI to Behaviorally Target Chronic Gamblers

https://www.eff.org/deeplinks/2026/09/draftkings-using-ai-supercharge-harms-online-behavioral-adv...
4•paimapi•10m ago•0 comments

Four CHI '26 papers I wish I wrote

https://countingfromzero.blog/2026/04/24/four-chi-26-papers-i-wish-i-wrote/
37•luu•2d ago•10 comments

Optimizing x264 settings and per-title ladders

https://streaminglearningcenter.com/articles/optimizing-x264-settings-and-per-title-ladders.html
23•dabinat•3d ago•5 comments

The Beatles have permeated research papers across academic disciplines

https://phys.org/news/2026-09-beatles-permeated-papers-academic-disciplines.html
18•pseudolus•2d ago•13 comments

Tank Body Problem

http://www.jimsitu.com
167•jimbooonooo•15h ago•38 comments

MicroLLM Lab – Try 7 tiny LLM's in the browser

https://stateofutopia.com/experiments/microllmlab/
270•logicallee•21h ago•99 comments