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.

Americans Are Smashing Flock Cameras

https://stateofsurveillance.org/news/flock-cameras-destroyed-nationwide-ice-backlash-2026/
353•rolph•2h ago•252 comments

The occasional ECONNRESET

https://movq.de/blog/postings/2026-05-05/1/POSTING-en.html
41•zdw•2h ago•7 comments

I turned a $80 RK3562 Android tablet into a Debian Linux workstation

https://github.com/tech4bot/rk3562deb
140•tech4bot•5h ago•80 comments

I don't think AI will make your processes go faster

https://frederickvanbrabant.com/blog/2026-05-15-i-dont-think-ai-will-make-your-processes-go-faster/
375•TheEdonian•7h ago•280 comments

Mercurial, 20 years and counting: how are we still alive and kicking? [video]

https://fosdem.org/2026/schedule/event/AGWUVH-mercurial-aint-you-dead-yet/
38•ibobev•2d ago•8 comments

Security researcher says Microsoft built a Bitlocker backdoor, releases exploit

https://www.techspot.com/news/112410-security-researcher-microsoft-secretly-built-backdoor-bitloc...
442•nolok•5h ago•179 comments

EU weighs restricting use of US cloud platforms to process sensitive gov data

https://www.osnews.com/story/144943/eu-weighs-restricting-use-of-us-cloud-platforms-to-process-se...
79•abdelhousni•1h ago•24 comments

Schanuel's Conjecture and the Semantics of Triton's FPSan

https://cp4space.hatsya.com/2026/05/03/schanuels-conjecture-and-the-semantics-of-fpsan/
7•c1ccccc1•1d ago•1 comments

Hindenburg's Smoking Room

https://www.airships.net/hindenburg-smoking-room/
77•crescit_eundo•2d ago•37 comments

Dontsurveil.me

https://opencivics-labs.github.io/dontsurveil.me/c22.html
19•laurex•3h ago•3 comments

Meta deletes popular 1M follower account after Kuwaiti request

https://twitter.com/ryangrim/status/2055992439031185782
98•bhouston•2h ago•48 comments

Native all the way, until you need text

https://justsitandgrin.im/posts/native-all-the-way-until-you-need-text/
305•dive•7h ago•208 comments

Prolog Basics Explained with Pokémon

https://unplannedobsolescence.com/blog/prolog-basics-pokemon/
159•birdculture•2d ago•28 comments

CUDA Books

https://github.com/alternbits/awesome-cuda-books
60•dariubs•6h ago•9 comments

Every AI Subscription Is a Ticking Time Bomb for Enterprise

https://www.thestateofbrand.com/news/ai-subscription-time-bomb
313•mooreds•7h ago•312 comments

High-Entropy Alloy

https://en.wikipedia.org/wiki/High-entropy_alloy
64•leonidasrup•3d ago•8 comments

XS: A programming language. Anywhere, anytime, by anyone

https://xslang.org
32•yacin•4h ago•16 comments

AI is a technology not a product

https://daringfireball.net/2026/05/ai_is_technology_not_a_product
206•ch_sm•6h ago•74 comments

Apple Silicon costs more than OpenRouter

https://www.williamangel.net/blog/2026/05/17/offline-llm-energy-use.html
238•datadrivenangel•7h ago•200 comments

Zerostack – A Unix-inspired coding agent written in pure Rust

https://crates.io/crates/zerostack/1.0.0
511•gidellav•20h ago•283 comments

WHO Declares Ebola Outbreak a Global Health Emergency

https://www.nytimes.com/2026/05/17/world/africa/ebola-congo-uganda-who-public-health-emergency.html
219•zzzeek•5h ago•121 comments

Scientists "bottle the sun" with a liquid battery that stores solar energy

https://www.sciencedaily.com/releases/2026/05/260513221821.htm
8•ndr42•32m ago•1 comments

Mozilla to UK regulators: VPNs are essential privacy and security tools

https://blog.mozilla.org/netpolicy/2026/05/15/mozilla-to-uk-regulators-vpns-are-essential-privacy...
535•WithinReason•12h ago•231 comments

Don't Outsource the Learning

https://addyosmani.com/blog/dont-outsource-learning/
7•korecodes•3h ago•0 comments

Colossus: The Forbin Project

https://en.wikipedia.org/wiki/Colossus:_The_Forbin_Project
192•doener•2d ago•64 comments

A nicer voltmeter clock

https://lcamtuf.substack.com/p/a-nicer-voltmeter-clock
282•surprisetalk•20h ago•36 comments

Hosting a website on an 8-bit microcontroller

https://maurycyz.com/projects/mcusite/
207•zdw•17h ago•17 comments

Moving away from Tailwind, and learning to structure my CSS

https://jvns.ca/blog/2026/05/15/moving-away-from-tailwind--and-learning-to-structure-my-css-/
638•mpweiher•1d ago•355 comments

Agentic Trading with Safe Guardrails

https://github.com/ShurikenTrade/shuriken-skills
36•jgan0978•6h ago•17 comments

OpenAI and Government of Malta partner to roll out ChatGPT Plus to all citizens

https://openai.com/index/malta-chatgpt-plus-partnership/
292•bookofjoe•23h ago•308 comments