frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Avoid Continue

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

Comments

zoezoezoezoe•7mo 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•7mo 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.

Can There Ever Be Too Many Options? A Meta-Analytic Review of Choice Overload

https://academic.oup.com/jcr/article-abstract/37/3/409/1827647?redirectedFrom=fulltext&login=false
1•NavinF•22s ago•0 comments

Ask HN: Did ADHD treatment unlock your ability to work on self-directed work?

1•dkarras•5m ago•0 comments

The Agency Continuum

https://bikeshedding.substack.com/p/the-agency-continuum
1•zettacio•6m ago•0 comments

Robots that spare warehouse workers the heavy lifting

https://news.mit.edu/2025/robots-spare-warehouse-workers-heavy-lifting-1205
1•meysamazad•21m ago•0 comments

Dockge: Self-hosted – Docker compose.yaml – Stack-oriented Manager

https://dockge.kuma.pet/
1•thunderbong•31m ago•0 comments

US regulators open Tesla probe after reports of children trapped in cars

https://www.bbc.com/news/articles/c203q2ywn88o
2•belter•32m ago•1 comments

Memory research: How respiration shapes remembering

https://www.lmu.de/en/newsroom/news-overview/news/memory-research-how-respiration-shapes-remember...
1•XzetaU8•34m ago•0 comments

Ask HN: A dumb game of dimensional analysis

1•egoism•40m ago•0 comments

Opus 4.5 Review (Custom Plan)

1•tactics6655•43m ago•0 comments

Cloudflare Has Blocked 416B AI Bot Requests Since July 1

https://www.wired.com/story/big-interview-event-matthew-prince-cloudflare/
3•aspenmayer•49m ago•2 comments

A Quiet Chinese Mobile Giant in Africa [video]

https://www.youtube.com/watch?v=PiXEJ6qe_Cg
1•mgh2•49m ago•0 comments

U.S. Unauthorized Immigrant Population Reached a Record 14M in 2023

https://www.pewresearch.org/race-and-ethnicity/2025/08/21/u-s-unauthorized-immigrant-population-r...
2•frasermarlow•50m ago•0 comments

Pete Hegseth is unfit to lead The Pentagon

https://www.ft.com/content/5dd72971-79e9-4ac8-8f2d-e230fb25c3b9
3•petethomas•52m ago•0 comments

The story of Mr DeepFakes – the world’s most notorious AI porn site

https://www.theguardian.com/society/ng-interactive/2025/dec/05/it-was-about-degrading-someone-com...
2•c420•53m ago•1 comments

Twine, the Video-Game Technology for All (2014)

https://www.nytimes.com/2014/11/23/magazine/twine-the-video-game-technology-for-all.html
2•sogen•59m ago•0 comments

CME Outage Shows Challenge of Keeping Data Centers Cool

https://www.bloomberg.com/news/articles/2025-11-28/cme-outage-how-are-data-centers-cooled-what-ha...
1•gmays•59m ago•0 comments

AI Predictions for 2026

https://www.aithings.dev/blog/2026-ai-predictions
1•irere123•1h ago•0 comments

Volcanic eruption might have helped bring the Black Plague to Europe

https://www.sciencenews.org/article/volcanic-eruption-black-plague-europe
2•mzs•1h ago•1 comments

PromptPwnd: Prompt Injection Vulnerabilities in GitHub Actions Using AI Agents

https://www.aikido.dev/blog/promptpwnd-github-actions-ai-agents
2•devy•1h ago•1 comments

Civic Nationalism

https://en.wikipedia.org/wiki/Civic_nationalism
1•CGMthrowaway•1h ago•0 comments

The economics of Pantone and its colours

https://finshots.in/archive/the-economics-of-pantone-color-of-the-year-cloud-dancer/
1•vismit2000•1h ago•0 comments

November CVEs Fell 25% YoY, Driven by Slowdowns at Major CNAs

https://socket.dev/blog/november-cves-fell-25-yoy-driven-by-slowdowns-at-major-cnas
1•feross•1h ago•0 comments

Reverse Benchmarking

https://www.dominiknitsch.com/reverse-benchmarking/
1•wseqyrku•1h ago•0 comments

On the trail of Borneo's bay cat, one of the most mysterious felines

https://news.mongabay.com/2024/04/on-the-trail-of-borneos-bay-cat-one-of-the-worlds-most-mysterio...
2•thunderbong•1h ago•0 comments

Intellivision Sprint by Atari

https://atari.com/products/intellivision-sprint
2•evo_9•1h ago•0 comments

QtkTest: Go-To Human Benchmark Tool

https://qtktest.com/
1•yimiqidage001•1h ago•0 comments

Patents and Open Source: Understanding the Risks and Available Solutions

https://opensource.org/blog/patents-and-open-source-understanding-the-risks-and-available-solutio...
1•gslin•1h ago•0 comments

How to speed up the Rust compiler in December 2025

https://nnethercote.github.io/2025/12/05/how-to-speed-up-the-rust-compiler-in-december-2025.html
3•todsacerdoti•1h ago•0 comments

What I Learned from Vibe-Coding Auth with AI

https://fusionauth.io/blog/vibe-coding-authentication
2•mooreds•1h ago•0 comments

Trustworthy software through non-profits?

https://www.more-magic.net/posts/trustworthy-software-through-non-profits.html
2•sjamaan•1h ago•0 comments