frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

Avoid Continue

https://www.teamten.com/lawrence/programming/avoid-continue.html
2•todsacerdoti•1y ago

Comments

zoezoezoezoe•1y ago
I dont know if I fully agree. Sure, there is definitely an argument the be had about whether or not `continue` is the best word to use in this instance, but why avoid it entirely? Every programmer is able to easily understand what code like this would do:

``` for (Node node : nodeList) { if (node.isBad()) { continue; } processNode(node); } ```

Every keyword in any programming language is largely arbitrary in my opinion let's take a look at the beginning of the codeblock `for (Node node : nodeList)` also completely arbitrary, though it's clear to anyone who's ever written C++ that it is equivalent to saying "for every node in nodeList".

Continue is not meant to read as "continue execution" it's meant to be "continue to the next item of the list", and I think avoiding it entirely is a pointless effort.

Ukv•1y ago
I feel `skip` may have been a better name, but disagree with it being logically difficult to parse beyond that.

If I'm reading a loop and see

    for x in y {
        if exclusions.contains(x) { skip; }
        if x.children.length == 0 { skip; }
        if os.file.exists(x.name) { skip; }
        ...
I instantly know that processing for those elements is skipped, and they won't be relevant for the rest of the loop.

Whereas if I see

    for x in y {
        if !exclusions.contains(x) {
            if x.children.length != 0 {
                if !os.file.exists(x.name) {
        ...
I feel like there's still mental overload with not knowing where those `if` blocks end, and so having to keep the conditions in mind. It doesn't immediately tell me that the rest of the loop is being skipped.

The `log()` mistake seems no less likely to happen using early-returns in function instead, and I'd argue nesting checks actually introduces more room for that kind of error overall, where you append something at the end within the wrong set of brackets, compared to a flatter structure.

GitHub – schlarpc/re-shell: Nix-powered agentic reverse engineering environment

https://github.com/schlarpc/re-shell/
1•lifeisstillgood•43s ago•0 comments

I built a low-latency AI companion that plays Skyrim with me

https://pantel.is/projects/ai-gaming-companion/
1•pantelisk•1m ago•0 comments

Brandolini's Law

https://en.wikipedia.org/wiki/Brandolini%27s_law
1•vismit2000•2m ago•0 comments

Know Your Paradoxes

https://blog.coredump.cx/p/know-your-paradoxes
1•surprisetalk•3m ago•0 comments

The Free Instance Search

https://liamprosser77.github.io/gronnfalk/
1•Gronnfalk•4m ago•0 comments

The Debt That Apple Owes to the CIA

https://www.wsj.com/tech/steve-jobs-apple-next-cia-161b65f9
1•MilnerRoute•5m ago•1 comments

Show HN: UBOM now has attributes and artifacts

https://github.com/comalice/ubom-v4
1•all2•18m ago•0 comments

Show HN: Dddiscover – a rabbit hole for images, quotes, podcasts, and facts

https://dddiscover.com
1•hidelooktropic•26m ago•0 comments

MIT Researchers Develop Generative AI Tool to Boost Database Searches

https://aibusiness.com/data/mit-researchers-develop-generative-ai-tool-to-boost-database-searches
1•caruasdo•26m ago•0 comments

Durable tribal knowledge for all your AI agents

https://fixdoc.dev/
1•supercech•27m ago•0 comments

Show HN: A directory of vibe-coded or AI built games

https://aibuiltgames.com/
3•rrmdp•37m ago•3 comments

Tracker in rare book ends up in Amazon facility destroying books to train AI

https://www.tomshardware.com/tech-industry/artificial-intelligence/secret-tracking-device-placed-...
5•emptybits•38m ago•0 comments

Everything I own, owned

https://schlarp.com/posts/everything-i-own-owned/
43•schlarpc•38m ago•7 comments

Top Shit: The Wheel of Paid Mediocrity

https://topshit.lol
1•insomnie•40m ago•0 comments

Why Aging May Be a Program, Not a Breakdown

https://www.quantamagazine.org/why-aging-may-be-a-program-not-a-breakdown-20260814/
2•marojejian•40m ago•1 comments

Flock CEO calls for 'compromise' as surveillance company faces growing backlash

https://techcrunch.com/2026/08/23/flock-ceo-calls-for-compromise-as-surveillance-company-faces-gr...
2•cocacola1•43m ago•0 comments

Cal Fire/USFS Aerial Firefighting Drop Safety (2019) [video]

https://www.youtube.com/watch?v=ONdSoiI4zIA
1•CaliforniaKarl•43m ago•0 comments

GCC Patch Adjusting AMD Zen 5 Misprediction Cost Nets 12% Win in Benchmark

https://www.phoronix.com/news/AMD-Zen-5-Mispredict-Cost
1•Alephinitesimal•44m ago•0 comments

Coupling free electrons to a trapped-ion quantum computer

https://arxiv.org/abs/2601.11446
1•rbanffy•44m ago•0 comments

I Tried to Solve Hangman

https://ballparkfigures.substack.com/p/hangman
1•jffry•45m ago•1 comments

GOP issues stark warning to AI companies

https://www.axios.com/2026/08/19/gop-data-center-memo-ai-election
2•adletbalzhanov•48m ago•3 comments

Show HN: World Models 101 - an interactive guide to World Models

https://worldmodels101.com/chapters/what-is-a-world-model
2•Niluk•52m ago•0 comments

Higher-Order List Operations

https://matt.might.net/articles/higher-order-list-operations/
2•azhenley•52m ago•0 comments

Linus Torvalds uses AI to debug an Intel GPU driver bug

https://github.com/torvalds/linux/commit/818bebeb63dd6bf5f4e07e145f6cdbace520a34c
5•birdculture•53m ago•0 comments

Fires are turning Forests into shrubland in America's West

https://www.nytimes.com/2026/08/23/climate/wildfire-forest-loss-california-southwest.html
2•cwwc•54m ago•1 comments

For anyone looking to make resumes

https://justquicktools.com/resume-builder
1•officialjerryno•55m ago•0 comments

Show HN: Kit – Not another events app

https://trykit.io/
1•sagsanne•1h ago•0 comments

Show HN: Locality – Sync engine to mount apps like Notion, Gmail as a filesystem

https://github.com/codeflash-ai/locality
1•misrasaurabh1•1h ago•0 comments

You can never go home again. But you can spend a lifetime trying

https://www.dwell.com/article/moving-out-of-your-childhood-home-john-petrarca-architect-b6d045d1-...
2•NaOH•1h ago•0 comments

CAD Benchmark

https://www.seldon.global/blog/cadbench
1•hmokiguess•1h ago•0 comments