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.

EEG shows brain can simultaneous encode two speech streams

https://journals.plos.org/plosbiology/article?id=10.1371/journal.pbio.3003876
110•giuliomagnifico•4h ago•59 comments

Kimi K3: Open Frontier Intelligence

https://www.kimi.com/blog/kimi-k3
1666•vincent_s•19h ago•980 comments

Pebble Mega Update – July 2026

https://repebble.com/blog/pebble-mega-update-july-2026
127•crazysaem•6h ago•49 comments

How Has Roman Concrete Lasted for Millennia? 1,900-Year-Old Latrine Offers Clues

https://www.smithsonianmag.com/smart-news/how-has-roman-concrete-lasted-for-millennia-a-1900-year...
135•divbzero•6h ago•98 comments

Microsoft Comic Chat is now open source

https://opensource.microsoft.com/blog/2026/07/16/microsoft-comic-chat-is-now-open-source/
693•jervant•18h ago•153 comments

Decoy Font

https://www.mixfont.com/experiments/decoy-font
565•ray__•18h ago•131 comments

An Engineer's Guide to USB Typе-С (2024)

https://www.ti.com/lit/eb/slyy228/slyy228.pdf?ts=1759892558029
179•gregsadetsky•6d ago•17 comments

LM Studio Bionic: the AI agent for open models

https://lmstudio.ai/blog/introducing-lm-studio-bionic
260•minimaxir•14h ago•91 comments

Starlink from 1984

https://nemanjatrifunovic.substack.com/p/starlink-from-1984
40•ingve•5d ago•15 comments

Solod: Go can be a better C

https://solod.dev
140•koeng•3d ago•76 comments

$100 AI Music Video: Claude Fable 5 vs. GPT-5.6 Sol

https://www.tryai.dev/blog/ai-music-video-arena-claude-vs-gpt-5.6
284•hershyb_•14h ago•376 comments

The Little Book of Reinforcement Learning

https://github.com/alxndrTL/little-book-rl/
143•mustaphah•12h ago•17 comments

NotebookLM is now Gemini Notebook

https://blog.google/innovation-and-ai/products/gemini-notebook/notebooklm-gemini-notebook/
312•xnx•18h ago•159 comments

I Owe My Life to the Commodore 64

https://www.goto10retro.com/p/i-owe-my-life-to-the-commodore-64
11•ingve•1h ago•0 comments

In Praise of Exhaustive Destructuring

https://antoine.vandecreme.net/blog/exhaustive-destructuring-praise/
22•avandecreme•5d ago•5 comments

Old Icons

https://leancrew.com/all-this/2026/07/old-icons/
63•zdw•5d ago•14 comments

Immersive Linear Algebra Book with Interactive Figures (2015)

https://immersivemath.com/ila/
234•srean•19h ago•27 comments

Detecting LLM-Generated Texts with “Classical” Machine Learning

https://blog.lyc8503.net/en/post/llm-classifier/
204•uneven9434•18h ago•147 comments

Helium escaping from atmosphere of nearby rocky exoplanet in a habitable zone

https://www.science.org/doi/10.1126/science.aea9708
112•anyonecancode•14h ago•33 comments

Camera Chase Vehicle

https://transistor-man.com/gimbal_camera_rover.html
16•geerlingguy•1w ago•0 comments

Mathematics of Data Science

https://arxiv.org/abs/2607.11938
167•Anon84•14h ago•9 comments

GrapheneOS recommended for domestic abuse victims

https://privacypros.com.au/privacy-hub/articles/dv-safe-phone-australia/
157•aussieguy1234•9h ago•126 comments

'Likweli': A new monkey species discovered in the Congo Basin

https://news.yale.edu/2026/07/15/meet-likweli-new-monkey-species-discovered-congo-basin
83•gmays•12h ago•18 comments

CD sales growth outpaced vinyl in the first half of 2026

https://consequence.net/2026/07/the-cd-revival-is-getting-hard-to-ignore/
116•speckx•17h ago•124 comments

Solving Santa Claus Puzzle

https://wyounas.github.io/puzzles/concurrency/2026/01/10/how-to-help-santa-claus-concurrently/
5•simplegeek•5d ago•1 comments

The human-in-the-loop is tired

https://pydantic.dev/articles/the-human-in-the-loop-is-tired
226•haritha1313•10h ago•124 comments

The LLM Critics Are Right. I Use LLMs Anyway

https://www.theocharis.dev/blog/llm-critics-are-right-i-use-llms-anyway/
233•JeremyTheo•22h ago•244 comments

How to Train a Gen AI Kick Drum Model on Your Old Linux Desktop with 6GB VRAM

https://www.zhinit.dev/blog/training-a-kick-drum-diffusion-model
139•zhinit•19h ago•65 comments

Show HN: Clx – Compile Lua to Native Executables Through C++20

https://github.com/samyeyo/clx
119•_samt_•5d ago•20 comments

Goes-19 weather satellite enters Safe Hold mode

https://www.spaceweather.gov/news/goes-19-safe-hold
166•yabones•21h ago•84 comments