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.

Anthropic Appoints KiYoung Choi as Representative Director of Korea

https://www.anthropic.com/news/kiyoung-choi-representative-director-anthropic-korea
1•surprisetalk•2m ago•0 comments

CodeAtlas – Google Maps for your codebase, with a live differential UML engine

https://www.codeatlas.live/
1•vamsikanneganti•6m ago•0 comments

Ecosystem for (Studying) Network Programming

https://docs.packetcord.io/
1•vmetodiev•9m ago•0 comments

Cloudflare Flagship

https://developers.cloudflare.com/flagship/
1•tjek•11m ago•0 comments

Unit cell designer for 2d wallpaper groups

https://nasqret.github.io/symm/
1•mathgenius•12m ago•0 comments

The true reason C++ always wins [video]

https://www.youtube.com/watch?v=I7fEsbksKRE
1•abhaynayar•13m ago•0 comments

You're about to feel the AI money squeeze

https://www.theverge.com/ai-artificial-intelligence/917380/ai-monetization-anthropic-openai-token...
1•1vuio0pswjnm7•17m ago•0 comments

Qualcomm strikes AI chip deal with TikTok owner ByteDance

https://www.reuters.com/business/qualcomm-strikes-ai-chip-deal-with-tiktok-owner-bytedance-bloomb...
2•Voblit•21m ago•0 comments

Grok Build

https://grok.com/build
2•kristianpaul•25m ago•0 comments

Show HN: I made a simple Keyword Research tool for app devs

https://ezscreenshots.com/aso/
1•abrowniejr•26m ago•0 comments

I Made a Journal for AI-Generated Papers

https://cesarhidalgo.com/blog/2026/5/26/why-i-made-a-journal-for-ai-generated-papers
2•Anon84•28m ago•0 comments

Iran's access to global internet starts to resume after 88-day blackout

https://www.theguardian.com/world/2026/may/26/iran-internet-blackout
3•theali•28m ago•0 comments

A Luxury Survivalist Community Is Tearing Itself Apart

https://www.wsj.com/us-news/a-luxury-survivalist-community-is-tearing-itself-apart-53d2a99f
6•impish9208•29m ago•1 comments

NASA Provides Update on Moon Base Rovers, Landers, Missions

https://www.nasa.gov/news-release/nasa-provides-update-on-moon-base-rovers-landers-missions/
2•Anon84•30m ago•0 comments

Starlink and Amazon may be able to buy into EU mobile satellite spectrum plan

https://www.reuters.com/business/aerospace-defense/european-companies-set-receive-two-thirds-futu...
1•Voblit•31m ago•0 comments

Where are those goalposts? I'm sure I put them here somewhere

https://nickdrozd.github.io/2026/05/26/goalposts-math.html
1•nickdrozd•33m ago•0 comments

The AI Token plumbing issue

https://getlago.com/blog/ai-billing-is-mostly-token-plumbing
1•jdenquin•33m ago•0 comments

Magnifica Humanitas, LaTeX Version

https://github.com/cucho/magnifica-humanitas/blob/master/latex/en.tex
1•cucho•36m ago•0 comments

MySQL faithful launch OurSQL Foundation to keep Oracle honest

https://www.theregister.com/databases/2026/05/26/mysql-faithful-launch-oursql-foundation-to-keep-...
3•thejerz•39m ago•0 comments

Supreme Court rejects Meta's appeal in Vermont social media addiction case

https://apnews.com/article/meta-teens-harms-supreme-court-6a0de777da59575ca0210b275892835a
3•1vuio0pswjnm7•41m ago•0 comments

The AI Bubble

https://nooneshappy.com/article/the-ai-bubble/
3•SupremumLimit•42m ago•0 comments

Xiaomi MiMo-v2.5 price drops 99% – AI pricing war

https://platform.xiaomimimo.com/docs/en-US/welcome
5•mariopt•44m ago•3 comments

Altman and Amodei both walking back on AI jobs apocalypse prophecies before IPOs

https://fortune.com/2026/05/26/sam-altman-dario-amodei-walking-back-ai-jobs-apocalypse-prophecies...
4•1vuio0pswjnm7•45m ago•0 comments

Introduction to Virtio Protocol

https://www.openeuler.org/en/blog/yorifang/virtio-spec-overview.html
1•jakogut•46m ago•0 comments

Modeling Snakes and Ladders: The Board

https://john.senneker.ca/snakes-2/
1•jsenn•47m ago•0 comments

Trump administration proposes NDAs for federal workers

https://www.reuters.com/world/us/trump-administration-proposes-non-disclosure-agreements-us-feder...
3•SubiculumCode•48m ago•3 comments

Chasing that next BIG thing with Drew Wilson (Changelog Interviews #639)

https://changelog.com/podcast/639
1•fagnerbrack•50m ago•0 comments

When AI Writes the Software, Who Verifies It?

https://leodemoura.github.io/blog/2026-2-28-when-ai-writes-the-worlds-software-who-verifies-it/
1•fagnerbrack•50m ago•0 comments

California push bill to exempt open-source projects from age verification law

https://www.neowin.net/news/california-lawmakers-push-new-bill-to-exempt-open-source-projects-fro...
2•bundie•51m ago•1 comments

Figure's robots sorted packages for 200 hours straight

https://sherwood.news/tech/figures-robots-just-sorted-packages-for-200-hours-straight/
2•hochmartinez•54m ago•1 comments