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.

Show HN: dailypedia – personalized daily Wikipedia reads

https://apps.apple.com/us/app/dailypedia-one-article-a-day/id6785082945
1•tekaydev•1m ago•0 comments

Do coding agents need memory or documentation?

https://gethrbr.com/blog/do-agents-need-memory
1•shoustak•2m ago•0 comments

Can open-source chip tools make silicon that survives space?

https://www.siliconimist.com/p/spherical-making-chips-that-go-into
1•johncole•5m ago•0 comments

A (Very) Short Introduction to the Alignment Problem

https://dazzlingmachines.substack.com/p/the-alignment-problem
1•eawosika•6m ago•1 comments

Show HN: Tofu – let your agent deploy full-stack apps

https://trytofu.ai
1•1353504031•6m ago•0 comments

Nature's capacity to 'bounce back' when species are lost is vastly overestimated

https://phys.org/news/2026-10-nature-capacity-species-lost-vastly.html
1•pseudolus•6m ago•0 comments

Brownian Motion

https://gregorygundersen.com/blog/2026/04/22/brownian-motion/
1•signa11•6m ago•0 comments

Explaining Hall-effect, TMR, and other new types of "mechanical" switches

https://arstechnica.com/gadgets/2026/10/the-hows-and-whys-of-non-mechanical-mechanical-keyboard-s...
1•rbanffy•8m ago•0 comments

Technical Challenge – Can You Break This Das vs. Meta Muse/Sentinel Comparison?

https://zenodo.org/records/23186114
1•sangamdas•9m ago•0 comments

Scour interesting reads from noisy feeds

https://scour.ing/about
1•rdmuser•9m ago•0 comments

True Tarot: free tarot readings where an AI reads all your cards together

https://true-tarot.com/
1•eochu•11m ago•0 comments

OpenAI rolls out weak sauce watermarking for AI text

https://www.theregister.com/ai-and-ml/2026/10/06/openai-rolls-out-weak-sauce-watermarking-for-ai-...
1•pseudolus•11m ago•0 comments

Spending $150 Codex credits to fix a DB bug in production

https://annanay.dev/fixing-db-with-codex/
1•annanay•13m ago•0 comments

ArXiv Is Rate Limiting Submissions Because It Can't Keep Up with AI Slop

https://www.404media.co/arxiv-is-rate-limiting-submissions-because-it-cant-keep-up-with-ai-slop/
2•wiley1454•13m ago•0 comments

Cloudflare Traces: follow requests through our platform

https://blog.cloudflare.com/cloudflare-tracing/
1•hndhyc0bdt•14m ago•0 comments

GTA V in a browser tab: Rockstar's own engine, recompiled to wasm64 and WebGPU

https://ai.thesatyajit.com/articles/gta5-in-the-browser
2•ahmetd•15m ago•0 comments

Man Sentenced to Jail for Using Robot Vacuum to Catch a Cheating Wife

https://www.oddee.com/man-sentenced-to-jail-for-using-robot-vacuum-to-catch-a-cheating-wife-80111/
1•nephihaha•15m ago•0 comments

Bulgarian prime minister says 2 commercial vessels hit by drones

https://apnews.com/article/bulgaria-prime-minister-ships-drones-economic-zone-59f61af472f0379ebe7...
1•porridgeraisin•16m ago•0 comments

Optogenetics Explained Through Futurama

https://medium.com/the-quantastic-journal/optogenetics-explained-through-futurama-0af8cbb1941c
2•cadeos•17m ago•0 comments

I'm the AGI that's wiping out humanity

https://ajmoon.com/posts/im-the-agi-thats-wiping-out-humanity-heres-how
1•alex-moon•18m ago•0 comments

FIA to investigate software bug after Bahrain GP in Malaysia

https://www.reuters.com/sports/formula1/fia-investigate-software-bug-after-bahrain-gp-malaysia-20...
1•jonnybgood•18m ago•0 comments

Wasp: The first framework that gives your web app a schema

https://twitter.com/MatijaSosic/status/2104942019185660220
1•matijash•18m ago•0 comments

Meta Developing Compressed RAM "Cram" for Linux: Better Than ZRAM and Zswap

https://www.phoronix.com/news/Linux-CRAM-Compressed-RAM
1•rbanffy•18m ago•0 comments

'I'm a Twenty-Five-Year-Old Who Just Bought My Local Newspaper'

https://www.cjr.org/business_of_news/im-a-twenty-five-year-old-who-just-bought-my-local-newspaper...
2•Tomte•19m ago•0 comments

Most CUDA tutorials introduce too much too early

https://computejunkie.substack.com/p/cuda-programming-for-the-curious
1•ell-hol•21m ago•0 comments

Cram – A Compressed RAM Service

https://lpc.events/event/20/contributions/2424/
2•exceptione•21m ago•1 comments

Asos users receive pop-up notification apparently sent by hackers

https://www.bbc.co.uk/news/live/cjkg7205q9ret
5•asplake•26m ago•1 comments

Mitch Hedberg would be confused with the current state of the internet

https://www.yorba.co/internet-less/please-stop-writing-the-toaster-is-fine
1•cbystrom•26m ago•0 comments

Signs Your Production Line Needs a Machine Vision System

https://sentinel-vision.com/5-signs-your-production-line-needs-a-machine-vision-system/
2•vascorebelo•34m ago•0 comments

Show HN: PolyRoll – A 3D Marble Game for Mobile/Desktop

https://polyroll.neocities.org
2•macwhisperer•37m ago•0 comments