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.

Bragg Mirrors

https://www.rp-photonics.com/bragg_mirrors.html
1•peter_d_sherman•1m ago•0 comments

Britain's £33M Balancing Day: Was the Wind Forecast Wrong?

https://a115.co.uk/could-a-better-wind-forecast-have-saved-britain/
1•a115ltd•2m ago•0 comments

Super Micro contractor pleads guilty in scheme to divert Nvidia chips to China

https://www.reuters.com/legal/government/super-micro-contractor-pleads-guilty-scheme-divert-ai-se...
1•giuliomagnifico•4m ago•0 comments

Tortugarr – Android TV app and automated installer for the *ARR stack

https://github.com/tortugarr/tortugarr
1•odwar420•6m ago•0 comments

Recognising Type 5 Diabetes

https://www.thelancet.com/journals/langlo/article/PIIS2214-109X(25)00474-7/fulltext
1•theanonymousone•7m ago•0 comments

EUV mirror / soft X-ray mirror

https://keytech.ntt-at.com/en/xray/prd_3004.html
1•peter_d_sherman•7m ago•0 comments

How we migrated Clera's 500 GB production Postgres database overnight

https://www.getclera.com/blog/how-we-migrated-to-clickhouse-managed-postgres
1•saisrirampur•7m ago•0 comments

Aleph Alpha's latest Model playing Doom

https://tesseracted.com/kolibri-1-chat/gameplay/doom
1•kkm•8m ago•1 comments

Residual Matrix Transformers: Scaling the Size of the Residual Stream

https://arxiv.org/abs/2506.22696
1•E-Reverance•9m ago•0 comments

Computer scientist David Silver: 'Where are we going without AI?'

https://www.ft.com/content/462c303b-b96c-4262-a7ca-e9ae7e440828
2•CrypticShift•15m ago•1 comments

Satya Nadella on X: "Models as Insider Risks in the Super Intelligence Era " / X

https://twitter.com/satyanadella/status/2108931348857827686
1•bilsbie•16m ago•0 comments

Resisting the Menace of Federal Data Consolidation

https://www.eff.org/deeplinks/2026/10/resisting-menace-federal-data-consolidation
2•hn_acker•22m ago•0 comments

Thwarted

https://pluralistic.net/2026/10/09/impunitism/
1•hn_acker•23m ago•0 comments

AI Is Getting Good at Messing with Cybercriminals

https://www.wired.com/story/ai-is-getting-really-good-at-messing-with-cybercriminals/
2•Brajeshwar•26m ago•0 comments

Canada can't launch rockets on its own. A few companies want to change that

https://www.cbc.ca/news/business/canada-rocket-launch-sovereignty-nordspace-canada-rocket-company...
2•BiraIgnacio•26m ago•0 comments

Redundancy Is the Engine of Progress

https://world.hey.com/dhh/redundancy-is-the-engine-of-progress-76499402
2•thoughtpeddler•26m ago•0 comments

US Postal Service to Start Exploring Its Always-On Surveillance Options

https://www.techdirt.com/2026/10/09/us-postal-service-to-start-exploring-its-always-on-surveillan...
1•hn_acker•26m ago•0 comments

A versioned filesystem for disposable sandboxes

https://www.shayon.dev/post/2026/283/versioned-filesystem-for-disposable-sandboxes/
1•shayonj•27m ago•0 comments

cedit – a modern DOS-style text editor

https://github.com/scascino404/cedit
1•scascino404•30m ago•0 comments

Baton – Relay for SwiftUI and Compose

https://github.com/shergin/baton
2•shergin•33m ago•0 comments

Angular compiler rewritten in Rust, PR merged to main

https://github.com/angular/angular/pull/71259
2•torsi0n•34m ago•0 comments

Fake Caroline

https://www.cjr.org/analysis/fake-caroline-williams-science-nature-magazine-ai-influx-pitches.php
1•thm•34m ago•0 comments

Is AI Psychosis Real?

https://debarshibasak.github.io/readables/blogs/ai-psychosis-is-real
2•debarshri•35m ago•2 comments

An Ecomodernist Manifesto

https://thebreakthrough.org/manifesto/manifesto-english
1•smj-edison•39m ago•0 comments

Font Comparisons (Vector)

https://commons.wikimedia.org/wiki/Category:Font_comparisons_(Vector)
1•Kaibeezy•40m ago•0 comments

Nvidia-backed Upscale AI launches platform to connect chips from rival suppliers

https://www.reuters.com/business/nvidia-backed-upscale-ai-launches-platform-connect-chips-rival-s...
1•wondersky•40m ago•0 comments

Bag of Decisions Reranker

https://softwaredoug.com/blog/2026/10/08/bag-of-decisions.html
1•zdw•40m ago•0 comments

Ask HN: What are your long-term goals?

1•chistev•42m ago•0 comments

Building a safer path to autonomous industrial AI

https://www.technologyreview.com/2026/10/08/1144020/building-a-safer-path-to-autonomous-industria...
1•joozio•42m ago•0 comments

Type 5 Diabetes- the Rejuvenated Spirit from a Ghost of the Past – PMC

https://pmc.ncbi.nlm.nih.gov/articles/PMC12274040/
1•lightlyused•45m ago•0 comments