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.

Optique 1.1.0: Command discovery, value parsers, and ordered grammars

https://github.com/dahlia/optique/discussions/834
1•dahlia•2m ago•0 comments

Phoenix mostly doesn't drink Colorado River water

https://signaldoctrine.substack.com/p/the-allocation
1•SignalDoctrine•5m ago•0 comments

Note on Rio 3.5 Open

https://twitter.com/IplanRio_rj/status/2066693494769348946
1•thimabi•5m ago•0 comments

What one country's experiment says about attempts to boost birth rates

https://www.bbc.co.uk/news/articles/c5yzdr4ygdno
1•mmarian•15m ago•0 comments

I built a notes app powered by the model that powers Apple Intelligence

https://apps.apple.com/us/app/fog-on-device-ai-notes/id6760272134
1•akshatsaladi•20m ago•1 comments

Ask HN: What was the last thing you built on Fable 5

1•ddmma•23m ago•0 comments

In the Matter of OpenAI vs. LangGraph (2025)

https://www.latent.space/p/oai-v-langgraph
1•mooreds•24m ago•0 comments

DOJ Lawyers Argue xAI Is 'Vital' for National Security in NAACP Lawsuit

https://www.wired.com/story/doj-lawyers-argue-xai-vital-national-security-naacp-lawsuit/
2•ilreb•25m ago•0 comments

EU AI: the fables we told ourselves

https://pleias.ai/blog/fable-eu
1•mooreds•26m ago•0 comments

ShopFoundry – Turn Etsy listings into better titles, tags and descriptions

https://www.shopfoundry.app/
1•daisyjin•26m ago•0 comments

Distro Fighter game: Find your Linux distro and desktop

https://distrofighter.com/
2•ashitlerferad•38m ago•0 comments

Age Verification in Monolith OS

https://monolith-project.org/blog/age-verification/
1•rickcarlino•40m ago•0 comments

Safety Ideas, and a Testable Path

1•GrizzlyMedicine•45m ago•0 comments

AI efficiency gains come at a high energy cost

https://www.ft.com/content/7f1c81ac-775b-4f52-a650-7804e4734d5b
1•1vuio0pswjnm7•47m ago•0 comments

Predictive Data Debugging: Reveal and Shape What Models Learn Before You Train

https://www.goodfire.ai/research/predictive-data-debugging
1•gmays•48m ago•0 comments

Frederic Tudor

https://en.wikipedia.org/wiki/Frederic_Tudor
3•thunderbong•48m ago•0 comments

How Many Elementary Particles Are There, Really?

https://www.quantamagazine.org/how-many-elementary-particles-are-there-really-20260615/
1•ProAm•49m ago•0 comments

Hardest IT roles to fill in 2026 and what's changed

https://www.cio.com/article/4184685/the-11-hardest-it-roles-to-fill-in-2026-and-whats-changed.html
5•WaitWaitWha•52m ago•1 comments

Leaked from Russia: 18 Videos of the Fuel Crisis Growing Fast [video]

https://www.youtube.com/watch?v=yIj3CLqsOXs
1•consumer451•53m ago•0 comments

A weekly read on the US hay market

https://haywireag.com/
2•mooreds•53m ago•0 comments

Microsoft turns to AWS as GitHub faces AI capacity crunch

https://runtimewire.com/article/microsoft-github-aws-ai-capacity-crunch
68•ilreb•54m ago•16 comments

Anthropic Sued over Alleged False Advertising on Claude Max Subscription Limits

https://www.cnet.com/tech/services-and-software/anthropic-sued-alleged-false-advertising-claude-m...
2•SilverElfin•54m ago•0 comments

6th Finger Project (2022) [video]

https://www.youtube.com/watch?v=232jn-Vu6Rk
1•nivethan•55m ago•0 comments

Australia to probe assault claims by Gaza flotilla activists against Israeli[..]

https://www.bbc.com/news/articles/clyx4eny41zo
2•grugagag•56m ago•0 comments

Library

https://benbrown.com/library/
1•toomuchtodo•56m ago•1 comments

San Andreas fault reaches highest stress level in 1k years

https://mauinow.com/2026/06/15/san-andreas-fault-reaches-highest-stress-level-in-1000-years/
2•harambae•57m ago•0 comments

Microsoft Teams introduces office attendance tracking via Wi-Fi

https://www.pcworld.com/article/3165894/from-this-month-onwards-this-microsoft-programme-will-be-...
8•ilreb•58m ago•0 comments

Vance: Iran can have access to $300B reconstruction fund

https://thehill.com/homenews/administration/5924963-vance-iran-300b-reconstruction-fund/
4•GreenSalem•59m ago•2 comments

Woodrow Wilson: America's worst president for free speech

https://expression.fire.org/p/woodrow-wilson-americas-worst-president
4•iamnothere•1h ago•0 comments

The Talk Show: Live from WWDC 2026 [video]

https://www.youtube.com/watch?v=OtRgxqMuUY8
1•Austin_Conlon•1h ago•0 comments