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.

Google Was a Lifeline for Publishers. Now Some Are Thinking of Cutting It Off

https://www.wsj.com/business/media/google-search-publishers-ai-content-0fb06e41
1•1vuio0pswjnm7•8m ago•0 comments

Companies are optimizing models for specific benchmarks

1•mzubairtahir•11m ago•0 comments

Split Screen – browser workspaces to replace tab sprawl (free, local)

https://github.com/MIR-2025/brave-ext/tree/main/splitscreen
1•ruusvuu•13m ago•0 comments

A Tale of Two Tailnets

https://blog.exe.dev/a-tale-of-two-tailnets
2•shintoist•14m ago•0 comments

Shawn Ryan announces partnership with glacier [video]

https://www.youtube.com/watch?v=yB05HiKCCuI[video]
1•smalltorch•15m ago•1 comments

The Global Justice Report

https://globaljusticeproject.wid.world/global-justice-report/
1•homarp•16m ago•0 comments

Trump announces 2028 presidential bid

https://www.smh.com.au/world/trump-announces-2028-presidential-bid-20260725-p60iho.html
3•jiggawatts•26m ago•1 comments

Uber: Whatdoyoudo – Darden MBA Case Study (2020)

https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3207044
1•mgh2•31m ago•1 comments

"As millionaires we have a message for our new Prime Minister: Tax us."

https://proudtopay.org
2•teekert•35m ago•2 comments

Michael Stevens and Hannah Fry: The Rest Is Science

https://therestis.com/science
1•tomfakes•38m ago•0 comments

The Architecture of Deep Thought: Fight AI Speed with Cognitive Friction

https://varnam.substack.com/p/the-architecture-of-deep-thought
1•arthurfleck•42m ago•0 comments

Show HN: Sync Claude Code and Codex configs, with a board that shows the drift

https://github.com/slash9494/ai-config-sync-manager
1•slash9494•45m ago•0 comments

AWS announces AWS-bench, an open-source benchmark for AI agents on AWS

https://aws.amazon.com/about-aws/whats-new/2026/07/aws-bench/
2•gslin•1h ago•0 comments

Lawsuits hours after new tariffs take effect, experts say tariffs may not hold

https://www.cnbc.com/2026/07/24/trump-tariffs-lawsuit-301-ieepa.html
2•MilnerRoute•1h ago•0 comments

A single underscore led to an innocent Halifax man's conviction

https://www.cbc.ca/news/politics/man-guilty-michael-barrett-threats-1.7546742
1•cperciva•1h ago•1 comments

Best Open-Weight LLMs by Memory Required (July 2026)

https://claude.ai/public/artifacts/4b74e194-a4b2-414f-a313-8d4b98a92b0b
2•yid•1h ago•1 comments

Coordination layer for AI coding agents, built on Git

https://github.com/zyads/loom-vcs
2•aether-zyads•1h ago•0 comments

An Introduction to Formal Logic(2020) [pdf]

https://logicmatters.net/ifl/pdfs/IFL2_LM.pdf
3•o4c•1h ago•0 comments

UK AISI / Caisi Preliminary Assessment of Kimi K3's Cyber Capabilities

https://www.nist.gov/news-events/news/2026/07/uk-aisi-caisi-preliminary-assessment-kimi-k3s-cyber...
3•walrus01•1h ago•0 comments

Why Do Autistic People Talk Like Animé Villains?

https://dispatchesfromtheautismwars.substack.com/p/why-do-autistic-people-talk-like
4•barry-cotter•1h ago•1 comments

Two Chinese win top Maths prize

https://www.bbc.com/news/articles/cvg84gp8xx4o
3•Alien1Being•1h ago•0 comments

The Productivity Mirage

https://frantic.im/mirage/
2•stopachka•1h ago•0 comments

US tech groups cut 140k jobs

https://www.ft.com/content/96a33881-27fd-42cf-8cff-4cbc87fc835f
5•Alien1Being•1h ago•1 comments

Corporate America Has Suddenly Decided to Stop Blowing Money on AI

https://www.wsj.com/business/china-us-ai-model-costs-53a12e96
5•Alien1Being•1h ago•2 comments

Escaping Claude Cowork's local VM sandbox via CVE-2026-46331

https://accomplish.ai/blog/sharedroot-escaping-claude-cowork-sandbox/
1•_orcaman_•1h ago•0 comments

Gatekeepers, Luddites, Haters and AI-Generated Maps

https://www.maproomblog.com/2026/07/gatekeepers-luddites-haters-and-ai-generated-maps/
2•ethagnawl•1h ago•0 comments

AI Agent Blameless Postmortem Template

https://cordum.io/blog/ai-agent-blameless-postmortem-template
1•ankitg12•1h ago•0 comments

The Discovery Problem: When AI Agents Build Tools No One Can Find

https://www.ixcoach.com/articles/the-discovery-problem-when-agents-build-invisible-tools
1•ankitg12•1h ago•0 comments

Points as Tori: Fast Pointwise Signed Distance for Point Clouds

https://nzfeng.github.io/research/PointsAsTori/
1•nill0•1h ago•0 comments

C64 Online

https://c64online.com/
3•ibobev•2h ago•0 comments