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.

Google Patent Reveals Satellite Messages May Carry Device Tracking Data

https://patentlyze.com/patent/google-stuffing-device-data-satellite-messages/
1•Dfol•1m ago•0 comments

Show HN: Moumantai – self-hosted, agent-driven apps you can use on any device

https://github.com/xiang-deng/moumantai
1•no_0044•7m ago•0 comments

AMD Strix Halo RDMA Cluster Setup Guide

https://github.com/kyuz0/amd-strix-halo-vllm-toolboxes/blob/main/rdma_cluster/setup_guide.md
1•jakogut•8m ago•0 comments

GTA 3 on a Volumetric Display (2025) [video]

https://www.youtube.com/watch?v=onYH5gvlnzE
1•Tiberium•10m ago•0 comments

Australia to double maximum penalty for platforms in breach of social media ban

https://www.bbc.co.uk/news/articles/c78yv5g74e9o
1•bbg2401•11m ago•0 comments

Never before have so many been trapped in place

https://kindofvoiceless.substack.com/p/there-will-be-nowhere-to-go
1•OgsyedIE•13m ago•0 comments

Why American data centers can't plug in

https://worksinprogress.co/issue/why-american-data-centers-cant-plug-in/
1•Gaishan•14m ago•0 comments

The Lost Discipline of the Alarm: What Notification Design Forgot [video]

https://www.youtube.com/watch?v=Ira28fgSF7M
2•jumpocelot•15m ago•0 comments

Nix Taco Sprint 2026

https://jrdsgl.com/nix-taco-sprint-2026/
3•alurm•17m ago•0 comments

Show HN: QR code renderer in a TrueType font

https://qr.jim.sh/
1•foodevl•17m ago•1 comments

Gary Marcus Trademarked a Rebranded Failed Prediction

https://aidatumpoint.substack.com/p/gary-marcus-trademarked-a-rebranded
1•MadCatBureau•17m ago•1 comments

Show HN: Engye – transfer files between any two devices by scanning a QR code

https://engye.fuzzyworld.net/
1•psafronov•18m ago•0 comments

Rhythm&timing in laughter: Human vocal plasticity falls on a hominid continuum

https://www.nature.com/articles/s42003-026-10499-z
1•bookofjoe•19m ago•0 comments

I'm Building a Space Cadet Pinball Machine [video]

https://www.youtube.com/watch?v=BU_02HABZ4s
1•fortran77•21m ago•0 comments

Toolkit for Your AI Scientists – Rigorous, Auditable and Verifiable

https://github.com/ARA-Labs/Agent-Native-Research-Artifact
1•amberjcjj•21m ago•0 comments

I Adapted the CME FedWatch Methodology to ECB, BoE and BoJ

https://centralbank.watch
1•madams0815•29m ago•0 comments

Every Resource in Kansas City

https://kc.cjohnson.io/resources/
2•thebuilderbob2•31m ago•0 comments

"Backrooms" Have Become a New Kind of Tourist Destination

https://scitechdaily.com/scientists-say-the-backrooms-have-become-a-new-kind-of-tourist-destination/
2•Gaishan•35m ago•0 comments

America's Large Homebuilders Shift the Cost of Shoddy Construction to Buyers

https://hntrbrk.com/investigations/homebuilders
13•JumpCrisscross•39m ago•0 comments

The parents movement that banned cellphones has a new target

https://www.politico.com/news/2026/06/27/schools-classroom-screentime-pushback-00974778
2•JumpCrisscross•41m ago•0 comments

A fiction archive for comparing frontier AI model behavior over time

https://frontierfictionarchive.org/en/news/a-fiction-archive-for-comparing-frontier-ai-model-beha...
1•DAIngerousFic•41m ago•0 comments

Regulations don't go far enough to protect privacy from smart glasses; experts

https://news.northeastern.edu/2026/06/22/meta-smart-glasses-privacy/
4•gnabgib•49m ago•0 comments

The Link Between Cancer and Fasting That They're Hiding from You [video]

https://www.youtube.com/watch?v=jDG1m_b5Ih0
2•Bender•56m ago•0 comments

Show HN: FIFA 2026 bracket predictor – see live crowd % as picks come in

https://quizzy.earth/p/0Dpwk5TjHe/fifa-world-cup-2026-predict-the-bracket-live
1•apostophet•57m ago•1 comments

AI as a Factor of Production

https://leadprompt.sh/a/736-AI-as-a-Factor-of-Production-2026w16
2•saltysalt•57m ago•0 comments

Phones alerted millions before quakes shook Venezuela

https://www.nytimes.com/interactive/2026/06/27/world/americas/venezuela-earthquakes-android-alert...
3•pash•1h ago•0 comments

Show HN: Pressn't, a site where you can have a single post

https://app.pressnt.net/
4•DanielVZ•1h ago•2 comments

Protocol Prying: zero-click vulns in AirDrop and Quick Share

https://arxiv.org/abs/2606.26967
1•Jimmc414•1h ago•0 comments

I Build a 10 Inch Mini Rack from Aluminium Extrusions

https://louwrentius.com/i-build-a-10-inch-mini-rack-from-aluminium-extrusions.html
3•louwrentius•1h ago•1 comments

The truth about datacenters in space [video]

https://www.youtube.com/watch?v=_qpdUNMt2yg
1•dgellow•1h ago•0 comments