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.

Show HN: Critter TUI for reviewing GitHub PRs and agent changes

https://github.com/andyhmltn/critter
1•andy55a•58s ago•0 comments

Why Doctors Hate the Internet (2000)

https://www.wired.com/2000/04/why-doctors-hate-the-internet/
1•olalonde•1m ago•0 comments

Grand jury finds DeSantis administration "misappropriated" $10M

https://www.cbsnews.com/miami/news/grand-jury-report-hope-florida/
2•treetalker•3m ago•0 comments

Instinct is raising a $250M Series B

https://www.wsj.com/tech/ai/the-latest-viral-ai-assistant-rocketing-across-silicon-valley-abb46276
1•erex78•6m ago•0 comments

First patient to undergo live AI-assisted brain surgery has tumour removed

https://www.bbc.com/news/articles/cjwg5n7y68xo
2•gpjt•12m ago•0 comments

Roast My Startup

https://www.getstreek.com/
1•me_sleepy•13m ago•0 comments

Japanese avant-garde artist Yayoi Kusama dies aged 97

https://www.bbc.com/news/articles/c3v4k0re3vwo
1•tartoran•16m ago•0 comments

2026 Nepal Floods

https://en.wikipedia.org/wiki/2026_Nepal_floods
4•dredmorbius•17m ago•2 comments

The Self-Hosted SSO Tax: A Verified Tracker

https://techfuelhq.com/self-hosted/self-hosted-sso-tax-2026/
1•LKWOODIV•19m ago•0 comments

Ask HN: Do you think tariffs are about anything other than creating inflation?

1•dfps•20m ago•1 comments

Apple Maps Launches Ads on iPhone

https://9to5mac.com/2026/08/25/apple-maps-launches-ads-on-iphone-heres-whats-new/
1•Garbage•22m ago•0 comments

Dissecting the Apple M1 GPU, the End

https://alyssarosenzweig.ca/blog/asahi-gpu-part-n.html
3•amemi•27m ago•2 comments

Meta's self-inflicted resignation-wave

https://blog.pragmaticengineer.com/the-pulse-metas-self-inflicted-resignation-wave/
6•andsoitis•39m ago•0 comments

48 Node B300 cluster live in 3-5 weeks

1•anwar19•40m ago•0 comments

What Is a "Jeopardy "-Worthy Computer (2015)

https://today.umd.edu/what-jeopardy-worthy-computer-90e7a2a8-6faa-4ab2-95d3-c3a6d6efb20b
1•andsoitis•41m ago•0 comments

Why China is suddenly betting on e-fuels [video]

https://www.youtube.com/watch?v=IPpbrjyuQHI
2•thelastgallon•41m ago•0 comments

Show HN: Sift – a cross-platform Snaffler replacement

https://github.com/Stratus-Security/Sift
1•coj337•42m ago•0 comments

How researchers are teaching AI to learn like a child

https://www.science.org/content/article/how-researchers-are-teaching-ai-learn-child
1•andsoitis•44m ago•0 comments

Show HN: Check if your OTP/verification SMS or email arrived

https://github.com/flovoice53-tech/otp-watch
1•florin_builds•44m ago•0 comments

Show HN: Wattage – finds the tokens your Claude Code sessions wasted

https://github.com/faizannraza/wattage
1•faizanraza03•45m ago•0 comments

Meta Just Paid Nearly $17B to Write the Kid Safety Rules for Every Platform

https://www.techdirt.com/2026/08/26/meta-just-paid-nearly-17-billion-to-make-sure-it-gets-to-writ...
3•wrxd•46m ago•1 comments

FrankenMermaid. A deterministic, memory-safe Rust implementation of MermaidJS

https://frankenmermaid.com/
1•carnevalem•49m ago•0 comments

Show HN: CloudDM – One more small step toward safer database operations

https://github.com/ClouGence/open-cdm/releases/tag/v4.1.2
1•cloudcanalx•50m ago•0 comments

GoodSaaS – Discover useful SaaS products without the noise

https://goodsaas.xyz
1•its_ajseven•53m ago•0 comments

Ask HN: Do you also notice CNN's poor English?

1•mandeepj•55m ago•0 comments

PiLFS Linux from Scratch on the Raspberry Pi

https://intestinate.com/pilfs/
3•kristianpaul•56m ago•0 comments

Tragedy of the Commons

https://en.wikipedia.org/wiki/Tragedy_of_the_commons
2•num42•1h ago•1 comments

Humanity has the debate about AI consciousness backwards

https://economist.com/by-invitation/2026/08/20/humanity-has-the-debate-about-ai-consciousness-bac...
6•semiquaver•1h ago•3 comments

Keep an Eye Out on Chromium's Flatpak Experiment

https://itsfoss.com/news/experimental-chromium-flatpak-packaging/
1•losgehts•1h ago•0 comments

Trump to sign executive order on foreign equipment in U.S. energy infrastructure

https://cyberscoop.com/energy-department-cybersecurity-executive-order-rules/
2•WaitWaitWha•1h ago•1 comments