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.

Ask HN: Questions about HN and life questions

1•mwhite•3m ago•0 comments

Unlocking Non-Uniform KV Cache for Efficient Multi-Turn LLM Serving

https://arxiv.org/abs/2606.06302
1•johnbarron•3m ago•0 comments

Astrocytic Contributions to Cognition Across Rodent Models of Brain Dysfunction

https://www.mdpi.com/2218-273X/16/5/662
1•PaulHoule•4m ago•0 comments

Data Centers and Local Job Creation

https://michaeljhicks.substack.com/p/data-centers-and-local-job-creation
1•toomuchtodo•13m ago•0 comments

Fusion Power's Newest Problem Is People Making Nukes

https://gizmodo.com/fusion-powers-newest-problem-is-people-secretly-making-nukes-2000767859
1•johnbarron•14m ago•0 comments

Show HN: Turn your landing page into print-ready business cards

https://www.kleidoprint.com
1•13001r•14m ago•0 comments

Show HN: Local MCP – give Claude, Cursor and ChatGPT access to your whole Mac

https://www.local-mcp.com/en
1•lanchuske•15m ago•0 comments

African Burial Ground National Monument, New York

https://www.nps.gov/afbg/learn/historyculture/index.htm
1•thunderbong•21m ago•0 comments

US attorney opens investigation into California elections-sends prosecutor to LA

https://apnews.com/article/california-primary-ballot-counting-trump-investigation-22b06b32abdca1e...
4•petethomas•33m ago•0 comments

The smart TV in your living room is a node in the AI scraping economy

https://blog.includesecurity.com/2026/06/the-smart-tv-in-your-livingroom-is-a-node-in-the-aiscrap...
1•themaxdavitt•33m ago•0 comments

Exploiting ML-DSA bugs [pdf]

https://cr.yp.to/papers/mldsa-20260601.pdf
1•libroot•34m ago•1 comments

Show HN: Documenting an Obscure Japanese Wii Game – and-Kensaku

https://github.com/TylerJaacks/AndKensakuResearch
1•TylerJaacks•35m ago•0 comments

New Treatment for Alzheimer's and Parkinson's Discovered in Japan

https://www.inc.com/lucia-auerbach/future-of-brain-health-how-a-new-scientific-discovery-could-re...
3•nikolay•42m ago•0 comments

Misu

https://en.wikipedia.org/wiki/Misu
2•carabiner•47m ago•0 comments

eLoran

https://en.wikipedia.org/wiki/ELoran
2•jonbaer•50m ago•0 comments

Ultra-fast CSV parsing and encoding for Elixir

https://github.com/jeffhuen/RustyCSV
1•sntran•50m ago•1 comments

The intracies of modern camera lens repair (2024)

https://salvagedcircuitry.com/sigma-45mm.html
19•transistor-man•50m ago•0 comments

Re: Cache: 0-click SXSS on Next.js via reflected headers

https://zhero-web-sec.github.io/research-and-things/re-cache-excessive-reflection-type-confusion-...
1•logickkk1•53m ago•0 comments

Cumulative average BMI and cognitive decline: a 24-year cohort study

https://link.springer.com/article/10.1007/s00415-026-13696-2
3•PaulHoule•54m ago•0 comments

I built an email agent to triage bogus security reports

https://opencomputer.dev/blog/email-security-triage-agent/
1•iacguy•59m ago•0 comments

Why Do Asian Brands Pretend to Be Japanese?

https://www.thechow.net/p/asian-brands-pretending-japanese-miniso
2•herbertl•1h ago•0 comments

Game Theory Text - Thomas Ferguson

https://web.archive.org/web/20050301121109/http://www.math.ucla.edu/~tom/Game_Theory/Contents.html
2•soupspaces•1h ago•0 comments

The Sandbaggers (1978 – 80) Complete Series

https://archive.org/details/the-sandbaggers-1978-80
3•petethomas•1h ago•1 comments

She won a religious exemption from using AI at work

https://www.businessinsider.com/worker-got-religious-exemption-using-ai-at-work-2026-6
11•dgellow•1h ago•4 comments

Silent Ransom Group Impersonating IT Personnel Through Social Engineering [pdf]

https://www.ic3.gov/CSA/2026/260526.pdf
2•gnabgib•1h ago•0 comments

ToTra – open-source LLM gateway with GDPR/EU AI Act compliance

https://github.com/SugaC-275/ToTra
2•SugaC275•1h ago•0 comments

The Shift in Peering Threatening the Internet's Foundations

https://www.internetsociety.org/blog/2026/06/the-shift-in-peering-threatening-the-internets-found...
5•8organicbits•1h ago•0 comments

Trump Urges 'Less Shackled' Pulte to Fire Intelligence-Community Employees

https://www.wsj.com/politics/national-security/trump-urges-less-shackled-pulte-to-fire-intelligen...
2•petethomas•1h ago•0 comments

If you don't fall for these extortionists' calls they'll show up with USB sticks

https://www.theregister.com/cyber-crime/2026/06/05/if-you-dont-fall-for-these-extortionists-calls...
2•Bender•1h ago•0 comments

Small modular nuclear reactor reaches criticality in first test

https://arstechnica.com/science/2026/06/first-us-test-of-modular-reactor-reaches-criticality/
1•Bender•1h ago•0 comments