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.

New Jersey launches procurement process for new nuclear

https://world-nuclear-news.org/articles/new-jersey-launches-procurement-process-for-new-nuclear
1•geox•44s ago•0 comments

The Colorado River's 2 biggest reservoirs just hit a new record low

https://www.sltrib.com/news/environment/2026/07/17/combined-storage-lake-powell-lake/
1•toomuchtodo•1m ago•1 comments

Mincdp – Give Claude eyes and hands in a browser, in ~410 lines of C

https://github.com/Anode1/mincdp
1•siberean•2m ago•0 comments

What lawyers can do for AI safety

https://martinsays.substack.com/p/what-lawyers-can-do-for-ai-safety
1•mrmarmac•3m ago•0 comments

MecoScribe: FOSS Local Audio Transcription for macOS with Speaker Detection

https://github.com/HeyMeco/MecoScribe
1•HeyMeco•3m ago•1 comments

Trump Set Fire to America's Election Defenses. Now He's Pointing at the Smoke

https://weaponizedspaces.substack.com/p/trump-set-fire-to-americas-election
2•rbanffy•4m ago•0 comments

Don't remove the bottlenecks, rather upgrade them

https://shrsv.hexmos.com/post/don%27t-remove-the-bottlenecks,-rather-upgrade-them
2•atomicnature•5m ago•0 comments

I'm shutting down my AI SaaS – Post Mortem

https://johnathanward.com/im-shutting-down-content-goblin-a-post-mortem/
2•johnward•10m ago•0 comments

How to properly build a credit ledger

https://useautumn.com/blog/ai-billing-infrastructure
2•ayushrodrigues•11m ago•0 comments

The Archaeologist's Copilot

https://martinfowler.com/articles/archaeologist-copilot.html
1•Jimmc414•11m ago•0 comments

Redis cuts 200 jobs, CEO Rowan Trollope

https://redis.io/blog/ceo-rowan-trollopes-organizational-announcement-to-redis-employees/
2•msolujic•11m ago•0 comments

If I have a US passport, do I need another ID to enter the US?

https://papersplease.org/wp/2026/06/01/if-i-have-a-us-passport-do-i-need-another-id-to-enter-the-us/
3•Jimmc414•13m ago•0 comments

Australian Data Centres forced to generate more power than they use

https://www.afr.com/technology/albanese-hits-data-centres-with-grid-mandate-in-major-ai-pivot-202...
3•root-parent•13m ago•0 comments

Costco Is the Anti-Amazon and It's Thriving

https://thewalrus.ca/costco-is-the-anti-amazon-and-its-thriving/
4•throw0101a•13m ago•0 comments

Show HN: Rockspector, a Visualizer for RocksDB

https://github.com/RaisinTen/rockspector
1•raisin10•13m ago•0 comments

Watchface

https://watchface.netlify.app/
1•duck•14m ago•0 comments

Atomically Thin Materials Significantly Shrink Qubits

https://spectrum.ieee.org/2d-hbn-qubit
1•Jimmc414•14m ago•0 comments

The Word "Hide" Is Now a Legal Question

https://blog.ppb1701.com/the-word-hide-is-now-a-legal-question
3•speckx•15m ago•0 comments

I have built a supervision and Orchestration layer for Claude Code and other CLI

https://cli.agentproto.sh
1•agentik•15m ago•2 comments

Security incident disclosure – July 2026

https://huggingface.co/blog/security-incident-july-2026
3•bsilvereagle•16m ago•0 comments

Does the human brain actually produce DMT or is it a myth? [video]

https://www.youtube.com/watch?v=ZU9t9ZCPUhw
2•binyu•17m ago•0 comments

Evolving Spec-Driven Development: Conductor Now Supports Antigravity

https://developers.googleblog.com/evolving-spec-driven-development-conductor-now-supports-antigra...
2•simonpure•17m ago•0 comments

Ask HN: What Are You Working On? (July 2026)

1•nandi19k•17m ago•0 comments

Golang's Big Miss on Memory Arenas

https://www.andrewvittiglio.com/thoughts/go-killed-arenas
2•synergy20•18m ago•0 comments

Building an Arch Linux Aarch64 Port for Holo Core

https://www.collabora.com/news-and-blog/news-and-events/building-an-arch-linux-aarch64-port-for-h...
2•losgehts•19m ago•0 comments

How the Watch Dogs Games Mirrored and Predicted Real-World Digital Rights Issues

https://www.eff.org/deeplinks/2026/07/how-watch-dogs-video-game-series-mirrored-and-predicted-rea...
1•hn_acker•20m ago•1 comments

Cloudflare is dropping POST bodies for a large share of our traffic

https://www.cloudflarestatus.com
2•taylorhughes•20m ago•1 comments

North Korean campaign uses fake coding interviews to steal developer credentials

https://www.elastic.co/security-labs/contagious-interview-malware-svg-steganography
1•speckx•21m ago•0 comments

Play ambient background sounds on Mac

https://support.apple.com/guide/mac-help/play-background-sounds-mchl3061cdc6/mac
1•gregsadetsky•21m ago•0 comments

RSS on Mastodon and the Fediverse

https://fedi.tips/following-mastodon-and-fediverse-accounts-through-rss/
2•doener•23m ago•0 comments