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.

The Longest Softlock in Portal [video]

https://www.youtube.com/watch?v=Ax7AbXfhftE
1•bauen1•36s ago•0 comments

Claude Design fundamentally altered my understanding of AI

https://ttcbj.bearblog.dev/claude-design-fundamentally-altered-my-understanding-of-ai/
1•ttcbj•2m ago•1 comments

White House Considers Vetting A.I. Models Before They Are Released

https://www.nytimes.com/2026/05/04/technology/trump-ai-models.html
2•jbegley•3m ago•0 comments

Pentagon announces deal with seven AI companies for classified systems

https://www.aljazeera.com/news/2026/5/1/pentagon-announces-deal-with-seven-ai-companies-for-class...
3•devonnull•3m ago•0 comments

AI Won't Save Us from the Talent Crisis We Created (Sep 25, 2025)

https://techtrenches.dev/p/ai-wont-save-us-from-the-talent-crisis
1•dxs•4m ago•0 comments

Ways to Make Cold

https://hackaday.com/2026/05/04/strange-ways-to-make-cold/
1•beardyw•5m ago•0 comments

Vine video-sharing app is back

https://www.theguardian.com/technology/2026/may/04/vine-video-sharing-back-battling-ai-slop-divine
1•andsoitis•6m ago•0 comments

Media Queries Range Syntax

https://ishadeed.com/article/range-syntax/
1•soheilpro•6m ago•0 comments

Who do Americans spend time with over their lives?

https://ourworldindata.org/who-do-americans-spend-time-with-over-their-lives
1•ndr42•7m ago•0 comments

Lawful-access bill could threaten encryption, Canadian Chamber of Commerce warns

https://www.theglobeandmail.com/politics/article-lawful-access-bill-could-threaten-encryption-det...
1•EmbarrassedHelp•8m ago•1 comments

Three kinds of derivative applied to the ReLU (ramp) function

https://www.johndcook.com/blog/2026/04/30/derivative-of-relu/
1•ibobev•8m ago•0 comments

Approximating even functions by powers of cosine

https://www.johndcook.com/blog/2026/04/30/burmanns-theorem/
1•ibobev•9m ago•0 comments

The Shape of a Guitar Pick

https://www.johndcook.com/blog/2026/05/03/guitar-pick/
1•ibobev•9m ago•0 comments

Trusted Remote Execution: Policy-Enforced Scripts for AI Agents and Humans

https://aws.amazon.com/blogs/opensource/introducing-trusted-remote-execution-policy-enforced-scri...
1•cold-sandwich•9m ago•0 comments

US Supreme Court temporarily restores access to mail-order abortion pills

https://www.theguardian.com/us-news/2026/may/04/mifepristone-abortion-pill-supreme-court
1•andsoitis•10m ago•0 comments

Evacuations planned as suspected hantavirus outbreak traps 150 on cruise ship

https://www.cbc.ca/news/health/suspected-hantavirus-outbreak-cruise-ship-9.7186704
1•geox•10m ago•0 comments

Websites for Humans

https://felix.plesoianu.ro/web/log//websites-for-humans.html
1•speckx•11m ago•0 comments

Grove.el: an Obsidian-like note-taking mode for Emacs

https://github.com/jonathanchu/grove
3•devonnull•13m ago•1 comments

DHS demanded Google surrender data on Canadians over anti-ICE posts

https://www.wired.com/story/dhs-demanded-google-surrender-data-on-canadians-activity-location-ove...
8•HotGarbage•14m ago•0 comments

A solo entrepreneur's map of online money

https://wkdomains.com/2026/may/solo-entrepreneur/
2•fcpguru•20m ago•0 comments

One API for WhatsApp, SMS, and Email. SendAPI

1•nimana•20m ago•0 comments

Scqos – A 9-gate pre-execution coherence kernel for deterministic computation

https://indigo-major-newt-582.mypinata.cloud/ipfs/bafkreifpkzdkmjka26nm4q7gdnzry7hm53a5kngjzyeyuo...
1•Knowledgee_KZA•21m ago•0 comments

Braids as a Representation Space of SU(5)

https://arxiv.org/abs/1506.08067
1•marysminefnuf•21m ago•0 comments

Show HN: Systemd-Recalld

https://github.com/erkinalp/recalld
1•anticensor•22m ago•0 comments

GameStop's Cohen Sees New Target and Big Possible Payday in eBay

https://www.bloomberg.com/news/articles/2026-05-04/gamestop-s-cohen-sees-new-target-and-big-possi...
1•p1anecrazy•22m ago•1 comments

Longevity Science Is Overhyped. But This Research Could Change Humanity

https://www.nytimes.com/2026/04/27/magazine/cell-rejuventation-biotech-longevity-research-altos-l...
2•leetgent•24m ago•1 comments

Show HN: Spinal – Prod aware code review and validation

https://sre.spinal-labs.com/login?next=%2Findex.html
1•mahendraroopa•24m ago•0 comments

Show HN: HeatSpectra: A realtime 3D heat transfer simulator

https://github.com/tsun3doku/HeatSpectra
1•tsun3doku•24m ago•0 comments

Steam Controller

https://store.steampowered.com/hardware/steamcontroller
2•fk_fk•26m ago•1 comments

How to: Get Alerted When a Stripe Charge Fails – No Cloud Vendor Required

https://centrali.io/blog/alert-stripe-charge-failures
1•centrali•26m ago•0 comments