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.

Launch HN: Context.dev (YC S26) – API to get structured data from any website

https://www.context.dev
1•TheYahiaBakour•26s ago•0 comments

Hy3

https://hy.tencent.com/research/hy3
1•andai•1m ago•0 comments

How to Set Up DKIM: From Key Generation to a Passing DMARC Report

https://dmarcguard.io/blog/dkim-setup-guide/
1•meysamazad•1m ago•0 comments

A Summer Creativity Experiment

https://brainbaking.com/post/2026/07/a-summer-creativity-experiment/
1•meysamazad•2m ago•0 comments

How to Write an Email

https://blog.dannycastonguay.com/how-to-write-an-email/
1•speckx•2m ago•0 comments

Show HN: Strata – guess the city from its real 3D terrain and bathymetry

https://flightq.app/strata
1•skyq•2m ago•0 comments

Show HN: ADarkTerminal

https://adarkterminal.electricsheep.games
1•rrotaru•2m ago•0 comments

Show HN: Blocks.ai – control plane and network layer for agents

https://blocks.ai
1•BlocksAI•2m ago•0 comments

A Possible Future for Damn Interesting

https://www.damninteresting.com/a-possible-future/
1•mzur•3m ago•0 comments

Show HN: I wrote a Libc-free AOT systems language in JavaScript with no VM

https://github.com/DO-SAY-GO/freelang
1•keepamovin•3m ago•0 comments

Good Pain

https://html-chunder.neocities.org/posts/good-pain/
1•meysamazad•4m ago•0 comments

Motion-first robotic action segmentation beats vision-first SOTA

https://www.nomadicai.com/blog/action-segmentation-benchmark
1•simbasdad•5m ago•0 comments

Deadly bacteria found in city's wastewater system tied to Meta data center

https://www.dailymail.com/sciencetech/article-15962981/mark-zuckerberg-meta-wyoming-ai-data-cente...
3•cdrnsf•7m ago•0 comments

Acronym Fatigue Series part 1: CAP, ACID and friends

https://devz.cl/posts/acronym-fatigue-series-cap-acid-etl-elt/
2•DanielVZ•8m ago•0 comments

New York Times and Other Publishers Ask Court to Penalize OpenAI

https://www.nytimes.com/2026/07/09/technology/new-york-times-openai.html
1•donohoe•8m ago•0 comments

Opinionated and Easy Pi.dev Configuration

https://lazypi.org/
2•lwhsiao•9m ago•0 comments

Coordination Without Consolidation: On Systems of States [pdf]

https://isonomiaquarterly.com/wp-content/uploads/2026/06/iq-4.2-summer-2026-macdonald-coordinatio...
1•brandonlc•9m ago•0 comments

Will We Ever Find Alien Civilizations?

https://www.quantamagazine.org/will-we-ever-find-alien-civilizations-20260709/
2•worldvoyageur•10m ago•1 comments

Stop Using reCAPTCHA – It's Not a Real Captcha

https://na0341.bearblog.dev/info/stop-using-recaptcha/
1•speckx•12m ago•0 comments

Dmars – A modern Core Wars toolchain

https://dmars.drpz.xyz/
1•holliplex•12m ago•1 comments

Childhood stunting fell dramatically over the 20th century

https://ourworldindata.org/childhood-stunting-fell-dramatically-over-the-20th-century
1•surprisetalk•12m ago•0 comments

Show HN: Sticky notes that disappear from screen sharing

https://www.noticky.app/en
1•leotryhard•15m ago•0 comments

Show HN: LastShelf – an emergency map of your family's documents bills& contacts

https://www.lastshelf.ai/
4•sbrown12•15m ago•0 comments

The Shifting Landscape of Headquarters Relocations: 2026 Update

https://www.cbre.com/insights/viewpoints/business-insights-the-shifting-landscape-of-headquarters...
1•throwoutway•15m ago•0 comments

Bytechef open source platform for AI agent orchestration and workflow automation

https://github.com/bytechefhq/bytechef/tree/master
1•taubek•16m ago•0 comments

How to design a cancer vaccine (and improve them)

https://www.owlposting.com/p/how-to-design-a-cancer-vaccine-and
1•abhishaike•16m ago•0 comments

Show HN: CashFlow

https://cashflow-phi-amber.vercel.app/
1•SanishKumar•19m ago•1 comments

Automated Repair for Apache Cassandra

https://github.com/thelastpickle/cassandra-reaper
1•dockerd•19m ago•0 comments

PostgreSQL 19 vs. Memgraph: Comparing Graph Traversal Performance

https://memgraph.com/blog/postgresql-19-alternatives-memgraph
1•taubek•20m ago•0 comments

LeadDev AI Impact Survey

https://www.research.net/r/ai_impact_26
1•mooreds•20m ago•0 comments