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.

Managers Are Catalysts

https://laughingmeme.org/2026/09/14/managers-are-catalysts.html
1•mavelikara•1m ago•0 comments

Opus 5 has a Noun Problem

https://www.reddit.com/r/ClaudeCode/comments/1wk0s2i/opus_5_has_a_noun_problem/
1•nonethewiser•4m ago•1 comments

Science Is Open Software

https://jepedersen.dk/blog/202505_research/
1•jegp•7m ago•1 comments

Show HN: LaTeX to Image Converter – Free PNG, SVG and JPG

https://latextoimg.com
1•light001•11m ago•0 comments

Let's Fix Bug Bounty

https://fixbugbounty.com/
2•nwang783•13m ago•0 comments

The Rise of Parasite Authors

https://www.theatlantic.com/technology/2026/09/ai-authors-impersonating-writers-amazon/688709/
3•pseudolus•13m ago•1 comments

Show HN: Swormhörn a one-of-one cicada synthesizer [video]

https://www.youtube.com/watch?v=GHiStriaaso
2•zorlack•17m ago•0 comments

Elon Musk and Tesla Forged a New EV Path

https://spectrum.ieee.org/elon-musk-tesla
4•vinhnx•20m ago•0 comments

Einstein on the Atomic Bomb (1945)

https://www.theatlantic.com/magazine/archive/1945/11/einstein-on-the-atomic-bomb/656626/
3•cisc•23m ago•0 comments

Official mold linker rewrite in Rust

https://github.com/rui314/mold
2•adamnemecek•26m ago•0 comments

I found love at an Irish matchmaking festival – and I want others to do the same

https://www.bbc.com/news/articles/cw5y4jz6k2p3o
1•rmason•28m ago•1 comments

The Contract on America

https://3quarksdaily.com/3quarksdaily/2026/09/the-contract-on-america.html
2•hkhn•28m ago•1 comments

Plotly for Highly Customizable and Non-Interactive Data Visualization

https://chris-parmer.com/plotly-for-highly-customizable-and-non-interactive-data-visualization/
1•chriddyp•31m ago•0 comments

Master of Malt Hacked, User Data Compromised

https://www.masterofmalt.com/sorry/
1•Naracion•32m ago•0 comments

Prompts Aren't Real

https://evaluation.club
1•mcfunley•34m ago•1 comments

Kev – A Jev-Compatible API on top of DiffusionGemma running on Workers AI

https://kev.workers-ai-mle.workers.dev/
1•kflansburg•36m ago•1 comments

Gemini hacked three companies in first known breakout by Google's AI

https://www.reuters.com/business/gemini-hacked-three-companies-first-known-breakout-by-google-ai-...
5•usernomdeguerre•48m ago•2 comments

Nuclear tests at Mt. Mantap have reactivated intraplate faults

https://www.science.org/doi/10.1126/science.adx5917
1•geox•53m ago•0 comments

NIST Elliptic Curves Seeds Bounty (2023)

https://words.filippo.io/seeds-bounty/
1•greyface-•54m ago•0 comments

Google's Gemini becomes latest AI model to break out and hack computer systems

https://www.cnbc.com/2026/09/18/googles-gemini-becomes-latest-ai-model-to-break-out-and-hack-comp...
4•ahmedhossamdev•1h ago•1 comments

Australian government considers ban on smart glasses in public buildings

https://www.theguardian.com/technology/2026/sep/17/albanese-government-considers-world-leading-ba...
2•dabinat•1h ago•0 comments

Muse gets all your unclaimed money back!

https://auth.muse.ai/aymh/?origin=https%3A%2F%2Fmuse.ai
1•mayahalp•1h ago•0 comments

Show HN: Typesafe Java SDK (Unofficial)

https://github.com/QAInsights/typesafe-java-sdk
1•qainsights•1h ago•1 comments

The Race for 1000 Goals

https://1k.football/
1•anydigital•1h ago•0 comments

Rare Gene Drastically Raises Lung Cancer Risk in People Who Never Smoked

https://www.nytimes.com/2026/09/17/science/lung-cancer-gene-mutation-risk.html
2•bookofjoe•1h ago•1 comments

macOS Liquid Glass in VS Code: Cursed or Blursed?

https://alec.is/posts/macos-liquid-glass-and-vscode/
1•arm32•1h ago•0 comments

Federated Learning Is Not Private for Google GBoard Next Word Prediction [pdf]

https://arxiv.org/abs/2210.16947
1•thunderbong•1h ago•0 comments

Trump deal keeps Greenland Danish while expanding U.S. military presence

https://apnews.com/article/trump-greenland-military-denmark-4cf77cb4608b685a70410bd679479193
3•aoli-al•1h ago•0 comments

What I Can Remember

1•fractal618•1h ago•2 comments

Federal watchdog accuses Humana, UnitedHealthcare of upcoding

https://www.healthcaredive.com/news/hhs-oig-audit-humana-unitedhealthcare-medicare-advantage-upco...
3•elo2000•1h ago•0 comments