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.

Airship: Visual Editor for Your Codebase

https://github.com/0xnyn/airship
1•handfuloflight•47s ago•0 comments

Show HN: A Three.js simulator for the Aug 12 total solar eclipse

https://make3dmap.com/solar-eclipse-2026-simulator
1•jaredliu_bravo•48s ago•0 comments

Matt Mullenweg's Messages Went Missing Amid a Failed Backup and Two Lost Devices

https://www.therepository.email/matt-mullenwegs-messages-went-missing-amid-a-failed-backup-and-tw...
1•rpgbr•57s ago•0 comments

NBER: AI Financial Advice [pdf]

https://www.nber.org/system/files/working_papers/w35574/w35574.pdf
1•m-hodges•2m ago•0 comments

Show HN: The self-improving QA agent for software teams

https://vostride.com
1•pranshuchittora•2m ago•0 comments

Manus will return to operating as an independent company

https://manus.im/blog/a-note-to-our-users
1•thm•2m ago•0 comments

Politeness Theory

https://en.wikipedia.org/wiki/Politeness_theory
1•rzk•2m ago•0 comments

Load What You Need: Smaller Versions of Mutililingual Bert (2020) [pdf]

https://aclanthology.org/2020.sustainlp-1.16.pdf
1•Topfi•4m ago•0 comments

LLMs for Theory Building

https://newsletter.squishy.computer/p/llms-for-theory-building
1•artur_makly•5m ago•0 comments

Show HN: Instancez – Supabase Drop-In Replacement; Declarative and Single-Binary

https://github.com/instancez/instancez
1•saedx1•5m ago•1 comments

Greenland issues "strong warning" as American oil firm illegally drills wells

https://www.theguardian.com/world/2026/aug/08/greenland-iwarning-trump-linked-oil-firm-prepares-d...
3•ck2•8m ago•1 comments

Who Are the Token Brokers?

https://vectoral.com/blog/who-are-the-token-brokers
2•mlenhard•8m ago•0 comments

AI Is Dead. Organoids Are Alive

https://www.wired.com/story/organoids-lab-grown-brains-neural-networks/
1•Brajeshwar•8m ago•0 comments

Show HN: A capable AI assistant with its own inbox

https://www.hellodeck.ai
1•stasiac•9m ago•0 comments

Fake TikTok post led Romanians to attack ambulance with rocks and axes

https://universul.net/fake-tiktok-post-led-romanians-to-attack-ambulance-with-rocks-and-axes/
2•croes•10m ago•0 comments

Maintaining Security-Critical Project Where I Don't Read the Code

https://aaronstannard.com/a-security-critical-project-where-i-dont-read-the-code/
1•Aaronontheweb•10m ago•0 comments

Allegations cross state lines as SpaceXAI hit with $430M in new lien filings

https://www.bizjournals.com/memphis/news/2026/08/05/spacexai-liens-darana-hybrid-southaven.html
1•croes•10m ago•0 comments

Anthropic says it will watermark text generated by its AI models

https://techcrunch.com/2026/08/11/anthropic-says-it-will-watermark-text-generated-by-its-ai-models/
1•ashurandi•11m ago•0 comments

Unitree's Shanghai IPO more than 8k times oversubscribed by retail investors

https://www.reuters.com/world/asia-pacific/unitrees-shanghai-ipo-more-than-8000-times-oversubscri...
2•tim333•12m ago•1 comments

Show HN: WriteLikePG – improve your writing using Paul Graham's principles

https://writelikepg.com/
3•nayeemhq•12m ago•2 comments

Flock wanted to tap dashcams in rideshare vechicles to add to surveillance data

https://flowingdata.com/2026/08/10/flock-wanted-to-tap-dashcams-in-rideshare-vechicles-to-add-to-...
2•skadamat•12m ago•0 comments

Git blame for your agent's memory

https://phasespace.co/blog/git-blame-for-your-agents-memory/
1•paulkyle•13m ago•0 comments

Why Did OpenAI's Head of Ethics Chloé Bakalar Leave?

https://aimagazine.com/news/why-did-openai-head-of-ethics-chloe-bakalar-leave
6•ashurandi•13m ago•2 comments

ASK HN: Suggestions on Write Technical Articles

1•anony-123•14m ago•0 comments

Tech experts warn against using AI clone of murdered woman's voice in court

https://www.ksl.com/article/51608219/tech-experts-warn-against-using-ai-clone-of-murdered-womans-...
3•jewel•16m ago•0 comments

All Grocery Stores in Canada

https://jacobfilipp.com/grocery-locations/
3•surprisetalk•16m ago•0 comments

The Victim Is the Exploit

https://brothke.medium.com/the-victim-is-the-exploit-5a6d42ba4335
1•benrothke•16m ago•0 comments

The Mitochondrialism of Malware

https://luis.zip/blog/the-mitochondrialism-of-malware/
1•Pentamerous•17m ago•0 comments

Native Model Switching in Codex and Claude

https://statewright.ai/blog/loop-engineering-with-native-model-switching-in-codex-and-claude
1•azurewraith•18m ago•0 comments

NFS AUTH_SYS identity spoofing, still the default in NFSv4

https://opscode.io/posts/nfsv3-authsys-identity-spoofing/
1•malcolmfrazier•19m ago•0 comments