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.

Victoria Secret Video Generator – Turn a photo into a runway video

https://victoriasecretvideo.com/
1•visiohex•1m ago•0 comments

Tiny possum and glider thought extinct for 6000 years found in remote West Papua

https://www.bbc.com/news/articles/cp814l80pw2o
1•bryanrasmussen•2m ago•0 comments

When do people experience mental health conditions for the first time?

https://ourworldindata.org/when-do-people-experience-mental-health-conditions-for-the-first-time
1•stared•4m ago•0 comments

ICANN testing tech to let law enforcement access non-public WHOIS info

https://www.theregister.com/networks/2026/10/20/icann-testing-tech-to-let-law-enforcement-access-...
1•HotGarbage•5m ago•0 comments

AegisKernel – Zero-Trust deterministic security runtime for AI agents

https://github.com/adikshatriyag-crypto/aegis-kernel
2•adityawebde•10m ago•0 comments

Show HN: I made the most simple pie chart maker

https://www.createpiechart.com/
2•atharvtathe•17m ago•0 comments

Ask HN: How do you decide to cut scope when AI makes it so easy to add?

1•harlequinetcie•23m ago•1 comments

Virtual3D – Vulkan 3D Engine&Editor

https://starsigndev.itch.io/virtual3d
1•antonyrobwells•26m ago•0 comments

Taking Back the Copilot Button

https://smarmelling.com/posts/taking-back-the-copilot-button.html
3•smarmelling•32m ago•1 comments

Morstdio: Baremetal Morse Code I/O

https://gbkorr.github.io/r-bites/morstdio/morstdio.html
1•austinallegro•33m ago•0 comments

Australia Set to Sue Facebook, TikTok in Child-Safety Push

https://www.bloomberg.com/news/articles/2026-10-20/australia-to-sue-facebook-tiktok-for-alleged-b...
3•snikolaev•34m ago•0 comments

The Role of Exposition in the Future of Mathematics – Grant Sanderson [video]

https://www.youtube.com/watch?v=PtCPLLuMK1o
1•num42•41m ago•0 comments

A free Omarchy course: 25 modules and a capstone

https://stevinator.com/courses/omarchy/
2•smanookian•44m ago•1 comments

Why elevators keep anesthesia professionals up at night [4 min] [video]

https://www.youtube.com/watch?v=N4VGVEdN458
2•privacyishuman•44m ago•0 comments

Friction as a Feature

https://emilkowal.ski/ui/friction-as-a-feature
1•phartenfeller•47m ago•0 comments

Okay to share a free tool for field techs?

https://woextractor.com/
1•Syberscream•51m ago•1 comments

GitHub: Some Git over HTTPS may temporarily require authentication

https://github.blog/changelog/2026-10-19-some-git-over-https-may-temporarily-require-authentication/
4•csmantle•1h ago•0 comments

I turned a song into a Machine [video]

https://www.youtube.com/watch?v=6nULQQQZcvE
1•rslice•1h ago•0 comments

Pax8 Launches 8os

https://www.pax8.com/en-us/news-post/pax8-launches-8os-the-first-agentic-workforce-operating-syst...
1•simonjgreen•1h ago•0 comments

Quantum error correction well below the color code threshold [pdf]

https://cdn.prod.website-files.com/669960f53cd73aedb80c8eea/6ad6013f8ae0364b2cd03c53_c8c5526bc884...
1•unprovable•1h ago•0 comments

Field access in a Rust debug REPL, without reflection

https://github.com/100010/pry-rs
2•yoheisenju•1h ago•2 comments

Textus – WYSIWYG Markdown editor with built-in AI writing tools

https://textus.catvinci.com/
1•cobychapple•1h ago•0 comments

Ask HN: How to get the most intelligence out of your agents?

3•thechairman12•1h ago•2 comments

Training a Search-R1 Agent with Flame

https://xflops.io/blog/training-search-r1-with-flame/
1•k82cn•1h ago•0 comments

Where your money grows fastest

https://crazysoftwarecoder.github.io/where-it-grows/
1•ashyferny•1h ago•0 comments

Owners who spend more time close to their cats tend to have more positive moods

https://www.eurekalert.org/news-releases/1148065
3•gmays•1h ago•0 comments

Show HN: Visual heat map of AI news updated hourly

https://ai-news.jagular.io
1•jnaina•1h ago•0 comments

I put my cell number on my startup's homepage

1•civitasinnovare•1h ago•1 comments

Superintelligence Strategy (2025)

https://www.nationalsecurity.ai
2•reasonableklout•1h ago•1 comments

Americans Are Spending More Money to Drive Worse Cars

https://www.theatlantic.com/technology/2026/10/americans-not-buying-electric-cars/689071/
25•fortran77•1h ago•42 comments