frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

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•1mo ago

Comments

RedShift1•1mo ago
It'll be a cold day in hell before I start throwing away my 80+ "New" notepad++ tabs.
notTooFarGone•1mo 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•1mo 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•1mo 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•1mo 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•1mo 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•1mo 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•1mo 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•1mo 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•1mo 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•1mo 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•1mo 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.

Fei-Fei Li: Spatial intelligence is the next frontier in AI [video]

https://www.youtube.com/watch?v=_PioN-CpOP0
58•sandslash•1d ago•17 comments

Third Interstellar Object Discovered

https://minorplanetcenter.net/mpec/K25/K25N12.html
67•gammarator•3h ago•23 comments

Trans-Taiga Road (2004)

https://www.jamesbayroad.com/ttr/index.html
93•jason_pomerleau•5h ago•36 comments

Whole-genome ancestry of an Old Kingdom Egyptian

https://www.nature.com/articles/s41586-025-09195-5
80•A_D_E_P_T•6h ago•36 comments

We reimagined Transformer architectures inspired by nature's hidden structures

https://ieeexplore.ieee.org/document/10754699
3•subediaarjun•28m ago•0 comments

Exploiting the IKKO Activebuds “AI powered” earbuds (2024)

https://blog.mgdproductions.com/ikko-activebuds/
486•ajdude•16h ago•184 comments

Nano-engineered thermoelectrics enable scalable, compressor-free cooling

https://www.jhuapl.edu/news/news-releases/250521-apl-thermoelectrics-enable-compressor-free-cooling
53•mcswell•2d ago•21 comments

ASCIIMoon: The moon's phase live in ASCII art

https://asciimoon.com/
188•zayat•1d ago•66 comments

That XOR Trick (2020)

https://florian.github.io//xor-trick/
85•hundredwatt•2d ago•44 comments

Conversations with a Hit Man

https://magazine.atavist.com/confessions-of-a-hit-man-larry-thompson-jim-leslie-george-dartois-louisiana-shreveport-cold-case/
43•gmays•1d ago•1 comments

Next month, saved passwords will no longer be in Microsoft’s Authenticator app

https://www.cnet.com/tech/microsoft-will-delete-your-passwords-in-one-month-do-this-asap/
72•ColinWright•2d ago•72 comments

Gmailtail – Command-line tool to monitor Gmail messages and output them as JSON

https://github.com/c4pt0r/gmailtail
46•c4pt0r•6h ago•7 comments

Couchers is officially out of beta

https://couchers.org/blog/2025/07/01/releasing-couchers-v1
181•laurentlb•12h ago•76 comments

Show HN: CSS generator for a high-def glass effect

https://glass3d.dev/
271•kris-kay•14h ago•84 comments

Vitamin C Boosts Epidermal Growth via DNA Demethylation

https://www.jidonline.org/article/S0022-202X(25)00416-6/fulltext
80•gnabgib•10h ago•25 comments

A Higgs-Bugson in the Linux Kernel

https://blog.janestreet.com/a-higgs-bugson-in-the-linux-kernel/
88•Ne02ptzero•12h ago•9 comments

Features of D That I Love

https://bradley.chatha.dev/blog/dlang-propaganda/features-of-d-that-i-love/
113•vips7L•13h ago•77 comments

What to build instead of AI agents

https://decodingml.substack.com/p/stop-building-ai-agents
141•giuliomagnifico•6h ago•90 comments

AI note takers are flooding Zoom calls as workers opt to skip meetings

https://www.washingtonpost.com/technology/2025/07/02/ai-note-takers-meetings-bots/
137•tysone•12h ago•144 comments

Websites hosting major US climate reports taken down

https://apnews.com/article/climate-change-national-assessment-nasa-white-house-057cec699caef90832d8b10f21a6ffe8
311•geox•9h ago•149 comments

The Zen of Quakerism (2016)

https://www.friendsjournal.org/the-zen-of-quakerism/
99•surprisetalk•3d ago•80 comments

The Evolution of Caching Libraries in Go

https://maypok86.github.io/otter/blog/cache-evolution/
98•maypok86•3d ago•24 comments

Sony's Mark Cerny Has Worked on "Big Chunks of RDNA 5" with AMD

https://overclock3d.net/news/gpu-displays/sonys-mark-cerny-has-worked-on-big-chunks-of-rdna-5-with-amd/
78•ZenithExtreme•14h ago•82 comments

Gene therapy restored hearing in deaf patients

https://news.ki.se/gene-therapy-restored-hearing-in-deaf-patients
318•justacrow•15h ago•77 comments

Demonstration of Algorithmic Quantum Speedup for an Abelian Hidden Subgroup

https://journals.aps.org/prx/abstract/10.1103/PhysRevX.15.021082
4•boilerupnc•2h ago•0 comments

LLMs as Compilers

https://resync-games.com/blog/engineering/llms-as-compiler
11•kadhirvelm•4h ago•13 comments

Physicists Start to Pin Down How Stars Forge Heavy Atoms

https://www.quantamagazine.org/physicists-start-to-pin-down-how-stars-forge-heavy-atoms-20250702/
54•jnord•9h ago•3 comments

I'm a physicist by trade, not by training, and that matters

https://csferrie.medium.com/im-a-physicist-by-trade-not-by-training-and-that-matters-70cd0e66b2c8
4•MaysonL•1d ago•1 comments

Don’t use “click here” as link text (2001)

https://www.w3.org/QA/Tips/noClickHere
468•theandrewbailey•19h ago•324 comments

A list is a monad

https://alexyorke.github.io//2025/06/29/a-list-is-a-monad/
132•polygot•3d ago•147 comments