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.

High AI security confidence may signal higher MSSP risk

https://www.msspalert.com/news/mssp-market-news-could-ai-governance-be-mssps-next-revenue-stream
1•mooreds•27s ago•0 comments

Counterexamples in Type Systems

https://counterexamples.org/
1•bramadityaw•59s ago•0 comments

They Looked Like They Were Getting Rich on Polymarket–But None of It Was Real

https://www.wsj.com/business/media/polymarket-social-media-bets-prediction-market-441cdeb5
1•ubasu•1m ago•0 comments

Studio Canal Movies purchased on PlayStation Store removed without refund

https://www.playstation.com/en-gb/legal/psvideocontent/
1•kugelblitz•1m ago•0 comments

AI 'exuberance' risks ending in lengthy investment bust, BIS warns

https://www.ft.com/content/e81ce414-e4bd-4e8c-bac7-94f7bf17def4
2•1vuio0pswjnm7•1m ago•0 comments

The Rent Freeze, and a Return to the 1970s

https://arpitrage.substack.com/p/the-rent-freeze-and-a-return-to-the
2•mooreds•2m ago•0 comments

Dragonflies as Fly Control [video]

https://www.youtube.com/shorts/Jb9XTp1tcqo
2•lifeisstillgood•3m ago•0 comments

KaOS: The first Linux distro to ship dinit, Noctalia v5 without systemd and KDE

https://grigio.org/kaos-2026-06-the-first-linux-distro-to-ship-dinit-and-noctalia-v5-without-syst...
2•grigio•4m ago•0 comments

Show HN: We built a learning loop that learns from its own failures

https://blankline.org/research/intelligence-compounds
2•DarenWatson•4m ago•0 comments

Cloudflare Defeats Lawsuit over Nonconsensual Intimate Imagery

https://blog.ericgoldman.org/archives/2026/06/cloudflare-defeats-lawsuit-over-nonconsensual-intim...
2•speckx•4m ago•0 comments

Does US AI Gatekeeping Hand China the Open-Source Edge?

https://www.digitalapplied.com/blog/us-ai-gatekeeping-china-open-source-advantage-2026
2•softwaredoug•5m ago•0 comments

When Impressive Performance Gains Do Not Matter

https://blog.colinbreck.com/when-impressive-performance-gains-do-not-matter/
2•lalitmaganti•5m ago•0 comments

The Star Wars-themed Easter eggs hiding in Alone in the Dark 2

https://32bits.substack.com/p/under-the-microscope-alone-in-the
2•bbayles•5m ago•0 comments

The DOGE Boys Get VC Funding to Support Their Latest Enterprise

https://www.wired.com/story/the-doge-boys-get-vc-funding-to-support-their-latest-enterprise/
3•ubasu•5m ago•0 comments

Reduce Needless Bus Customization

https://ifp.org/reduce-needless-bus-customization/
2•surprisetalk•6m ago•0 comments

AOC says 'we need to break up these companies' after Apple raises prices by $200

https://nypost.com/2026/06/28/us-news/aoc-says-congress-should-break-up-apple-amid-looming-price-...
3•ivewonyoung•8m ago•0 comments

3D printing a mechanical calculator [video]

https://www.youtube.com/watch?v=d3uFpLT57Og
2•seanbrodie•9m ago•0 comments

VNote: A pleasant note-taking platform in native C++

https://github.com/vnotex/vnote
2•htfy96•10m ago•0 comments

What happens when you run a CUDA kernel?

https://fergusfinn.com/blog/what-happens-when-you-run-a-gpu-kernel/
3•mezark•10m ago•0 comments

UGC Agent – Run AI agents that find UGC creators

https://ugcagent.app/
1•vicpitic•12m ago•0 comments

Tidal AI Policy

https://tidal.com/ai-policy
3•hn8726•12m ago•0 comments

Trump and Lutnick families cash in on corrupt mining deal

https://twitter.com/mikelevin/status/2071290309799989427
3•bix6•13m ago•0 comments

Firefox extension that detects WordPress Plugins

https://addons.mozilla.org/en-US/firefox/addon/wpoptic/
1•WPoptic•14m ago•0 comments

Incus 7.2 has been released – News – Linux Containers Forum

https://discuss.linuxcontainers.org/t/incus-7-2-has-been-released/26879
1•speckx•14m ago•0 comments

Comcast Moves to Split in 2

https://apnews.com/article/comcast-nbcuniversal-sky-5dc27c2e6fe45eb78eae4336e025b4e2
1•MiscIdeaMaker99•14m ago•0 comments

The Wyoming Town in Uproar over Plans for a Data-Center "Man Camp"

https://www.wsj.com/video/series/on-the-news/the-wyoming-town-in-uproar-over-plans-for-a-data-cen...
1•1vuio0pswjnm7•14m ago•0 comments

PostgreSQL-Compatible Databases for AI at Scale

https://www.cockroachlabs.com/blog/postgresql-compatible-databases-ai-scale/
2•ilreb•15m ago•0 comments

Show HN: Wattcast, weather at your moving position along a cycling route

https://wattcast.app/
2•alienswede•17m ago•0 comments

JSON Handbook

https://jstools-space.gitbook.io/json-handbook
2•javatuts•19m ago•0 comments

NixOS 26.05 Released

https://nixos.org/blog/announcements/2026/nixos-2605/
1•lostmsu•19m ago•0 comments