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

Ask HN: What to learn and do, that makes me least affected by AI in STEM?

1•s3arch•10m ago•0 comments

Write Thin to Write Fast (2021)

https://breck7.github.io/breckyunits.com/write-thin-to-write-fast.html
1•KTibow•12m ago•0 comments

Students Create a Self-Balancing, Self-Driving Bicycle

https://www.core77.com/posts/144138/Students-Create-a-Self-Balancing-Self-Driving-Bicycle
2•sizzle•20m ago•0 comments

Context windows are the wrong solution to AI memory

https://www.thesecondbrain.dev
1•rahilpirani•21m ago•0 comments

Pynear 2.3 Is Out

1•pcael•22m ago•0 comments

GitHub Actions Is a Trap

https://tylercipriani.com/blog/2026/04/24/on-the-software-supply-chain-doom-spiral/
1•thcipriani•25m ago•0 comments

Robustness Principle

https://en.wikipedia.org/wiki/Robustness_principle
1•bookofjoe•26m ago•0 comments

When Code Is Cheap, Does Quality Still Matter?

https://yusufaytas.com/does-code-quality-still-matter
1•thunderbong•28m ago•0 comments

The Culture of Childhood: We've Almost Destroyed It

https://petergray.substack.com/p/the-culture-of-childhood-weve-almost
1•rendx•28m ago•0 comments

Cards and Stars – Where the Cards Meet the Cosmos

https://cardsandstars.org/
1•Anon84•32m ago•0 comments

TikTok disproportionately served anti-Democratic videos during the 2024 election

https://www.psypost.org/tiktok-disproportionately-served-anti-democratic-videos-during-the-2024-e...
2•CharlesW•34m ago•1 comments

The Lottery – Shirley Jackson (1948)

https://www.newyorker.com/magazine/1948/06/26/the-lottery
2•jxmorris12•36m ago•0 comments

Gaza flotilla activists allege sexual assault and rape in Israeli detention

https://www.theguardian.com/world/2026/may/22/gaza-flotilla-activists-allege-sexual-assault-and-i...
6•0x54MUR41•37m ago•0 comments

Community response to Wikimedia layoffs and labor concerns

https://lists.wikimedia.org/hyperkitty/list/wikitech-l@lists.wikimedia.org/thread/NEZZ25FAX3VMBER...
8•rendx•39m ago•0 comments

California Evacuation Map as Chemical Tank Will Fail or Explode: 'Bad'

https://www.newsweek.com/garden-grove-california-evacuation-map-chemical-tank-fail-explode-orange...
4•SilverElfin•39m ago•1 comments

CVE-2026-9256: Nginx 1.31.1 and 1.30.1

https://www.cve.org/CVERecord?id=CVE-2026-9256
3•petecooper•43m ago•0 comments

Show HN: AI Guided 3D atomic orbital simulation

https://atom.plumocracy.com
1•plumocracy•44m ago•0 comments

SpaceX launches Starship v3 rocket

https://www.nbcnews.com/now/video/spacex-successfully-launches-prototype-of-starship-rocket-26383...
36•busymom0•44m ago•6 comments

Tobacco plant can produce five psychedelics, including psilocybin and DMT

https://phys.org/news/2026-04-tobacco-psychedelics-psilocybin-dmt.html
8•hyrix•44m ago•0 comments

I was bored so I turned my dev tools into an alien planet ruled by my dog

https://github.com/bkawa-bot/planet-maiko
7•bkawa-bot•45m ago•1 comments

Cheap AI Could Derail OpenAI and Anthropic's IPOs

https://www.cnbc.com/2026/05/20/cheap-ai-could-derail-openai-and-anthropics-ipos.html
2•gmays•48m ago•1 comments

Switchkraft

https://switchkraft.zone/
1•skogstokig•52m ago•0 comments

Panorama – Review Code, Faster

https://panorama.stagas.deno.net/
1•stagas•52m ago•0 comments

SendIt – browser-based file/text transfer tool

https://trysendit.app/
1•GrandpaCereal•53m ago•1 comments

Future of AI-Facilitated Medicine

https://www.amacad.org/publication/daedalus/future-ai-facilitated-medicine
2•dnw•56m ago•0 comments

Luminous: Rust Based Image Viewer

https://github.com/jaroslavszkandera/luminous
1•unk_•58m ago•0 comments

Capital and the Debt Trap

https://en.wikipedia.org/wiki/Capital_and_the_Debt_Trap
2•teleforce•59m ago•0 comments

Gas prices drive Georgia man to create a "mini car" costing $3 to fill up [video]

https://www.youtube.com/watch?v=c-QNFxkWktY
2•nxobject•1h ago•0 comments

Four Russian satellites are now within striking distance of an ICEYE radarsat

https://arstechnica.com/space/2026/05/a-satellite-company-supporting-ukraine-appears-to-be-in-rus...
10•fghorow•1h ago•0 comments

The Silent Merge Queue Corruption That Hit 658 GitHub Repos

https://failure-modes.dev/library/fm-029
2•birdculture•1h ago•1 comments