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.

Anthropic Dispatches Staff to D.C., Racing to Resolve AI Export Restrictions

https://www.wsj.com/tech/ai/anthropic-dispatches-staff-to-d-c-racing-to-resolve-ai-export-restric...
1•thm•1m ago•0 comments

I know I can, but should I? Capability vs. Intent in the AI Goldrush

https://aibuilderseries.substack.com/p/i-know-i-can-but-should-i-capability
1•seantheviking•1m ago•0 comments

Asterinas: A production-grade Linux-compatible alternative kernel

https://asterinas.github.io/
1•yankcrime•3m ago•0 comments

UK Brings in Full Social Media Ban for Under-16s

https://deadline.com/2026/06/uk-social-media-ban-under-16s-x-youtube-tiktok-reddit-1236956163/
2•01-_-•4m ago•0 comments

Inside tech elites’ madcap war against the California billionaire tax

https://sfstandard.com/2026/06/13/billionaire-tax-fight-sergey-brin-chris-larsen-mike-moritz-ron-...
1•thm•5m ago•0 comments

Derbyshire officer investigated for using AI to create evidence in cases

https://news.sky.com/story/derbyshire-police-officer-investigated-for-using-ai-to-create-evidence...
2•01-_-•5m ago•0 comments

Do-the-work instead of proof-of-work, for Git hosting

https://blog.legoktm.com/2026/06/14/do-the-work-instead-of-proof-of-work-for-git-hosting.html
1•rapnie•6m ago•0 comments

Ukraine's Zelenskiy discusses peace talks in call with Trump

https://www.reuters.com/world/europe/ukraines-zelenskiy-discussed-war-diplomacy-call-with-trump-a...
1•Soumya_Max•8m ago•0 comments

Show HN: Canopy – parallel, sandboxed Claude Code sessions on macOS

https://github.com/juliensimon/canopy
1•julsimon•8m ago•0 comments

Proof

https://en.wikipedia.org/wiki/Proof_(play)
1•tosh•9m ago•0 comments

Apple PowerMac G4 – Weapon (1999) [video]

https://www.youtube.com/watch?v=lb7EhYy-2RE
1•DesaiAshu•10m ago•0 comments

You don't need React: creating a minimal UI library

https://pedroth.github.io/?p=post/NoNeedReact
1•pedro_movai•10m ago•0 comments

Building a personal meeting assistant that routes through your existing audio

https://techstackups.com/articles/deepgram-personal-meeting-assistant/
1•ritzaco•10m ago•0 comments

A spy in your pocket? How the UK's on-device nude image blocking could work

https://www.techradar.com/vpn/vpn-privacy-security/a-spy-in-your-pocket-how-the-uks-proposed-on-d...
1•nickslaughter02•11m ago•1 comments

Employees are checking out of AI

https://www.asymptotes.ai/notes/the-self-replacement-crisis
1•spinmaster•11m ago•0 comments

Show HN: TimeZoria – fast way to check and compare time zones

https://timezoria.org/
1•TimeZoriaAI•13m ago•0 comments

Abandoning the indie hacking dream for now (2022)

https://www.tinystruggles.com/posts/abandoning_indie_hacking/
1•mmarian•13m ago•0 comments

Shutting down my startup (2025)

https://lachlangreen.substack.com/p/shutting-down-my-startup
1•mmarian•16m ago•0 comments

Oracle Cuts Free Tier Ampere A1 Resources in Half

https://linuxiac.com/oracle-quietly-cuts-free-tier-ampere-a1-resources-in-half/
1•hyruo•16m ago•0 comments

Tell HN: Listening to blog posts is a nice form of self-therapy

1•mmarian•18m ago•0 comments

What the Fuck Happened to Nerds

https://mrmarket.lol/what-the-fuck-happened-to-nerds/
2•vrnvu•18m ago•1 comments

Airis – A zero-install, local AI ecosystem with autonomous PC control

https://github.com/Samael-1976/Airis
1•Samael1976•18m ago•0 comments

Berkadia Data Breach

https://haveibeenpwned.com/Breach/Berkadia
1•rexthonyy•18m ago•0 comments

Show HN: Instant live endpoints your front end needs, from natural language

https://github.com/thomscoder/zero-1
1•thomscoder•20m ago•0 comments

Relativity for Retired Engineers

https://arxiv.org/abs/2605.21660
1•calligram•21m ago•0 comments

Show HN: X – A programming language with switchable memory modes

https://github.com/xdotxxx/x
1•x-xxx•23m ago•0 comments

Nightly Rust Development with Devenv

https://paperless.blog/nightly-rust-devenv
1•l0b0•23m ago•0 comments

Britain announces social media ban for under-16s

https://www.reuters.com/business/media-telecom/britain-expected-set-out-under-16s-social-media-re...
2•austinallegro•23m ago•0 comments

Research Replication Attempt

https://paperless.blog/research-replication-attempt
1•l0b0•23m ago•0 comments

Testing desktop notifications with NixOS

https://paperless.blog/desktop-notification-tests
1•l0b0•23m ago•0 comments