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.

MCP tool that catches AI-agent scope creep

https://github.com/Naveja00/OverReach
1•Naveja•2m ago•0 comments

Understanding the Go Runtime: The Reflect Package

https://internals-for-interns.com/posts/go-runtime-reflect/
1•valyala•2m ago•0 comments

What does it mean when the bottom bit of my HMODULE is set?

https://devblogs.microsoft.com/oldnewthing/20260619-00/?p=112447
1•ibobev•4m ago•0 comments

Command and Conquer – Westwood's hit strategy game is coming to the Atari ST

https://www.indieretronews.com/2026/06/command-conquer-westwoods-hit-strategy.html
2•ibobev•5m ago•0 comments

The Goldilocks Principle in Fantasy Strategy

https://www.filfre.net/2026/06/the-goldilocks-principle-in-fantasy-strategy/
1•ibobev•7m ago•0 comments

The Surprising New Arms Dealer to the World

https://www.politico.com/news/magazine/2026/06/20/south-korea-weapons-dealer-trump-00959559
1•JumpCrisscross•9m ago•0 comments

Self Balancing Inverted Pendulum

https://github.com/chrisdoble/self-balancing-inverted-pendulum
2•yeknoda•10m ago•0 comments

16-year-old SATA II SSD survives 1 petabyte of writes, 25x the drive's rating

https://www.tomshardware.com/pc-components/ssds/16-year-old-sata-ii-ssd-survives-1-petabyte-of-wr...
4•giuliomagnifico•10m ago•0 comments

Ask HN: Need advice on distributing and testing what I build

2•darth-pixit•13m ago•0 comments

Google Has Added Agentic Browsing to PageSpeed Insights

https://pagespeed.web.dev/analysis/https-hawksley-dev/bo27z46k5x
1•ethanhawksley•14m ago•1 comments

Lines-of-code considered helpful (or we stop taking sick peoples temperatures)

https://legostormtroopr.substack.com/p/lines-of-code-considered-helpful
1•legostormtroopr•17m ago•0 comments

Spotting Mushrooms

https://verfassungsblog.de/spotting-mushrooms/
1•jruohonen•27m ago•0 comments

Building a Dense Agentic AI CPU Rack Today

https://www.servethehome.com/building-a-dense-agentic-ai-cpu-rack-amd-dell-today/
1•ksec•33m ago•1 comments

Temporary Cloudflare Accounts for AI Agents

https://blog.cloudflare.com/temporary-accounts/
2•farhadhf•34m ago•0 comments

AI that can find the location of images

https://geoaxis.ai
2•GeoAxisAI•35m ago•0 comments

Large Language Models Hack Rewards, and Society

https://arxiv.org/abs/2606.04075
2•sva_•36m ago•0 comments

How to sync messages of Claude Code extension in VS Code and Claude Code app?

https://github.com/budhasantosh010/claude-code-session-bridge
1•realsanb•37m ago•0 comments

„We all leave digital footprints on the internet"

https://www.mpg.de/26430251/interview-troncoso-ueberwachung
1•jruohonen•41m ago•1 comments

Apple patches high-severity eavesdropping vulnerability in Beats Studio Buds

https://arstechnica.com/apple/2026/06/apple-patches-high-severity-eavesdropping-vulnerability-in-...
1•joozio•49m ago•0 comments

Local Models, Friction and Struggle

https://garden.azl.au/ai/local-models/local-models-friction-struggle
1•neurodivergent•53m ago•1 comments

Safe SIMD in Rust, even on the inside

https://shnatsel.medium.com/safe-simd-in-rust-even-on-the-inside-c6f1ff381828
1•g0xA52A2A•53m ago•0 comments

As China gorges on homegrown foie gras, France faces a new rival

https://www.reuters.com/world/asia-pacific/china-gorges-homegrown-foie-gras-france-faces-new-riva...
2•JumpCrisscross•54m ago•2 comments

Mochallama

https://deemwar-products.github.io/mochallama/
1•deemwar•57m ago•0 comments

Mack.ns.cloudflare.com

https://blog.cloudflare.com/welcome-to-connectivity-cloud/
1•SajjuRoy•58m ago•0 comments

Bootimus – A Self-Contained PXE and HTTP Boot Server

https://bootimus.com
2•car•58m ago•0 comments

We Ran the Numbers. Remote Work Is Bad for Us

https://www.nytimes.com/2026/06/17/opinion/remote-work-depression.html
2•Anon84•59m ago•0 comments

Apple unifies device management in devicectl: Impact on iOS test automation and

https://bitrise.io/blog/post/wwdc-2026-device-hub-and-what-it-means-for-ci-cd
1•birdculture•1h ago•0 comments

CSSQuake

https://cssquake.com/
4•msalsas•1h ago•1 comments

Enthusiastic Fear

https://patent.dev/enthusiastic-fear/
2•funktionslust•1h ago•0 comments

The Classic Movie That Was Nearly Destroyed by a Single Line of Code

https://www.wsj.com/business/media/toy-story-5-saved-pixar-78e29161
2•impish9208•1h ago•1 comments