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.

A Comparative Security Analysis of Three Cloud-Based Password Managers

https://eprint.iacr.org/2026/058
1•agadius•1m ago•0 comments

Prompt Guidance – GPT-5.5

https://developers.openai.com/api/docs/guides/prompt-guidance
1•amunozo•1m ago•0 comments

RNet: Users pay for their own AI usage instead of apps covering token costs

1•rNetAi•2m ago•0 comments

A Gopher Meets a Crab

https://miren.dev/blog/gopher-meets-crab
1•radimm•10m ago•0 comments

Scott Aaronson on quantum: "Will you heed my warnings NOW?"

https://scottaaronson.blog/?p=9718
2•bwesterb•10m ago•0 comments

I took an algorithm to court in Sweden. The algorithm won

https://www.theguardian.com/commentisfree/2026/apr/30/i-took-an-algorithm-to-court-in-sweden-the-...
1•nickcotter•11m ago•0 comments

How does your team handle cloud cost optimisation?

https://www.kloudaudit.eu/
1•leumasj•11m ago•0 comments

The Czech Prime Minister just reacted to our video

https://www.youtube.com/watch?v=nzDuj42HJ1o
1•dataflow•11m ago•0 comments

Siddharth on X: "Software Is Eating the World (But This Time)"

https://twitter.com/siddharthvader_/status/2049161016156762441
1•kiyanwang•15m ago•0 comments

Ask HN: Recommended Gemini CLI extensions/skills for token consumption

1•elC0mpa•16m ago•0 comments

We never get to what matters

https://yewjin.substack.com/p/why-we-never-get-to-what-matters
1•kiyanwang•19m ago•0 comments

AI Coding Tools Ranked by Community Sentiment: 4 Weeks of Reddit/HN Data (2026)

https://murmure.cc/state-of-ai-devtools-2026
1•ianalyze•20m ago•0 comments

Why the US keeps getting richer while Britain stagnates

https://www.thetimes.com/business/economics/article/why-us-richer-than-uk-rlkshqvq9
2•petethomas•20m ago•0 comments

Hot Updates in Postgres

https://boringsql.com/posts/hot-updates/
1•radimm•21m ago•1 comments

FujiNet Go 800 – Atari800 Emulator for Android – FujiNet

https://fujinet.online/2026/04/23/fujinet-go-800-atari800-emulator-for-android/
1•rbanffy•23m ago•0 comments

Chinese firm revives the drive-in cinema with film-projecting headlights

https://www.thetimes.com/uk/technology-uk/article/chinese-firm-drive-in-cinema-film-projecting-he...
2•petethomas•24m ago•1 comments

Claude Code Opus 4.7: 16B cache reads across 8 sessions, forensic JSONL data

https://github.com/anthropics/claude-code/issues/38350
1•biniruprojects•29m ago•0 comments

Banana Pi Announces RISC-V Based BPI‑SM10 Developer Kit and K3 Pico‑ITX AI SBC

https://forum.banana-pi.org/t/banana-pi-major-release-based-on-spacemit-k3-launching-bpi-sm10-dev...
1•fork-bomber•33m ago•0 comments

Visualize Any Repository

https://gitdiagram.com
1•ahmedkhaleel•34m ago•1 comments

How AI Is Changing Programming Language Usage

https://cacm.acm.org/news/how-ai-is-changing-programming-language-usage/
2•adunk•35m ago•0 comments

Guess at lost Bitcoin, right in the browser

https://satoshiguesser.com
1•jumploops•35m ago•0 comments

One of the most common knee surgeries does not help and may be harmful

https://www.eurekalert.org/news-releases/1126327
2•u1hcw9nx•36m ago•0 comments

Show HN: I built a zero-tracking news hub to escape doom scrolling at (AGE 17y)

2•blazeeofsun•40m ago•0 comments

Meta shares slide as it hikes AI spending forecast, youth social media backlash

https://nypost.com/2026/04/29/business/meta-shares-slide-as-tech-giant-hikes-ai-spending-forecast...
1•1vuio0pswjnm7•42m ago•0 comments

Apple's self-designed AI server chip "Baltra" may be manufactured by TSMC

https://technode.com/2026/04/09/apples-self-designed-ai-server-chip-baltra-may-be-manufactured-by...
1•mgh2•43m ago•0 comments

Indie English Bookstore in Tokyo

https://featherheartbooks.com/
3•agnishom•44m ago•0 comments

Meta bumped 2026 capex forecast up to $145B for AI boom investors flinched

https://fortune.com/2026/04/29/meta-zuckerberg-145-billion-ai-spending-roi/
3•1vuio0pswjnm7•44m ago•2 comments

Claude Code is inspecting repos and can auto-switch to extra usage

https://twitter.com/theo/status/2049645973350363168/photo/1
3•mlitwiniuk•47m ago•1 comments

Experimenting with an ISP-style billing model for AI usage

1•rNetAi•52m ago•0 comments

Tracking Migration to the United States

https://trackmigrations.org
1•Areibman•52m ago•0 comments