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.

Smallpox reached the Americas: first genomic evidence points to Europeans

https://www.nature.com/articles/d41586-026-02366-y
1•Brajeshwar•18s ago•0 comments

IBM Claims Quantum Advantage with New Validation Techniques

https://spectrum.ieee.org/ibm-verifiable-quantum-advantage
1•nateb2022•26s ago•0 comments

Oceanographers Find Lessons in the Great Nike Shoe Spill (1992)

https://archive.seattletimes.com/archive/19921122/1526004/oceanographers-find-lessons-in-the-grea...
1•EndXA•31s ago•0 comments

Show HN: AI Photo Editor No Sign Up – Edit Photos with Prompts

https://aiphotoeditornosignup.online/
1•chenliang001•2m ago•0 comments

Show HN: Emacs user are you waiting for mg to get ITF-8?

https://github.com/nicholascarroll/emil
1•emil_coder•2m ago•0 comments

Stealthy Concurrent Audio Prompt Injections Against Multimodal LLM Agents

https://arxiv.org/abs/2607.28165
1•zhinit•2m ago•0 comments

U.S. debt-to-GDP ratio reaches 123%

https://fred.stlouisfed.org/series/GFDEGDQ188S
2•johnbarron•3m ago•0 comments

Show HN: Yet Another Markup Language Engineering Toolkit

https://github.com/RicardoMonteiroSimoes/Yamlet
1•RicDan•3m ago•0 comments

The Sylvester–Gallai Theorem

https://www.futilitycloset.com/2026/07/26/the-sylvester-gallai-theorem/
1•surprisetalk•4m ago•0 comments

How to Generate a TLSA Record and Fix the 3 1 1 Mismatch

https://dmarcguard.io/blog/tlsa-record-setup/
1•meysamazad•4m ago•0 comments

Go 1.27 Interactive Tour

https://victoriametrics.com/blog/go-1-27/index.html
1•olexsmir•4m ago•0 comments

A work journal to stay organised and informed

https://silviamaggidesign.com/blog/a-work-journal/
2•meysamazad•4m ago•0 comments

Why is it all in the kernel?

https://lawrencecpaulson.github.io//2026/07/30/Collatz.html
1•ibobev•5m ago•0 comments

Fixing a super 8 projector from the 70s

https://nibblestew.blogspot.com/2026/07/fixing-super-8-projector-from-70s.html
1•ibobev•5m ago•0 comments

Building a Reusable Alpine LXC Template on Proxmox

https://fmartingr.com/blog/2026/07/22/building-a-reusable-alpine-lxc-template-on-proxmox/
1•meysamazad•6m ago•0 comments

Veterans' PTSD resolves with psychedelic therapy in small US study

https://www.reuters.com/business/healthcare-pharmaceuticals/veterans-ptsd-resolves-with-psychedel...
1•giuliomagnifico•6m ago•0 comments

Arch Linux disables AUR package adoption

https://lwn.net/Articles/1086489/
1•database64128•7m ago•0 comments

The C ``Clockwise/Spiral Rule''

https://c-faq.com/decl/spiral.anderson.html
1•etrvic•8m ago•0 comments

New York Alleges Kalshi Is Running Illegal Gambling Operation

https://www.wsj.com/tech/new-york-alleges-kalshi-running-illegal-gambling-operation-18ae71b0
2•1vuio0pswjnm7•8m ago•0 comments

China's MiniMax releases H3 video model

https://www.reuters.com/world/china/chinas-minimax-releases-h3-video-model-2026-07-31/
1•nickthegreek•10m ago•0 comments

Tell HN: Gemini uses your email drafts (if you have "smart features" turned on)

2•logicallee•10m ago•4 comments

Making film archives searchable with machine learning

https://huggingface.co/spaces/davanstrien/prelinger-moments-space
1•cmcollier•13m ago•0 comments

Show HN: I Created Canva Alternative

1•singhH11•14m ago•0 comments

Concrete Is Damaging the Planet, While Defending It from Climate Change

https://www.bloomberg.com/features/2026-world-of-concrete/
2•speckx•14m ago•0 comments

Brute Intelligence

https://benn.substack.com/p/brute-intelligence
1•gmays•14m ago•0 comments

I built a platform that lets startups launch affiliate programs in minutes

https://partnac.com
2•spatocode•15m ago•0 comments

Compact GPS-enabled LoRa mesh communicator

https://specfive.com/products/spec5-minitrekker-mkii
1•DanielSusca•15m ago•0 comments

Kelly Criterion Simulator

https://kellysimulator.com/
1•aleyan•16m ago•0 comments

Ask HN: What E-Reader to Buy?

3•conor_f•18m ago•0 comments

Making the Rails Default Job Queue Fiber-Based

https://paolino.me/solid-queue-doesnt-need-a-thread-per-job/
1•earcar•18m ago•0 comments