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.

DN42 is a large dynamic VPN

https://wiki.dn42.us/Home
1•latchkey•3m ago•0 comments

Five AIs Predict the World Cup

https://blog.omgmog.net/AIWC26/
1•omgmog•5m ago•0 comments

LLMs use recurring ghost authors and personalities

https://arxiv.org/abs/2606.02184
1•Gaishan•5m ago•0 comments

In an ant colony, the queen isn't in charge. So who is?

https://phys.org/news/2026-05-ant-colony-queen-isnt.html
2•indynz•7m ago•0 comments

Ask HN: Depression

2•hnthrow10282910•9m ago•2 comments

Pangolin 1.19: Browser Remote Access – SSH, RDP, VNC and More

https://pangolin.net/news/1-19-release
2•miloschwartz•11m ago•0 comments

>400 AUR Packages Compromised with NPM post-install malware

https://archlinux.org/news/active-aur-malicious-packages-incident/
1•lorenzohess•12m ago•1 comments

SpaceX soars after trading begins in largest IPO of all time

https://abcnews.com/Business/spacex-ipo/story?id=133713436
1•evo_9•12m ago•0 comments

Show HN: An AI coaching team in Claude Code that's forbidden from judging you

https://github.com/ibm777p2/Intelligence-Emotions
1•ibm777p2•16m ago•0 comments

Justice Department Approves Paramount's Acquisition of Warner Bros

https://www.politico.com/news/2026/06/12/paramount-acquisition-warner-bros-approved-00960300
3•alephnerd•19m ago•0 comments

Gordon Pask, I Think

https://www.guidavid.com/writing/gordon-pask-i-think
1•gdss•21m ago•0 comments

Free browser-based developer tools I built for everyday front end work

https://0918.us/
1•vicbiz•22m ago•0 comments

Serverless Server Canvas

https://pixelparty-was-taken.vercel.app/
1•GrimFang•24m ago•0 comments

Eric S. Raymond: How to Become a Hacker

https://www.catb.org/esr/faqs/hacker-howto.html
1•dtj1123•28m ago•0 comments

Daytona is going closed source

https://www.daytona.io/dotfiles/updates/daytona-is-going-closed-source
3•majdalsado•28m ago•3 comments

Elon Musk is a real-life Bond villain

https://www.ft.com/content/77affaa7-5da8-4a85-bc7c-eb59b75a72b0
10•doener•29m ago•4 comments

My last observation re: Anthropic's sabotage

https://xcancel.com/deanwball/status/2064665679307985244
2•SilverElfin•31m ago•1 comments

Paramount-WBD merger wins approval from DOJ

https://www.cnbc.com/2026/06/12/paramount-wbd-merger-approval-doj.html
1•root-parent•31m ago•0 comments

The Tests We Skipped

https://ajeygore.in/content/the-tests-we-skipped
1•cdrnsf•33m ago•0 comments

Ask HN: Show your AI coded games [June 2026]

5•franze•35m ago•7 comments

Vibe Trading

https://zhenyi.gibber.blog/vibe-trading
3•zhenyi•35m ago•0 comments

South Korea fines Coupang $409M in country's largest data breach penalty

https://www.reuters.com/legal/litigation/south-korea-fines-coupang-409-mln-countrys-largest-data-...
1•malshe•35m ago•0 comments

Frontier AI and the World Cup 2026

https://christian.bock.bio/wc2026/
1•cbock90•36m ago•0 comments

SpaceX IPO latest: Elon Musk becomes first trillionaire as opening shares soar

https://news.sky.com/story/spacex-ipo-latest-elon-musks-company-to-debut-on-stock-market-and-coul...
3•Anon84•37m ago•0 comments

An interactive introduction to the terrific experience of rendering Arabic typog

https://lr0.org/blog/p/arabic/
2•fanf2•38m ago•0 comments

Heimdall – config-driven RTL fuzzing harness for RISC-V on FPGA

https://github.com/Midstall/heimdall
1•rosscomputerguy•39m ago•0 comments

Palantir loses legal challenge against Swiss investigative magazine

https://www.ft.com/content/7ffcace7-9dc0-4e7e-9912-895ac073f979
23•sschueller•41m ago•2 comments

Temporary Halt of the Dismantling of NCAR

https://wasatchweatherweenies.blogspot.com/2026/06/temporary-halt-of-dismantling-of-ncar.html
3•sampli•43m ago•0 comments

Mmorpg World of ClaudeCraft, vibe coded with Fable 5

https://worldofclaudecraft.com/
5•beatthatflight•46m ago•2 comments

Optimal Kidney Exchange

https://en.wikipedia.org/wiki/Optimal_kidney_exchange
1•joshterrill•46m ago•0 comments