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.

Anthropic buys one-person Kendall Square biotech ahead of IPO. Here's why

https://www.masslive.com/news/2026/11/anthropic-buys-one-person-kendall-square-biotech-ahead-of-i...
1•thavalai•1m ago•0 comments

Agent State Machines: Building Deterministic Scaffolding for Agents

https://twitter.com/josharosen/status/2117687393213932003
1•gmays•1m ago•0 comments

Show HN: Exact integer LLL lattice basis reduction in C99

https://github.com/qawbecrdtey/clll
1•qawbecrdtey•4m ago•0 comments

Cat Wu joins OpenAI from Anthropic in product-lead coup

https://www.businessinsider.com/cat-wu-joins-openai-from-anthropic-product-lead-coup-2026-11
2•closetheloopdev•5m ago•0 comments

HawaiʻI Green Party Candidate Makes History, Edges Democrat

https://www.civilbeat.org/2026/11/hawaii-green-party-candidate-makes-history-edges-democrat/
1•PaulHoule•7m ago•0 comments

The anatomy of language model inference and reinforcement learning

https://www.nabo.dev/blogs/jam-architecture
1•nomi_uw•10m ago•0 comments

Competition for direct weight editing for models: Delta League

https://deltaleague.ai/
1•zmanian•13m ago•0 comments

Vietnam Jails Pirate Football Streamers for Up to a Year, Three Escape Prison

https://torrentfreak.com/vietnam-jails-pirate-football-streamers-for-up-to-a-year-three-escape-pr...
2•gslin•14m ago•0 comments

Kimi K3.1 Pro Recalls and Enforces Hidden Test Rules [pdf]

https://r40.org/papers/kimi_k31_benchmark_audit.pdf
2•cheshire_cat•17m ago•0 comments

Harvey AI Is Proud to Sponsor the HBO Original Series, War

https://www.instagram.com/reel/DfVLkeKtbyD/
1•flyingsky•21m ago•0 comments

I Rebuilt My Custom Calculator and Made It Worse [video]

https://www.youtube.com/watch?v=_a36lORxAdo
1•ProxyTracer•21m ago•0 comments

StateBench: Testing how language models track state changes over long documents

https://huggingface.co/blog/allenai/statebench
1•thedreammachine•24m ago•0 comments

The great butter and cheese fire of 1991

https://www.wisfarmer.com/story/opinion/columnists/2022/05/11/over-20-m-lbs-commodities-lost-grea...
1•subroutine•24m ago•0 comments

Nintendo's biggest ROM chip supplier is bowing out of the business

https://arstechnica.com/gaming/2026/11/the-tech-memory-shortage-comes-for-nintendos-cartridge-sup...
4•jnord•25m ago•0 comments

American Voters Overwhelmingly Reject AI Data Centers

https://www.404media.co/american-voters-overwhelmingly-reject-ai-data-centers/
5•latexr•25m ago•1 comments

Bill Joy – 50 Years of Advancements: Computing and Technology 1975-2025 [video]

https://www.youtube.com/watch?v=rByrD_R9Vuo
1•so-cal-schemer•30m ago•1 comments

How much do tokens cost?

https://substack.hadley.nz/p/how-much-do-tokens-really-cost
2•gmays•30m ago•0 comments

Claude / Codex is making a lot of us broke

https://www.reddit.com/r/SaaS/comments/1xnmhli/claude_codex_is_making_a_lot_of_us_broke/
2•hackerbeat•30m ago•0 comments

Cyberattack disrupts blood storage refrigeration systems in France

https://www.bleepingcomputer.com/news/security/cyberattack-disrupts-blood-storage-refrigeration-s...
1•PicardManeuver•33m ago•0 comments

Canva Layoffs

https://www.canva.com/newsroom/news/canva-team-update/
6•uladzislau•35m ago•0 comments

Why LSP, Why the LSP Plugin, and Why Claude Code Doesn't Save Tokens

https://byteask.ai/research/lsp-claude-code-cpp
2•anirudhak•36m ago•1 comments

Show HN: Native HTML Partials and Native MFEs

1•otocarlson•42m ago•0 comments

Attackers used ChatGPT desktop and Claude Code in real intrusions

https://www.elastic.co/security-labs/reports/threats-etc-report-november-2026-trouble-with-trust
1•khalidkhair•43m ago•0 comments

The Entropy Law and the Economic Process (1971)

https://en.wikipedia.org/wiki/Nicholas_Georgescu-Roegen
1•whoishiding•47m ago•0 comments

SpaceX – Starfall

https://www.spacex.com/starfall
14•gmays•50m ago•2 comments

Show HN: Cinnamon – safer AI agent for household, private and shared context

https://getcinnamon.ai/
2•mv4•59m ago•1 comments

One TypeScript codebase, compiled native–from microcontrollers to consoles

https://github.com/geastack
1•arbayi•59m ago•0 comments

Ask HN: Have you changed your setup in the age of AI and mass vulnerabilities?

3•dysoco•1h ago•1 comments

Zgui: Native Rust UI with fine-grained signals, CSS, and a retained GPU renderer

https://github.com/zortax/zgui
5•newspicel•1h ago•0 comments

Electronic implant shows promise for drug-free diabetes control

https://physicsworld.com/a/electronic-implant-shows-promise-for-drug-free-diabetes-control/
1•EA-3167•1h ago•1 comments