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.

Ask HN: PQC Reading List?

1•horsellama•2m ago•0 comments

Show HN: Padar.ai – A multiplayer workspace for agentic product development

https://www.padar.ai/
1•mteoharov•2m ago•0 comments

Posturelia – a desktop flower that droops when you slouch

https://posturelia.com/
2•colorfulbit•3m ago•1 comments

A time travel game with consistent timelines [video]

https://www.youtube.com/watch?v=iVI7DV9NW_8
1•stared•4m ago•0 comments

Show HN: Herdr Orchestrator Layout

https://github.com/skowalskidev/dark-night-herdr
1•simon7k13•6m ago•0 comments

Phone.inc – Turn your personal phone into a business phone

https://www.phone.inc/
1•pertempto•7m ago•0 comments

Show HN: Maity – Control center and sandboxed runner for coding agent fleets

https://github.com/oliver-zehentleitner/maity
1•ozehentleitner•10m ago•0 comments

Open problems in science in the time of AI

https://aisciencetracker.org/research-problems.html
1•marcellopichini•11m ago•0 comments

From 'if RSA-2048 fell' to 'should we worry about cryptography?' A calm series

https://luisalima.com/notes/should-we-worry-about-cryptography/
1•luisalima•13m ago•0 comments

Twice-recycled fuel loaded into BN-800 fast neutron reactor

https://www.world-nuclear-news.org/articles/twice-recycled-fuel-loaded-into-bn-800-fast-neutron-r...
1•mpweiher•15m ago•0 comments

AegisVault Pro: 100% Client-Side, Zero-Knowledge PDF, OCR and QR Studio

https://aegisvault-pro.vercel.app
1•agdenethmihiran•16m ago•0 comments

Can you patch Ruby faster now?

https://paagman.dev/can-you-patch-ruby-faster-now/
1•thunderbong•18m ago•0 comments

Left to Prove – Utils with Proofs

https://lefttoprove.com/?hn
2•collateral0•20m ago•0 comments

The Star Wars: Starfighter teaser is finally here

https://arstechnica.com/culture/2026/11/the-star-wars-starfighter-teaser-is-finally-here/
1•vintagedave•20m ago•1 comments

FreeHand: Harness is the one that decides the least

https://microsoft.github.io/FreeHand/
2•dsalaj•20m ago•1 comments

Advent of Proof 2026 Edition

https://typesig.pl/2026/11/21/advent-of-proof-2026.html
2•fuglede_•24m ago•0 comments

Beckmann Transport Models: From Autonomous Flows to One-Step Maps

https://arxiv.org/abs/2608.01692
1•nivter•27m ago•0 comments

Echo is a digital sanctuary for fleeting voices

https://up.aham.ro/en/share-15-second-voice-moments-and-listen-to-echoes-from-others-IO
1•ahamro•27m ago•0 comments

Tell HN: Do not let AI use AWS in browser

2•haburka•28m ago•1 comments

NSA Urging Rapid Transition to Post-Quantum Cryptography

https://www.schneier.com/blog/archives/2026/12/nsa-urging-transition-to-post-quantum-cryptography...
5•_tk_•29m ago•1 comments

Alpine Linux 3.25.0 Released

https://www.alpinelinux.org/posts/alpine-3.25.0-released/
1•pella•29m ago•0 comments

Data Pipeline Design Patterns: 9 Fixes for the Failures Every Pipeline Hits

https://vertexfrontier.com/data-pipeline-design-patterns/
1•ahmed2208•30m ago•0 comments

Collecting (2004)

https://archive.swarthmore.edu/www1/Humanities/tkitao1/collecting.html
1•alembic_fumes•30m ago•0 comments

WhatsApp Group Chats Now Work with Third-Party App in Europe

https://www.macrumors.com/2026/12/04/whatsapp-group-chats-balsio-europe/
1•tosh•31m ago•0 comments

The Front Page · Dec 3, 2026

https://hndocs.org/t/the-front-page-dec-3-2026/
1•lusob•32m ago•0 comments

Two intact royal tombs discovered in Guatemalan jungle

https://arstechnica.com/science/2026/12/two-intact-royal-tombs-discovered-in-guatemalan-jungle/
3•nobody9999•34m ago•0 comments

Liquid Glass Navbar – Homebuild

https://stef-hall.github.io/stefansworld-liquid-glass/nav-demo.html
3•stefanhall05•36m ago•1 comments

Why x86 is unfathomably bloated

https://oxetene.net/why-x86-is-unfathomably-bloated/
3•signa11•36m ago•0 comments

MemeReel-Turn your photo into an AI meme video

https://www.memereel.io/
1•kevinnzheng•37m ago•0 comments

You Are Not Late (2014)

https://kk.org/thetechnium/you-are-not-late/
1•Malfunction92•38m ago•0 comments