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.

Uncle Bob: My current strategy is to not read any code written by my agents

https://xcancel.com/unclebobmartin/status/2080257779395154409
1•ivm•2m ago•0 comments

China's All-Out Push to Catch Up with American AI Chips

https://www.wsj.com/world/china/china-ai-chips-race-949050d0
1•giuliomagnifico•9m ago•0 comments

Cookware Got Worse on Purpose: Who Owns Pyrex and All-Clad Now

https://www.worseonpurpose.com/p/your-cookware-got-worse-on-purpose
1•tortilla•10m ago•1 comments

Is it even possible for the Chinese Labs to distill US models?

https://www.completeskeptic.com/p/is-it-even-possible-for-the-chinese
1•gk1•12m ago•0 comments

Zuckerberg Emojis

https://rybakov.com/blog/zuckerberg_emojis/
8•ms7892•16m ago•0 comments

A Dying Art: The last of the morticians

https://harpers.org/archive/2026/08/a-dying-art-john-semley-mortuary-sciences-competition/
1•Petiver•17m ago•0 comments

Amid security concerns, MIT to spend over $3M on over 500 surveillance cameras

https://thetech.com/2026/04/16/ai-surveillance-cameras
2•Cider9986•17m ago•1 comments

The Sad Wives of AI

https://www.wired.com/story/meet-the-sad-wives-of-ai/
1•tlyleung•23m ago•1 comments

Zitron: The Subprime Datacenter Crisis

https://www.wheresyoured.at/the-subprime-data-center-crisis/
5•benwen•32m ago•1 comments

Show HN: Generous free tier for SERP and AI web scraping

https://cloro.dev/
1•rbatista19•33m ago•0 comments

Racy short story by Alan Turing offers glimpse of 'playful, funny, cheeky' side

https://www.theguardian.com/science/2026/jul/24/alan-turing-short-story
2•defrost•35m ago•0 comments

Google's slump in AI race driven in part by low morale

https://www.axios.com/2026/07/23/googles-deep-mind-ai-model-race
3•1vuio0pswjnm7•38m ago•1 comments

EU hits Google with $1B fine over its Play app store and search

https://apnews.com/article/google-eu-competition-fine-antitrust-play-search-199c77e09d3829ebfc3d9...
2•1vuio0pswjnm7•39m ago•1 comments

Motion Hero – GSAP Shopify Animations

https://apps.shopify.com/motion-hero
1•Moonimpact•40m ago•0 comments

Lock TF IN: an AI drill sergeant that roasts skipped workouts

https://apps.apple.com/us/app/lock-tf-in-ai-companion/id6788896897
1•symbiex•43m ago•0 comments

Huawei ban to cost the EU up to €40B, says industry

https://www.politico.eu/article/telecom-industry-estimates-huawei-ban-cost-europe-40-billion/
1•giuliomagnifico•46m ago•0 comments

AI will not trigger employment collapse, staffing company Adecco Group says

https://www.reuters.com/business/ai-will-not-trigger-employment-collapse-staffing-company-adecco-...
2•gnabgib•56m ago•0 comments

Flux 3: From AI image generation to visual intelligence

https://textideo.com/model/flux-3
1•Nancylily•58m ago•0 comments

Why hasn't AI increased unemployment?

https://twitter.com/PeterMcCrory/status/2079979321607745905
1•Ariarule•58m ago•0 comments

Ageless Atlas – a biological age proxy across the 12 hallmarks of aging

https://agelessatlas.com/
1•luciabazanw•59m ago•0 comments

A Great Deal of Information About Hacker News

https://vale.rocks/posts/hacker-news
2•YounesDz•1h ago•0 comments

Kat-Coder-v2.5 Technical Report (Qwen3.6-35B-A3B base for post-training)

https://arxiv.org/abs/2607.05471
1•truth_seeker•1h ago•0 comments

Midscroll – Windows mm autoscroll for Linux, works on Wayland and X11

https://github.com/gnhen/midscroll
1•gnhen•1h ago•0 comments

De-link: open-source eInk reader (hardware)

https://de-link.me/
1•Naracion•1h ago•2 comments

UK AISI / Caisi Preliminary Assessment of Kimi K3's Cyber Capabilities

https://www.nist.gov/news-events/news/2026/07/uk-aisi-caisi-preliminary-assessment-kimi-k3s-cyber...
3•madars•1h ago•0 comments

Intel committed to manufacturing 14A node

https://bsky.app/profile/rogoway.bsky.social/post/3mrdwvtowxa2n
1•osnium123•1h ago•2 comments

The cost model of microfront ends, from first principles

https://medium.com/@andrew.redican.mejia/microfrontends-from-first-principles-178aafe02ce5
2•andrew_redican•1h ago•0 comments

Russian head of World Chess suspends activity over EU sanctions

https://www.reuters.com/sports/russian-head-fide-suspends-activity-over-eu-sanctions-2026-07-23/
2•ChrisArchitect•1h ago•1 comments

Tinfoil – Private AI

https://tinfoil.sh
1•gurjeet•1h ago•0 comments

Starlink v5 flat vs. v4 flat (standard) dimension and weight comparison

https://starlink.com/bl/support/article/5465736f-fa8d-3ac1-dd3a-7a259d12fa8d
1•walrus01•1h ago•0 comments