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.

ProofCouncil: An LLM Agent for Solving Open Mathematical Problems

https://arxiv.org/abs/2607.09474
1•frozenseven•56s ago•1 comments

AI built the app. Now it needs a home

https://velixir.ai/blog/your-ai-built-the-app
1•dbContext•58s ago•0 comments

A World That Answers Back

https://ilands.ai/blog/a-world-that-answers-back
1•dloss•2m ago•0 comments

From Ukraine and Sudan to Gaza: why have hospitals become a target of war?

https://www.theguardian.com/global-development/2026/jul/27/ambulance-midwife-attacked-internation...
1•hebelehubele•2m ago•0 comments

Russia charges Telegram founder Durov with aiding terrorism

https://www.dw.com/en/russias-fsb-issues-arrest-warrant-for-telegram-founder-pavel-durov-over-aid...
1•theanonymousone•3m ago•0 comments

The Most Dangerous AI Looks Like the One You Trust

https://www.forbes.com/sites/jasonsnyder/2026/07/29/the-most-dangerous-ai-looks-exactly-like-the-...
1•01-_-•5m ago•0 comments

How Zalando Built an In-Process Client-Side Load Balancer for One Million Reqs/S

https://www.infoq.com/news/2026/07/client-side-load-balancer/
1•theanonymousone•10m ago•0 comments

Timothy Snyder: Hitler and Stalin Today: Class 7: How was mass killing possible? [video]

https://www.youtube.com/watch?v=5JUaJUqw7rU&list=PLPNSuH4X6has&index=7
1•verdverm•12m ago•0 comments

Proposal wouldn't hide that a wipe occurred and would help adversaries

https://twitter.com/GrapheneOS/status/2082153517234676150
1•Cider9986•12m ago•1 comments

Atmos Clock

https://atmos-atelier.de/en/atmos-uhr/
1•haritha-j•12m ago•0 comments

Write the first damn draft yourself

https://invertedpassion.substack.com/p/write-the-first-damn-draft-youself
1•paraschopra•17m ago•0 comments

Walking up the ATProto stack with Dan Abramov [audio]

https://theosteiner.de/podcasts/uit-inside-192
2•theo-steiner•18m ago•1 comments

Behavioral Interventions for Infant Sleep Problems

https://pubmed.ncbi.nlm.nih.gov/27221288/
1•simonebrunozzi•19m ago•0 comments

OpenAl, Anthropic ask U.S. government to consider slowing down Al

https://www.washingtonpost.com/technology/2026/07/29/openai-anthropic-endorse-call-government-pac...
3•fhub•20m ago•1 comments

Framework 13 Pro review: better battery, worse price

https://arstechnica.com/gadgets/2026/07/framework-laptop-13-pro-review-much-better-battery-much-w...
1•birdculture•21m ago•0 comments

Show HN: Where conscious events get found, booked and hosted

https://conscious-events.com/de
1•wowinter15•22m ago•0 comments

The Force Engine: Modern "Jedi Engine" Replacement Supporting Dark Forces, Mods

https://github.com/TheForceEngine/TheForceEngine
1•klaussilveira•27m ago•0 comments

Enprompta – Prompt Registry, LLM Evals, and Observability for Production AI Apps

https://enprompta.com/
1•John_Igwebuike•27m ago•0 comments

Safety in an Unsafe World

https://joshlf.com/posts/safety-unsafe-world/
1•aw1621107•27m ago•1 comments

Sam Altman says AI won't shorten the workweek because humans enjoy being busy

https://www.techspot.com/news/113264-sam-altman-ai-wont-shorten-workweek-because-humans.html
2•robtherobber•29m ago•2 comments

Russia issues international wanted notice against Telegram founder Pavel Durov

https://www.france24.com/en/europe/20260729-russia-issues-international-wanted-notice-against-tel...
5•28304283409234•30m ago•0 comments

Did you know Mastodon has 2 different logos for their server profiles?

https://www.reddit.com/r/Mastodon/comments/1v9q9pf/did_you_know_mastodon_has_2_different_logos_for/
1•doener•30m ago•0 comments

Show HN: Vimgolf.ai – Learn Vim by playing through a map of levels

https://vimgolf.ai
2•nickandbro•32m ago•0 comments

Im 14 and I want to create AI for students

1•grgnend•37m ago•1 comments

Can a 2.8T Model Run on a Single Node of Nvidia B300 X8?

https://blog.us.fixstars.com/deploying-kimi-k3-on-day-0-can-a-2-8t-model-run-on-a-single-node-of-...
1•ai2027•37m ago•0 comments

Triton Control – an open-source control plane for Nvidia Triton on Kubernetes

https://github.com/ai-lab-tech/triton-control
1•ai-lab-tech•38m ago•0 comments

College lab class ends with 32 people on antibiotics for deadly germ exposure

https://arstechnica.com/health/2026/07/college-lab-class-ends-with-32-people-on-antibiotics-for-d...
1•Tomte•38m ago•0 comments

Ross Douthat joins revamped 60 minutes

https://www.washingtonpost.com/business/2026/07/28/ross-douthat-leaves-new-york-times-bari-weisss...
2•_tk_•38m ago•1 comments

Brain Can Rewire Itself to Allow True Multitasking

https://www.sciencealert.com/your-brain-really-can-learn-to-multitask-and-scientists-just-reveale...
1•TMWNN•39m ago•0 comments

US bans humanoid robots from China, citing 'unacceptable risks'

https://www.theguardian.com/us-news/2026/jul/28/fcc-ban-humanoid-robots-china
3•beardyw•42m ago•1 comments