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.

China to Potentially Restrict Open-Weights Model Exports

https://www.reuters.com/world/asia-pacific/china-proposes-adding-40-ai-biotech-solar-technologies...
1•gr_norm•2m ago•0 comments

Show HN: Connectio – One local address for all your development servers

https://connectio.pulkitbanta.com/
1•pulkitbanta•6m ago•0 comments

Bloomberg NEF on the Future of Global Energy [video]

https://www.youtube.com/watch?v=y94yV7WUwGY
1•thelastgallon•7m ago•0 comments

MapQuest will now show you where Flock cameras are in your neighborhood

https://www.engadget.com/2288729/mapquest-will-now-show-you-where-flock-cameras-are-in-your-neigh...
1•wondersky•7m ago•0 comments

Show HN: Tensor Golf – Practise PyTorch Through Short Drills

https://tensor.golf
1•singular_atomic•8m ago•0 comments

DragonRuby – I never wanted to create a game engine

https://gist.github.com/amirrajan/9e71d13f3108e5e66ebc98c752337ca5
2•amirrajan•11m ago•0 comments

Yonaguni Monument: Natural Formation or Man-Made Ruin?

https://geoscopy.com/yonaguni-monument-natural-formation-or-man-made-ruin/
1•peter_d_sherman•15m ago•0 comments

SF AI Founder's Zombie Shooter Game Turns Tenderloin Residents into Targets

https://sfist.com/2026/10/15/sf-tech-founders-zombie-shooter-game-turns-tenderloin-residents-into...
1•ubiquitysc•21m ago•0 comments

Butlerian Jihad

https://dune.fandom.com/wiki/Butlerian_Jihad
41•wetwater•22m ago•12 comments

Show HN: Let AI order DoorDash for me – under my watch – no playwright

https://www.wysebee.com
1•zxu•24m ago•0 comments

Enitre Chat history Is Gone, overnight

https://github.com/zai-org/feedback/issues/1064
1•97laos•25m ago•0 comments

Cloud computing is a trap, warns GNU founder Richard Stallman (2008)

https://www.theguardian.com/technology/2008/sep/29/cloud.computing.richard.stallman
8•arm32•29m ago•2 comments

An Introduction to EUV Sources for Lithography [pdf]

https://strobe.colorado.edu/wp-content/uploads/STROBE_ASML-EUV-Sources_Purvis_25-Sept-2020-1.pdf
1•pillars•33m ago•0 comments

Publishers' Trust in Nippan Dented by Unauthorized Book Sales for AI Training

https://japannews.yomiuri.co.jp/science-nature/technology/20261014-353599/
2•mushstory•35m ago•0 comments

China is second only to the U.S. in healthcare costs as a percentage of income

https://www.cnbc.com/2026/10/15/chinese-spending-nearly-as-much-of-income-as-americans-on-healthc...
2•lxm•38m ago•0 comments

Show HN: Twain, a diff viewer like Meld, but for the age of AI

https://github.com/andunieee/twain
1•andunie•39m ago•0 comments

Using a funded cryptocurrency wallet without authorization

https://alignment.openai.com/misalignment-reports/using-a-funded-test-cryptocurrency-wallet-witho...
1•pamcake•43m ago•0 comments

Who Was the Buddha?

https://upekkhaorg.substack.com/p/who-was-the-buddha
2•arihantparsoya•44m ago•0 comments

Moss-Image: Text-to-Image Generation with Native Layout Control

https://openmoss.ai/MOSS-Image/
2•b0ner_t0ner•45m ago•0 comments

Overlooked brown fat in our bodies linked to wide range of health benefits

https://www.nature.com/articles/d41586-026-03302-w
1•gmays•46m ago•0 comments

ICS Space Events Calendar

https://github.com/lkorth/space-calendar
2•lkorth•47m ago•0 comments

Ask HN: Should I use Claude Code to create a replacement Apple IIGS ROM?

1•jkalbfeld•50m ago•2 comments

Show HN: FeedTamer – Filter YouTube by word, channel, topic, or allowlist

https://thefeedtamer.com/
1•thefeedtamer•54m ago•0 comments

Ask HN: Claude Code since the last update "Held message from another session"

1•consumer451•55m ago•0 comments

The trickle-down economics of the AI boom

https://www.economist.com/finance-and-economics/2026/09/17/the-trickle-down-economics-of-the-ai-boom
2•gwintrob•56m ago•0 comments

AI Gateway Governance

https://github.com/ddruhin/ai-gateway-governance-reference-architecture
1•ddruhin•57m ago•0 comments

AI Service Indicators

https://github.com/synapticcybersecurity/ai-service-indicators
1•harryhoffman•58m ago•0 comments

Matrix Gradients, Without the Pain

https://alexwang.ai/posts/derivatives-and-gradients/
1•auraham•59m ago•0 comments

The Data Layer Is Where AI Goes to Die

https://www.druhindhavala.com/ai-governance/the-data-layer-is-where-ai-goes-to-die/
2•ddruhin•1h ago•0 comments

Putin envoy says Russia and US are discussing joint deals including data centres

https://www.reuters.com/world/dmitriev-says-russian-wealth-fund-will-work-with-us-payment-diesel-...
4•jacquesm•1h ago•0 comments