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.

My Quest to Find the Crispest Apple in America

https://www.wsj.com/arts-culture/food-cooking/crisp-apple-varieties-test-c12940ba
1•impish9208•8m ago•1 comments

How the cure for scurvy was found, then lost(2010)

https://idlewords.com/2010/03/scott_and_scurvy.htm
1•somat•8m ago•0 comments

Beau – An AI boyfriend app focused on everyday conversations

https://play.google.com/store/apps/details?id=com.beau.aiboyfriend&hl=en_US
2•prevanisupport•12m ago•0 comments

A Perfect SimCity

https://www.jeffquast.com/post/a-perfect-simcity/
2•mariuz•12m ago•0 comments

Bill Gates has earned billions investing in climate-polluting landfills

https://www.cnn.com/2026/11/14/climate/bill-gates-landfills-propublica
2•rawgabbit•18m ago•0 comments

I borrowed the query planner from databases to fix a multi-index RAG agent

https://medium.com/@sankeerthan.kasilingam/i-borrowed-the-query-planner-from-databases-to-fix-a-m...
1•sankeerthan•19m ago•0 comments

BrowserDo·Embiody – a browser built for AI agents

https://embiody.com/blog/embiody-0-9-preview/
1•junlongzhai•19m ago•0 comments

Human land use drives microplastic abundance in terrestrial wildlife

https://www.nature.com/articles/s41586-026-11285-x
2•bryanrasmussen•34m ago•0 comments

Disk encryption on NetBSD – achieving secrecy

https://netbsd.org/~nia/disk-encrypt/
2•jaypatelani•37m ago•0 comments

The elites just went into hiding [video]

https://www.youtube.com/watch?v=qAd1myPXrRk
1•Bender•42m ago•0 comments

Reading and Working for Salon

https://www.typebarmagazine.com/on-reading-and-working-for-salon/
2•rdmuser•43m ago•1 comments

B.C. arbitrator imposes first union contract for Amazon workers in North America

https://www.cbc.ca/news/canada/british-columbia/amazon-union-contract-b-c-first-north-america-9.7...
8•Teever•44m ago•1 comments

96.0% on LongMemEval: what retrieval does for long-term memory

https://www.papr.ai/blog/papr-longmemeval-96
1•amirkabbara•45m ago•0 comments

Confessions of an AI Skeptic

https://daniel-azuma.com/blog/2026-11-12-ai-skeptic/
3•gashad•46m ago•0 comments

Show HN: Four bite-sized chess puzzle games built on micro-boards

2•navalsaini•46m ago•0 comments

Turing Complete: Learn CPU architecture with puzzles

https://store.steampowered.com/app/1444480/Turing_Complete/
2•totallymike•50m ago•1 comments

Show HN: Hazel – Declarative schema management for SQLite

https://github.com/winebarrel/hazel
1•winebarrel•55m ago•0 comments

Rust Is the New C

https://www.namtao.com/rust-is-the-new-c/
2•hatamoto•1h ago•0 comments

Munich Laser Emits a Beam of Matter Waves (1999)

https://www.sciencedaily.com/releases/1999/03/990317060831.htm
1•peter_d_sherman•1h ago•1 comments

Anthropic CVP (Mythos) Defense Access Requirements Reduced to KYC

https://portal.anthropic.com/login?returnTo=%2Fprograms%2Fcvp#_
1•jcomp•1h ago•1 comments

New study narrows the timeline for the emergence of life on Earth

https://gizmodo.com/early-earth-was-a-molten-asteroid-blasted-hellscape-scientists-now-know-when-...
3•gmays•1h ago•0 comments

How Jensen Huang Built the Backdoor Route That Keeps Beijing in the AI Race

https://www.wsj.com/tech/jensen-huang-backdoor-ai-data-centers-a5e4499d
5•ViktorRay•1h ago•1 comments

Kiri – The Modern Container Runtime

https://runkiri.com/
14•nikolay•1h ago•7 comments

Show HN: Gawain – Require type hints on all Python variables

https://github.com/matheuzgomes/gawain
21•MarinhoD•1h ago•5 comments

Agent Substrate: The Core System

https://github.com/agent-substrate/substrate
3•thunderbong•1h ago•0 comments

Anthropic, can you please make up your mind with your models?

4•xlayn•1h ago•3 comments

Europe's Digital Wallets May Be More Traceable Than Intended

https://spectrum.ieee.org/europe-digital-id-security-cryptography
3•geox•1h ago•0 comments

Songs That Explain America

https://www.theatlantic.com/culture/2026/09/50-songs-explain-america-playlist/687598/
2•gmays•1h ago•0 comments

Training Your Replacement: Worker Incentives and the Pace of Automation

https://www.nber.org/papers/w35950
2•rohanm93•1h ago•0 comments

Discovery Feed for Agents

https://twitter.com/cadenbuild/status/2121372002313503003
1•cadenli2025•1h ago•0 comments