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.

Trans-Taiga Road:The farthest you can get from a town on a road in North America

https://www.jamesbayroad.com/ttr/index.html
55•jason_pomerleau•2h ago•13 comments

Whole-genome ancestry of an Old Kingdom Egyptian

https://www.nature.com/articles/s41586-025-09195-5
54•A_D_E_P_T•3h ago•21 comments

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

https://blog.mgdproductions.com/ikko-activebuds/
461•ajdude•13h ago•169 comments

More Efficient Thermoelectric Cooling

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

ASCIIMoon: The moon's phase live in ASCII art

https://asciimoon.com/
160•zayat•1d ago•59 comments

That XOR Trick (2020)

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

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

https://glass3d.dev/
242•kris-kay•12h ago•82 comments

Couchers is officially out of beta

https://couchers.org/blog/2025/07/01/releasing-couchers-v1
163•laurentlb•9h ago•67 comments

The Uncertain Future of Coding Careers and Why I'm Still Hopeful

https://jonmagic.com/posts/the-uncertain-future-of-coding-careers-and-why-im-still-hopeful/
12•mooreds•2h ago•7 comments

What to build instead of AI agents

https://decodingml.substack.com/p/stop-building-ai-agents
96•giuliomagnifico•3h ago•64 comments

Vitamin C Boosts Epidermal Growth via DNA Demethylation

https://www.jidonline.org/article/S0022-202X(25)00416-6/fulltext
53•gnabgib•7h ago•16 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/
89•tysone•9h ago•85 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/
45•jnord•6h ago•3 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/
13•gmays•1d ago•0 comments

A Higgs-Bugson in the Linux Kernel

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

The Zen of Quakerism (2016)

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

Features of D That I Love

https://bradley.chatha.dev/blog/dlang-propaganda/features-of-d-that-i-love/
86•vips7L•11h ago•64 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/
73•ZenithExtreme•11h ago•73 comments

The Evolution of Caching Libraries in Go

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

Gene therapy restored hearing in deaf patients

https://news.ki.se/gene-therapy-restored-hearing-in-deaf-patients
301•justacrow•12h ago•74 comments

Microsoft Will Delete Your Passwords in One Month

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

gmailtail: tail -f Your Gmail

https://github.com/c4pt0r/gmailtail
14•c4pt0r•3h ago•0 comments

A list is a monad

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

Evidence of a 12,800-year-old shallow airburst depression in Louisiana

https://www.scienceopen.com/hosted-document?doi=10.14293/ACI.2025.0004
100•keepamovin•1d ago•50 comments

Websites hosting major US climate reports taken down

https://apnews.com/article/climate-change-national-assessment-nasa-white-house-057cec699caef90832d8b10f21a6ffe8
249•geox•6h ago•132 comments

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

https://www.w3.org/QA/Tips/noClickHere
453•theandrewbailey•16h ago•318 comments

MindsDB (YC W20) is hiring an AI solutions engineer

https://job-boards.greenhouse.io/mindsdb/jobs/4770283007
1•adam_carrigan•10h ago

Escher's art and computer science

https://github.com/gritzko/librdx/blob/master/blog/escher.md
41•signa11•1d ago•7 comments

Private sector lost 33k jobs, badly missing expectations of 100k increase

https://www.cnbc.com/2025/07/02/adp-jobs-report-june-2025.html
421•ceejayoz•14h ago•254 comments

Efficient set-membership filters and dictionaries based on SAT

https://github.com/NationalSecurityAgency/XORSATFilter
35•keepamovin•3d ago•7 comments