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.

Ask HN: Where do those LLM-generated outreach emails come from?

1•nicbou•1m ago•0 comments

Modern email can be built from borrowed parts

https://en.andros.dev/blog/d7ed8b07/modern-email-can-be-built-from-borrowed-parts/
1•andros•3m ago•0 comments

Would you choose £50k over the chance of £1M?

https://yougov.com/en-gb/daily-results/20260722-c0b92-3
2•yzydserd•6m ago•1 comments

Elevated errors on Claude Opus 5

https://status.claude.com/incidents/lhqp09kxq7pb
1•flyaway123•11m ago•0 comments

Sam Altman says we are in the singularity

https://www.businessinsider.com/sam-altman-openai-the-singularity-agi-prediction-anthropic-nvidia...
1•ColinEberhardt•12m ago•1 comments

Show HN: adCasa OS – AI marketing workspace built with Bayesian attribution

https://adcasa.io/
1•adcasa•13m ago•0 comments

Nvidia in talks with OpenAI to guarantee $250B financing for data center

https://www.reuters.com/business/media-telecom/nvidia-talks-with-openai-guarantee-250-billion-fin...
1•01-_-•14m ago•0 comments

Zeiss expands German site that caps ASML's EUV scanner output

https://www.tomshardware.com/tech-industry/zeiss-expands-german-site-that-caps-asmls-euv-scanner-...
1•01-_-•16m ago•0 comments

Doom Running on a Regex Engine

https://4rh1t3ct0r7.github.io/doom-regex/
1•abareplace•17m ago•0 comments

Meta launched a new AI optimism ad set to a song about human extinction

https://techcrunch.com/2026/07/23/meta-launched-a-new-ai-optimism-ad-set-to-a-song-about-human-ex...
4•robin_reala•21m ago•0 comments

Do Agent Benchmarks Measure Capability? Protocol Validity in the Age of Agentic

https://arxiv.org/abs/2607.22368
1•sbulaev•24m ago•0 comments

I'm running the ICFP programming contest

https://eieio.games/blog/im-running-the-icfp-programming-contest/
1•birdculture•24m ago•0 comments

The AI bioweapon risk isn't jailbreaks

https://point.free/blog/the-ai-bioweapon-risk-isnt-jailbreaks/
1•cafkafk•26m ago•1 comments

Keigo Higashino, author of The Devotion of Suspect X, dies at 68

https://www.oricon.co.jp/news/2470322/
2•linzhangrun•34m ago•0 comments

Even in Utah Families Are Getting Smaller

https://www.nytimes.com/2026/07/25/us/politics/utah-birth-rate-fertility-decline.html
1•geox•41m ago•0 comments

Show HN: A browser-based vector animation engine rendering animated objects

https://thorvg-janitor.vercel.app/
3•hermet•44m ago•2 comments

Show HN: I made a convenient and fast file sharing service

https://coldfiles.dev/
2•bunchy7s•44m ago•5 comments

Show HN: Comparing stock returns after cyber incidents

https://incidentimpact.com/
2•0xad•49m ago•0 comments

Build internal tools for your Startup with Construct AI

https://construct.computer/blog/build-internal-tools-with-construct/
1•ankushKun•50m ago•0 comments

From Seed to Startup: How AI Is Revolutionizing Cannabis Cultivation

https://www.researchgate.net/publication/410602482_From_Seed_to_Startup_How_AI_Is_Revolutionizing...
1•fofoz•57m ago•0 comments

Could a Neuroscientist Understand a Microprocessor?(2017)

http://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1005268
1•num42•1h ago•0 comments

Can a Biologist Fix a Radio?(2002)

https://www.cell.com/action/showPdf?pii=S1535-6108%2802%2900133-2
1•num42•1h ago•0 comments

Reverse Engineering of Biological Complexity(2002) [pdf]

https://courses.physics.illinois.edu/phys498BIO/sp2009/LECTURE7/Doyle.pdf
1•num42•1h ago•0 comments

Ask HN: Does the tech industry require deterministic ML training?

3•Swapnopam•1h ago•0 comments

The Lean Theorem Prover: Design, Evolution, and Impact

https://leodemoura.github.io/static/floc26/
1•tosh•1h ago•0 comments

General Resolution: LLM Usage in Debian

https://www.debian.org/vote/2026/vote_002#texta
2•olalonde•1h ago•0 comments

LVMH CEO Bernard Arnault's open letter responding to Le Monde's investigation

https://twitter.com/i/status/2081439415268790328
1•Michelangelo11•1h ago•0 comments

Building Real-Time Financial Analytics with Stream Processing

https://medium.com/@DolphinDB_Inc/why-stream-processing-matters-and-how-dolphindb-does-it-b63c5dc...
2•chaercling•1h ago•0 comments

CstWeave – On-device, privacy-first Chrome extension for tab region GIFs

1•fujidevv•1h ago•0 comments

Overprint vs. Knockout

https://www.designyourway.net/blog/overprint-vs-knockout/
1•ankitg12•1h ago•0 comments