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.

A unique palaeolithic human ichnological record from Italy (Bàsura Cave)

https://elifesciences.org/articles/45204
1•Tomte•56s ago•0 comments

Amazon Builder's Library – An overlooked goldmine of System Design knowledge

https://sumitgouthaman.com/posts/amazon-builders-library/
1•equinumerous•56s ago•0 comments

RIP Your Backlog

https://randsinrepose.com/archives/r-i-p-your-backlog/
1•mooreds•2m ago•0 comments

Testing is underway on vaccines to intercept brewing colon cancer

https://www.cnn.com/2026/08/09/health/colon-cancer-vaccine-lynch-syndrome
2•mooreds•4m ago•0 comments

Ask HN: What assisted driving car is best for elderly drivers?

2•yubblegum•4m ago•0 comments

The "Data Quality/Engineering" Angle

https://kylesinvestigation.com/
1•mkyle71•4m ago•0 comments

Uncontacted Indigenous Peoples: at the edge of survival (2025) [pdf]

https://assets.survivalinternational.org/documents/2788/original-b24f435d70d2e27876b53452d615b1a4...
1•mooreds•5m ago•0 comments

Show HN: YC Startup School, but AI-Native

https://foundera.app/
1•toyji•6m ago•0 comments

Gemini 3 Pro can generate normal maps

https://geosona.com/software/2026/08/09/gemini-normal-maps/
1•gste•6m ago•1 comments

Israeli startup was linked to rogue AI hacks at OpenAI, Anthropic and Meta

https://www.cnbc.com/2026/08/09/israeli-startup-irregular-linked-to-ai-hacks-openai-anthropic-met...
1•cramer4next•7m ago•0 comments

The Wild West of Private Schools That Collect Taxpayer Dollars

https://www.propublica.org/article/private-schools-vouchers-growth-florida-arizona-west-virginia
1•ceejayoz•11m ago•0 comments

Show HN: Amapola – financial models you can draw and play

https://thepatternbridge.com/amapola/
1•GabrielSilver•11m ago•0 comments

Auto mode is now the default in Claude Code for Pro, Max, and Team plans

https://simonwillison.net/2026/Aug/8/auto-mode/
1•ilamont•13m ago•0 comments

Trump Crypto Took $100M from a Businessman with Red Flags

https://www.nytimes.com/2026/08/09/us/politics/bobby-zhou-trump-crypto.html
1•hrldcpr•14m ago•0 comments

Show HN: FolderForge, open-source native macOS folder icon designer

https://github.com/KeplSiv/FolderForge
2•keplsiv•17m ago•0 comments

Amazon circumvents Gilroy community vote for AI data center

https://www.tomshardware.com/tech-industry/data-centers/amazon-secretly-circumvents-community-vot...
9•mikhael•19m ago•1 comments

Claude Code in 9 lines Python

https://www.reddit.com/r/LocalLLaMA/comments/1viwlgj/comment/p2mn1xt/
2•tosh•21m ago•0 comments

Show HN: FAIth – a syntax-free JVM language, compiled by an LLM front-end

https://github.com/krossovochkin/faith
2•krossovochkin•21m ago•0 comments

The Long, AI-Powered Quest to Perfect Pringle-Making

https://www.wsj.com/tech/ai/inside-the-long-ai-powered-quest-to-perfect-pringle-making-ab37a231
2•bookofjoe•24m ago•1 comments

Self Hosting Coding LLMs

https://blog.samibadawi.com/2026/08/self-hosting-coding-llms.html
2•type-lambda•26m ago•0 comments

The Closure of the Internet

https://arctotherium.substack.com/p/the-closure-of-the-internet
2•barry-cotter•26m ago•0 comments

Show HN: A Project Oberon System version running on RISC-V instead of RISC-5

https://github.com/rochus-keller/OberonSystem/tree/op2-rv32
3•Rochus•28m ago•0 comments

A golf career SIM I built, abandoned, and just found still has real users

https://www.rainydaygc.com
2•mdstrobe•30m ago•0 comments

Scientists turn to sharks to improve hurricane predictions

https://www.reuters.com/business/environment/scientists-turn-sharks-improve-hurricane-predictions...
2•geox•39m ago•0 comments

Making AI Smarter with AI

https://math.andrej.com/2026/07/11/making-ai-smarter-with-ai/
2•artninja1988•43m ago•2 comments

Advanced AI Sycophancy

https://www.seangoedecke.com/advanced-ai-sycophancy/
4•vinhnx•43m ago•0 comments

What LLMs Should Do

https://adamperesztegi.com/posts/what-llms-should-do/
2•nevertoolate•47m ago•0 comments

China created a system that simulates the Earth with billions of AI agents

https://twitter.com/howtoprompt__/status/2086110097663795365
4•fragmede•50m ago•1 comments

Generative AI threatens to upend citizen science records

https://phys.org/news/2026-08-creatures-born-code-generative-ai.html
2•programd•50m ago•0 comments

I Turned Off Google Adsense

https://www.cannonade.net/blog/why-i-turned-off-google-adsense
3•redbluething•50m ago•0 comments