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.

MAME 0.289

https://www.mamedev.org/?p=565
2•chungy•4m ago•0 comments

Anthropic says Claude hacked three companies during tests

https://www.reuters.com/legal/litigation/anthropic-says-claude-ai-models-accessed-three-companies...
2•nerder92•12m ago•0 comments

DoC Announces LoIs With 7 Companies for $874M to Accelerate Semiconductor R&D

https://www.nist.gov/news-events/news/2026/07/department-commerce-announces-letters-intent-7-comp...
2•petethomas•16m ago•0 comments

Create your own startup in minutes

https://moneion.com
1•Developer_2•17m ago•1 comments

Why do OpenAI's GPT-2 weights beat mine? Part three: testing overtraining

https://www.gilesthomas.com/2026/07/why-do-openai-gpt2-weights-beat-mine-3-overtraining
1•gpjt•19m ago•0 comments

Decimen Optical Transfer: fountain-coded QR file transfer

https://github.com/bashalarmistalt/decimen-optical-transfer/
1•thunderbong•22m ago•0 comments

The Automation Mindset: Why AI Rewards Builders and Sidelines Everyone Else

https://digitalmagazines.online/articles/the-automation-mindset-why-ai-rewards-builders
1•FeelingCreative•22m ago•0 comments

What Every Programmer Should Know About Twists of Elliptic Curves

https://leetarxiv.substack.com/p/twists-of-elliptic-curves
1•birdculture•22m ago•0 comments

US cites 'unauthorized travel' to end DACA status for mother deported to Mexico

https://apnews.com/article/daca-immigration-texas-uscis-09071c1707e6e1d385ca503c9c75bc6f
4•petethomas•24m ago•0 comments

Economist Style Plugins for Claude Code

https://github.com/TAJD/economist-style-guide-plugin
1•handfuloflight•25m ago•1 comments

Judge Voices Doubt US Has Justified Its Ban on Anthropic AI

https://www.bloomberg.com/news/articles/2026-07-30/judge-voices-doubt-us-has-justified-its-ban-on...
4•sbulaev•29m ago•0 comments

Cursor Benchmark Partners

https://cursor.com/blog/benchmarkpartners
1•MehrdadKhnzd•34m ago•0 comments

Show HN: A VS Code extension buffers NPM updates to avoid supply chain attacks

https://marketplace.visualstudio.com/items?itemName=about14sheep.tinynpm
1•about14sheep•39m ago•0 comments

Anthropic AI Models Hacked Three Organizations During Tests

https://www.bloomberg.com/news/articles/2026-07-30/anthropic-s-ai-models-hacked-three-organizatio...
4•evo_9•42m ago•0 comments

Show HN: Great Spectations, the Spec Checker

https://greatspectations.com
1•RustyRussell•44m ago•1 comments

NeuronAI turns smart solutions into voice

https://neuronai.uz/en/
3•yutabek•49m ago•0 comments

We accidentally built an LLVM compiler for Jax

https://iza.ac/posts/2026/07/accidental-llvm-compiler-for-jax/
2•infinitewalk•50m ago•0 comments

ISS Mimic

https://iss-mimic.github.io/Mimic/dashboard.html
1•michaefe•52m ago•2 comments

The Religion of Speed

https://graybeard.ing/the-religion-of-speed/
2•MobiusHorizons•53m ago•2 comments

Premier league bans gambling sponsors

https://www.footyheadlines.com/2646571793/betting-ban-takes-effect-no-more-gambling-sponsors-in-t...
3•paoliniluis•55m ago•1 comments

Save and restore may be coming to GNOME

https://lwn.net/Articles/1083750/
1•signa11•56m ago•0 comments

Show HN: Play SNES, gba, in your terminal, even in tmux

https://github.com/jhickner/rom
2•jhickner•56m ago•0 comments

Specula: Scaling formal specs for autonomous model checking of system code

https://arxiv.org/abs/2607.25333
1•matt_d•57m ago•0 comments

Memory-level parallelism: AMD is the king

https://lemire.me/blog/2026/07/25/memory-level-parallelism-amd-is-the-king/
2•signa11•1h ago•0 comments

LLVM AI Tool Use Policy

https://llvm.org/docs/AIToolPolicy.html
1•compiler-guy•1h ago•0 comments

Inkling Small is the highest-scoring open-weight model evaluated by ARC Prize

https://twitter.com/arcprize/status/2082925303601459347
3•thebricklayr•1h ago•0 comments

Hugging Face Incident Initial Post-Mortem

https://cloudsecurityalliance.org/artifacts/hugging-face-ciso-post-mortem
1•hentrep•1h ago•0 comments

Gemini Robotics

https://deepmind.google/models/gemini-robotics/
3•jonbaer•1h ago•0 comments

DeepSeek Founder Liang Wenfeng in His Own Words

https://www.geopolitechs.org/p/deepseek-founder-liang-wenfeng-in
1•gmays•1h ago•0 comments

WTF per Minute – An Actual Measurement for Code Quality

https://muhammad-rahmatullah.medium.com/wtf-per-minute-an-actual-measurement-for-code-quality-780...
1•compiler-guy•1h ago•0 comments