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.

Plug-in solar is coming. Plug-in batteries should follow

https://www.regen.co.uk/insights/plug-in-solar-is-coming-plug-in-batteries-should-follow
55•thelastgallon•1h ago•30 comments

Go 1.27 Interactive Tour

https://victoriametrics.com/blog/go-1-27/index.html
84•Hixon10•2h ago•21 comments

MkLinux and the pimped-out Apple Workgroup Server 9150

http://oldvcr.blogspot.com/2026/08/mklinux-and-pimped-out-apple-workgroup.html
19•goldenskye•1h ago•1 comments

Seedance 2.5

https://seed.bytedance.com/en/blog/one-take-creation-flexible-referencing-introducing-seedance-2-5
225•njaremko•7h ago•110 comments

Diátaxis

https://diataxis.fr/
247•ryanseys•7h ago•33 comments

ASRock BC-250: Building the Budget Steam Machine

https://plug-world.com/posts/2026/asrock-bc250-the-budget-steam-machine/
31•plug_world•2h ago•7 comments

Deep-sea vehicles spot 'alien' sharks deep beneath the waves in the Pacific

https://www.science.org/content/article/deep-sea-vehicles-spot-alien-sharks-deep-beneath-waves-pa...
14•pkaeding•1h ago•2 comments

Show HN: I'm a 15 Year Old Wannabe Engineer, This Is a Cycloidal Gearbox I Built

https://github.com/tom-ilan/cycloidal_gearbox
49•tomilan•2h ago•14 comments

RFC 10015: Deprecating Obsolete Key Exchange Methods in TLS 1.2 and DTLS 1.2

https://www.rfc-editor.org/rfc/rfc10015.html
43•Jimmc414•4h ago•5 comments

AI financial advice is surprisingly good, especially if you ask right questions

https://mitsloan.mit.edu/ideas-made-to-matter/ai-financial-advice-surprisingly-good-especially-if...
221•foxtrot8672•6h ago•196 comments

Unraveling the mysteries of habit formation

https://www.kyoto-u.ac.jp/en/research-news/2026-07-28
50•hhs•5h ago•18 comments

Postmortem for Kernel Soundness Bug #14576

https://leodemoura.github.io/blog/2026-8-1-postmortem-for-kernel-soundness-bug-14576/
128•juhopitk•9h ago•45 comments

When random.bytes() runs but doesn't work

https://insider.btcpp.dev/p/when-randombytes-runs-but-doesnt
8•Funes-•2h ago•0 comments

Show HN: CostPerPrompt – Live AI API pricing and real-workload cost calculators

https://costperprompt.com/
6•ahmed_hassan7•2h ago•2 comments

But can your calculator run Linux?

https://raymii.org/s/articles/But_can_your_calculator_run_Linux.html
76•jandeboevrie•8h ago•6 comments

Four Time Scales for Technology Development and Deployment

https://rodneybrooks.com/four-time-scales-for-technology-development-and-deployment/
14•jeffreyrogers•1h ago•1 comments

Morph (YC S23) Is Hiring Member of Technical Staff

https://www.ycombinator.com/companies/morph/jobs/0Z8vI3K-member-of-technical-staff
1•bhaktatejas922•5h ago

The Art of 64-bit Assembly

https://nostarch.com/art-64-bit-assembly-v2
209•0x54MUR41•14h ago•90 comments

China begins producing advanced chipmaking deep-ultraviolet lithography machines

https://www.reuters.com/world/china/china-starts-production-home-grown-immersion-duv-chipmaking-t...
52•ck2•2d ago•38 comments

How Google helped destroy adoption of RSS feeds (2023)

https://openrss.org/blog/how-google-helped-destroy-adoption-of-rss-feeds
456•pudgywalsh•10h ago•159 comments

We accidentally built an LLVM compiler for Jax

https://iza.ac/posts/2026/07/accidental-llvm-compiler-for-jax/
23•infinitewalk•2d ago•8 comments

Nyctography: A substituton cypher by Lewis Carroll

https://en.wikipedia.org/wiki/Nyctography
60•nanna•4d ago•8 comments

NetBSD 11.0

https://blog.netbsd.org/tnf/entry/netbsd_11_0_released
237•jaypatelani•10h ago•107 comments

Kenji/Serious Eats – 30-Min Pressure Cooker Pho Ga

https://www.seriouseats.com/30-minute-pressure-cooker-pho-ga-recipe
116•stasomatic•12h ago•66 comments

Explorative modeling: Train on the best of K guesses

https://alexiglad.github.io/blog/2026/explorative_modeling/
87•DSemba•13h ago•24 comments

The Theater of Sport: Bill Buford Revisits Among the Thugs

https://www.theparisreview.org/blog/2026/07/29/the-theater-of-sport-bill-buford-revisits-among-th...
9•Thevet•3d ago•1 comments

Atom is better than RSS, in ways that matter

https://chrismorgan.info/atom%3Erss
26•frizlab•6h ago•3 comments

CISA Alert: Water Sector PLC Targeting

https://censys.com/blog/cisa-alert-water-tower-plc-targeting/
85•speckx•9h ago•60 comments

Glyphs 4 – the leading Mac font editor

https://glyphsapp.com
67•microflash•4d ago•10 comments

Linux on ESP32

https://github.com/GrieferPig/esp32-s31-linux
106•boveyking•4d ago•37 comments