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.

SceneWeave: Local-first video production with hardware-bound modules

https://2tinteractive.com/solutions/sceneweave/
1•LebToki•7m ago•0 comments

Show HN: Interactive Rubik's Cube in the browser – one-shot DeepSeek flash

https://asamarts.github.io/deeprubik/
2•aleqs•9m ago•0 comments

Tesla FSD V15 offers visualizations that distract from "25x"

https://www.forbes.com/sites/bradtempleton/2026/11/22/tesla-fsd-v15-offers-stunning-visualization...
1•teleforce•12m ago•0 comments

US Military supremacy in Asia is over

https://www.lowyinstitute.org/the-interpreter/us-military-supremacy-in-asia-is-over
1•iLuddite•18m ago•0 comments

Twig 1.18 – Android file manager with SQLite browsing and NFS support

https://github.com/dev2ex/twig/releases/tag/v1.18.0
1•dev2ex•20m ago•0 comments

Opposition to Galileo was scientific, not just religious (2016)

https://aeon.co/ideas/opposition-to-galileo-was-scientific-not-just-religious
1•zenincognito•21m ago•0 comments

Horns

https://kunal.live/unlearning/horns/
1•herbertl•25m ago•0 comments

Human-readable reconstruction of the Alpöge/Claude RH argument

https://github.com/jimjamzola/RH-Alpoge-Reconstruction
1•frozenseven•29m ago•0 comments

Judge denies motion to dismiss DRAM price-fixing lawsuit

https://www.tomshardware.com/tech-industry/big-tech/judge-denies-motion-to-dismiss-dram-price-fix...
1•oldfuture•30m ago•0 comments

Free IQ Test

https://iqtestexam.com
1•dynatechhub•32m ago•0 comments

Show HN: Just Dashboard, open-source Linux management dashboard

https://just-dashboard.com/
2•Wayy10•32m ago•0 comments

Lean proof of the Riemann hypothesis: an interactive map

https://riemannhypothesissolved.com/
2•gmays•38m ago•1 comments

Invisible Friend – Secret Santa from one link, no email or accounts

https://invisiblefriend.app
1•gonzalezjorge•39m ago•0 comments

LLMs Reproduce Human Purchase Intent via Semantic Similarity of Likert Ratings (2025)

https://arxiv.org/abs/2510.08338
2•thunderbong•41m ago•0 comments

H-1B Visa Workers Are Fed Up and Abandoning American Tech Jobs

https://www.bloomberg.com/news/articles/2026-11-20/h-1b-visa-delays-and-trump-rules-force-tech-wo...
4•nreece•44m ago•0 comments

Race realism: a deeply flawed and half-baked field revitalized by the far-right

https://theconversation.com/race-realism-why-scientifically-flawed-approach-fails-to-present-a-re...
5•paimapi•46m ago•0 comments

YC Startup working on Cost per Kill for missiles

https://www.wired.com/story/henrijs-dandzbergs-polemos-missiles-ai-warfare/
5•MarsZebra•47m ago•1 comments

The Sovereign – a research lab that never stops

https://github.com/cpldxx/the-sovereign
1•jisangwon1012•51m ago•0 comments

VistaPrint applies generative AI edits to prints without consent or warning

https://bsky.app/profile/mostlybree.kitrocha.com/post/3n2vxgsvrhs2q
5•thereader12•53m ago•1 comments

You Can Use Your Old Laptop to Block Ads on Every Device in Your House

https://www.bgr.com/2322247/how-to-use-your-old-laptop-block-ads-every-device/
2•nephihaha•55m ago•0 comments

Yann LeCun correcting the record on Jensen Huang

https://twitter.com/AlexTensor/status/2124373947864989881
3•MrBuddyCasino•56m ago•0 comments

Artex can now control a C2 and get ADMIN/SYSTEM access in minutes

https://medium.com/@nukeratframework/artex-can-now-control-a-c2-and-get-admin-system-access-in-mi...
1•JohnTheTitor•58m ago•0 comments

Why did 7-Eleven fail in India

https://finshots.in/archive/why-did-7-eleven-fail-in-a-country-obsessed-with-convenience/
2•vismit2000•59m ago•0 comments

Harness-Zero: Harness Distillation via Agent-as-Harness

https://arxiv.org/abs/2609.24974
3•echion•1h ago•1 comments

It Will Never: confident predictions and verdicts about AI [video]

https://www.youtube.com/watch?v=_Zzv15cwG1A
2•rib3ye•1h ago•0 comments

An effort to circumvent the Electoral College may be within reach

https://www.npr.org/2026/11/21/nx-s1-6044237/electoral-college-national-popular-vote-interstate-c...
2•andsoitis•1h ago•2 comments

Site uses circadian lighting, next big thing interfaces

https://estrella.pe/
1•ray_•1h ago•0 comments

No SPEAKER: sound and music from your Mac's trackpad

https://github.com/os6/nospeaker
3•putlake•1h ago•0 comments

Legit Reptilian behind NYC Mayor Mamdani at Press Conference 11/21/26

https://www.reddit.com/r/HighStrangeness/comments/1y26ptc/legit_reptilian_behind_nyc_mayor_mamdan...
1•tardismechanic•1h ago•0 comments

Advanced Character Physics (2001) [pdf]

https://www.cs.cmu.edu/afs/cs/academic/class/15462-s13/www/lec_slides/Jakobsen.pdf
4•tomatofu•1h ago•0 comments