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.

Japan develops a method to recover up to 90% of lithium from used EV batteries

https://tech.supercarblondie.com/japan-recovers-up-to-90-of-lithium-from-used-ev-batteries/
404•donohoe•6h ago•95 comments

YouTrackDB is a general-use object-oriented graph database

https://github.com/JetBrains/youtrackdb
102•gjvc•4h ago•29 comments

The Git history command deserves more attention

https://lalitm.com/post/git-history/
263•turbocon•7h ago•150 comments

Fundamentals of Wireless Communication (2005)

https://web.stanford.edu/~dntse/wireless_book.html
121•teleforce•6h ago•4 comments

Alternative(s) to run CUDA on non-Nvidia hardware

https://www.hpcwire.com/2026/07/09/spectral-compute-aims-to-set-cuda-free-will-it-succeed/
3•alok-g•4m ago•0 comments

How to build a circular LCD clock

https://blinry.org/lcd-clock/
74•birdculture•2d ago•24 comments

Building and shipping Mac and iOS apps without opening Xcode

https://scottwillsey.com/building-and-shipping-mac-and-ios-apps-without-ever-opening-xcode/
453•speckx•14h ago•196 comments

Australian energy retailers must provide three hours of free daytime electricity

https://lenergy.com.au/free-daytime-electricity-is-coming-heres-how-it-actually-works/
54•i2oc•3h ago•69 comments

Zero Knowledge Tolstoyan Art

https://max-amb.github.io/blog/zero_knowledge_tolstoyan_art/
7•max-amb•2d ago•0 comments

The Economics of Recursive Self-Improvement [pdf]

https://elasticity.institute/rsi-paper.pdf
83•apsec112•6h ago•27 comments

Is x86 ready to ACE it?

https://chipsandcheese.com/p/is-x86-ready-to-ace-it
71•mfiguiere•6h ago•10 comments

An Englishwoman who sketched India before photography took hold

https://www.bbc.com/news/articles/cm2drrv6q54o
140•1659447091•9h ago•38 comments

Satellite Tracker – Live Map of Starlink and 30k Satellites

https://satellitemap.space/
75•rolph•6h ago•32 comments

Jektex 0.2.0 – A Jekyll plugin for LaTeX rendering is now ~10x faster

https://github.com/yagarea/jektex
11•yagarea•2d ago•1 comments

MorphoHDL: A minimalistic language for growing circuits

https://paradigms-of-intelligence.github.io/morpho/
63•jacktang•7h ago•8 comments

World-First 'Super Alloy' Could Transform the Way Metals Are Made

https://www.sciencealert.com/world-first-super-alloy-could-transform-the-way-metals-are-made
58•tejohnso•4d ago•29 comments

Writing a bindless GPU abstraction layer

https://www.kevin-gibson.com/blog/writing-a-bindless-gpu-abstraction-layer/
42•surprisetalk•4d ago•2 comments

Two Case Studies of NaN

https://sebsite.pw/w/20260709-nan.html
10•ryantsuji•4d ago•1 comments

Our Amish Language

https://www.thedial.world/articles/news/amish-pennsylvania-dutch
42•NaOH•5h ago•19 comments

The infinite scroll may become endangered if controversial Calif. law passes

https://www.sfgate.com/politics/article/meta-social-media-teenagers-22337724.php
156•Stratoscope•13h ago•270 comments

The Anatomy of an Instruction Pipeline Hazard

https://hiraditya.github.io/posts/hardware-hazards-b200/
3•somnial•1h ago•0 comments

SalesPatriot (YC W25) Is Hiring Full Stack Engineers (SF)

https://jobs.ashbyhq.com/SalesPatriot/df223727-5781-433e-bc75-2aa5bf8dc8d7
1•maciejSz•11h ago

Linux 0.11 rewritten in idiomatic Rust, boots in QEMU

https://github.com/Poseidon-fan/linux-0.11-rs
94•arto•12h ago•83 comments

Nokia’s years of mobile-phone supremacy ended in an afternoon

https://spectrum.ieee.org/nokia-phones-history
106•jruohonen•18h ago•63 comments

Building Food Metadata with LLM Juries

https://careersatdoordash.com/blog/building-food-metadata-with-llm-juries-context-optimization-mu...
36•tie-in•6h ago•9 comments

OpenAI's Ad Business Is on Pace to Miss Its Own Forecast by 90%, Analyst Says

https://www.adweek.com/media/openais-ad-business-is-on-pace-to-miss-its-own-forecast-by-90-analys...
47•EvgeniyZh•3h ago•32 comments

Show HN: Benchmark your eng team's AI agent maturity in 5 minutes

https://agent-benchmarks.com/software-factory/
4•adamgold7•1h ago•0 comments

Linux on the Sega 32X. Who needs hardware synchronization primitives anyway?

https://cakehonolulu.github.io/linux-on-32x/
127•cakehonolulu•14h ago•25 comments

Indian scientists produce most detailed 3D atlas of the human brainstem

https://www.bbc.com/news/articles/cg53l737v1qo
3•BaudouinVH•1h ago•0 comments

Precursor

https://blog.cloudflare.com/introducing-precursor/
182•AznHisoka•17h ago•149 comments