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.

Wall Street banks launch record $60B chip deal for Broadcom and Anthropic

https://www.ft.com/content/5b9c8ce3-d07c-46f9-8cea-cbc4e7f8ccca
1•mfiguiere•1m ago•0 comments

OpenASIP: Tools for design and programming of customized co-processors

https://github.com/cpc/openasip
1•mehmetoguzderin•2m ago•0 comments

You were born without an account

https://simplex.chat/why/
1•Cider9986•4m ago•0 comments

Harbor: Evaluate Agents in Sandboxed Environments

https://www.harborframework.com/
1•stefanpie•5m ago•0 comments

This Month in Ladybird – September 2026

https://ladybird.org/newsletter/2026-09-30/
2•exploraz•7m ago•0 comments

Find the flattest route between any two points in SF

https://flattensf.com/
1•ishan0102•9m ago•0 comments

Google Wallet for Android adds 12th digital U.S. state ID

https://9to5google.com/2026/10/05/google-wallet-id-oklahoma/
1•devy•10m ago•1 comments

Why journalism startups fail–and what investors should know

https://capitalstacks.media/report/buschow
1•doener•14m ago•0 comments

Against Death: A Cybernetic Manifesto

https://docs.google.com/document/d/1J_R9qc-J0SRd4XMTU4TLIfoKJlVMBNYbHBgfPXxVs5k/edit?usp=sharing
1•shaunxcode•14m ago•0 comments

Laravel Rust Is Coming

https://twitter.com/taylorotwell/status/2107117389762515319
1•criexe•15m ago•0 comments

Top Consumer AI Apps

https://www.a16z.news/p/top-100-consumer-ai-apps-seventh
1•svobodamartin•16m ago•0 comments

A Fond Farewell to Three Rust Foundation Colleagues

https://rustfoundation.org/media/a-fond-farewell-to-three-rust-foundation-colleagues/
2•wslh•17m ago•0 comments

Computer Graphics: Past to Present

https://taosengine.com/docs/graphics/index.html
1•mariuz•18m ago•0 comments

Agent Memory Repo

https://cognition.com/agent-memory-repo
1•handfuloflight•18m ago•0 comments

Is What We're Watching True or False?

https://www.newyorker.com/culture/on-television/is-what-were-watching-true-or-false
1•bookofjoe•20m ago•1 comments

Show HN: Ototo: A tool to offload code exploration to a smaller model

https://ototo.dev/
1•schoenobates•24m ago•0 comments

Mobile-first SCUMM-style point-and-click engine

https://github.com/wanoo/web-scumm
1•plaguna•24m ago•0 comments

Show HN: I recreated "Crazy Ones" ad as an animated web tribute to Steve Jobs

https://crazy.eyad.com/
1•eyadnour•25m ago•0 comments

Wealth Against Commonwealth (1994)

https://en.wikipedia.org/wiki/Wealth_Against_Commonwealth
1•_doctor_love•25m ago•0 comments

Not a Wedding Crasher

https://www.notaweddingcrasher.com/
2•gregsadetsky•26m ago•0 comments

Turkey's 20B ponzi scheme collapsed

https://www.reuters.com/world/middle-east/how-turkeys-investment-fund-bubble-burst-2026-10-02/
3•xkcd1963•26m ago•0 comments

Which brain computer interface is better for research in 2026

https://ildarr2016.medium.com/pieeg-vs-openbci-emotiv-and-muse-an-honest-founders-comparison-acbf...
1•Christiangmer•27m ago•0 comments

Why your Claude Code routine reported success and did nothing

https://runbook.scosovan.com/claude-code-routine-reported-success-did-nothing/
1•guidohatzis•29m ago•0 comments

At-Protocol Based Encrypted Firmware Management Project

https://github.com/ListeningPost/open-firmware-manager
2•anonymous-aliga•32m ago•1 comments

CIA Report Warns Israel Could Head Toward Civil War, Total Collapse

https://www.dropsitenews.com/p/cia-report-israel-civil-war-collapse
5•lorecore•33m ago•0 comments

Dust: Pretraining Transformers Without Backpropagation

https://qlabs.sh/research/dust
8•E-Reverance•34m ago•0 comments

Exit interviews with defectors from OpenAI, Anthropic, and DeepMind

https://nymag.com/intelligencer/article/ai-researchers-quit-openai-anthropic.html
2•MBlume•35m ago•0 comments

Nix on the Steam Frame

https://johns.codes/blog/nix-on-steam-frame
1•ibobev•38m ago•0 comments

Show HN: Sideloop – Re-sign sideloaded iOS apps over Wi-Fi before they expire

https://github.com/filippofinke/sideloop
1•filippofinke•38m ago•0 comments

Testing AI on Real-World Tasks

https://www.vals.ai/home
2•doener•39m ago•0 comments