frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

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.

Old Reddit Is Down

https://old.reddit.com/
3•Crunsher•2m ago•0 comments

Digital Public Goods Alliance

https://www.digitalpublicgoods.net/
1•Tomte•2m ago•0 comments

Generations of AI applications: conversational, delegative, and collaborative

https://zknill.io/posts/generations-of-ai-applications/
1•zknill•2m ago•0 comments

James Webb Space Telescope discovers one of the universe's first galaxies

https://phys.org/news/2026-05-webb-universe-galaxies.html
2•busymom0•3m ago•0 comments

"Pets vs. Cattle" in the Agent Age

https://blog.johnys.io/pets-vs-cattle-in-the-agent-age/
1•johnys•4m ago•0 comments

Show HN: Steamosaic: Generate a mosaic of your Steam account

https://steamosaic.com
1•delduca•5m ago•1 comments

Sam 2 deep dive: why its FIFO memory eviction bothers me

https://chizkidd.github.io//2026/04/17/sam-2/
1•chizkidd•5m ago•0 comments

Curry Paradox: Why a less surprising shot is more impressive than a wilder one

https://perthirtysix.com/essay/curry-paradox
1•robmoore•5m ago•0 comments

The Truth About GPT Shortcuts and "Secret" AI Commands

https://jsdev.space/gpt-shortcuts-that-work/
1•javatuts•5m ago•0 comments

Why trust is a big question at the Elon Musk-OpenAI trial

https://techcrunch.com/2026/05/17/why-trust-is-a-big-question-at-the-elon-musk-openai-trial/
1•drob518•7m ago•0 comments

Show HN: 84,000 random Stripe Payment Links you can visit

https://payment-link-roulette.web.app
1•dbielik•7m ago•0 comments

Show HN: ATO: Manage Chrome tabs with one shortcut

https://github.com/jeanlucaslima/ato
1•jeanlucas•8m ago•0 comments

U.S. creates $1.7B 'lawfare' fund in exchange for Trump dropping $10B IRS suit

https://www.cnbc.com/2026/05/18/trump-dismiss-irs-lawsuit.html
3•drob518•10m ago•0 comments

The Joys of Free Cloudflare

https://dm13450.github.io/2026/05/18/the-joys-of-free-cloudflare.html
2•theanonymousone•10m ago•0 comments

Don't call yourself a Software Engineer, you are an AI Enabled Engineer

https://idiallo.com/blog/you-are-an-ai-enabled-engineer-now
1•Brajeshwar•10m ago•0 comments

Iran Starts Bitcoin-Backed Ship Insurance for Hormuz Strait

https://www.bloomberg.com/news/articles/2026-05-18/iran-starts-bitcoin-backed-shipping-insurance-...
12•srameshc•10m ago•0 comments

Burroughs Large Systems

https://en.wikipedia.org/wiki/Burroughs_Large_Systems
1•tosh•12m ago•0 comments

Transplanting light-dependent reactions for mammalian eye photosynthesis

https://www.cell.com/cell/fulltext/S0092-8674(26)00469-1?_returnURL=https%3A%2F%2Flinkinghub.else...
1•bookofjoe•12m ago•0 comments

"I Hacked This Temu Router. What I Found Should Be Illegal." [video]

https://www.youtube.com/watch?v=KsiuA5gOl1o
1•dylan604•12m ago•1 comments

WWDC26 Developer

https://developer.apple.com/wwdc26/
2•tambourine_man•13m ago•0 comments

Signs That AI-Assisted Vulnerability Discovery Is Reshaping Disclosure Volumes

https://www.vulncheck.com/blog/ai-assisted-vulnerability-discovery
1•speckx•13m ago•0 comments

Companies start getting tariff refunds after Supreme Court decision

https://www.cnbc.com/2026/05/12/trump-tariff-refunds.html
1•drob518•14m ago•0 comments

Streaming Messages from Temporal Workers to SSE Clients

https://www.architectingbytes.com/posts/temporal-redis-sse/
1•gk1•14m ago•0 comments

Show HN: Cubic Doggo, a Open-Source 12-DOF 4-Legged Robot Based on ROS2

https://github.com/SphericalCowww/CubicDoggo
1•SphericalCowww•15m ago•0 comments

Cursor Introduces Composer 2.5

https://twitter.com/cursor_ai/status/2056415413077233983
8•asar•15m ago•0 comments

You can predict LLM output sensitivity in closed form

https://noahgolmant.com/blog/stable-regions-residual-stream/
1•noahgolmant•16m ago•0 comments

Surprising things I learned putting together a Home Brain

https://bitworking.org/news/2026/05/surprising-things-i-learned-putting-together-a-home-brain/
1•ingve•17m ago•0 comments

The creator of OpenClaw used $1,300,000 of OpenAI tokens in 30 days

https://www.pcgamer.com/software/ai/the-creator-of-openclaw-used-usd1-300-000-of-openai-tokens-in...
4•speckx•19m ago•0 comments

How does the economy work at all if all are laid-off and human jobs disappear?

1•baigy•20m ago•0 comments

Intel wants to use China's phone supply chain to build cheaper laptops

https://videocardz.com/newz/project-firefly-unveiled-intel-wants-to-use-chinas-phone-supply-chain...
1•LorenDB•20m ago•0 comments