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.

Google-Free Phone Is IP68-Rated and Has a Replaceable Battery

https://www.yankodesign.com/2026/05/01/this-google-free-phone-is-ip68-rated-and-has-a-replaceable...
1•exiguus•2m ago•0 comments

Approaching Zero Bugs?

https://daniel.haxx.se/blog/2026/04/30/approaching-zero-bugs/
1•wrxd•3m ago•0 comments

Enabling a new model for healthcare with AI co-clinician

https://deepmind.google/blog/ai-co-clinician/
2•haskellandchill•5m ago•0 comments

FBI cyber boss: China's hacker-for-hire ecosystem 'out of control'

https://www.theregister.com/2026/04/30/fbi_cyber_boss_chinas_hackerforhire/
1•Bender•5m ago•0 comments

TI Calculator Monopoly Offers Lessons for Educators in the Age of Generative AI

https://www.promarket.org/2024/04/08/tis-calculator-monopoly-offers-lessons-for-educators-in-the-...
1•jamesgill•11m ago•0 comments

Show HN: CD-DA Reader, Rust library to read audio CD data

https://github.com/Bloomca/rust-cd-da-reader
1•bloomca•12m ago•0 comments

Keyboard Sounds Pro – Now Available on macOS

https://keyboardsounds.pro/
1•fisc•14m ago•0 comments

Beijing Is Not Playing a Long Game

https://sharptext.net/2026/beijing-is-not-playing-the-long-game/
1•skmurphy•15m ago•2 comments

Amazon Powers ICE. Its Workers Aren't Happy

https://www.motherjones.com/politics/2026/05/amazon-powers-ice-its-workers-arent-happy/
5•cdrnsf•16m ago•0 comments

Ask HN: When will GitHub allow CoPilot AI programmer for new customers again?

2•roschdal•16m ago•1 comments

Does Trade Cause Peace?

https://www.ft.com/content/d141cf41-e47a-4657-9f6b-ed26e6c59ac6
1•paulpauper•17m ago•0 comments

Should We Separate the Art from the Artist?

https://opentodebate.substack.com/p/should-we-separate-art-from-the-artist
1•paulpauper•17m ago•0 comments

Rich People Didn't Look Like This Before

https://www.nytimes.com/2026/04/30/opinion/plastic-surgery-rich-face.html
1•paulpauper•18m ago•0 comments

Show HN: Building self-evolving AI Agents without training

https://getreflect.starlight-search.com
2•akshayballal95•19m ago•0 comments

It's Not a Values Crisis, It's a Housing Crisis

https://maxmautner.com/2026/04/30/housing-crisis-not-values-crisis.html
1•mslate•19m ago•0 comments

Show HN: Aide-memory – persistent memory for AI coding agents and teams

https://www.aide-memory.dev/blog/launch
2•ahmedmeky•22m ago•0 comments

Flue Sandbox Agent Framework

https://flueframework.com
2•kalendos•23m ago•0 comments

Ask HN: If there're so many advanced vibecoders mad at GitHub, where's everyone?

3•foundatron•24m ago•1 comments

When your board member / VC partner leaves?

https://www.motivenotes.ai/p/when-your-vc-leaves-you-are-fundraising
1•swapniljain•24m ago•0 comments

Federation Has a European Legal Problem

https://connectedplaces.online/federation-has-a-european-legal-problem/
2•HotGarbage•26m ago•0 comments

My $5K smart bed needs to shut the hell up

https://www.theverge.com/column/921654/optimizer-eight-sleep-ai-summaries-health-wellness
2•jerlam•28m ago•0 comments

Ask HN: Who wants to be fired? (May 2026)

3•evo_9•29m ago•2 comments

Where to buy a non-Apple, non-Google smartphone

https://www.theregister.com/2026/05/01/buy_a_foss_fondleslab/
2•Bender•30m ago•0 comments

Metropolis 1998 Brings Classic SimCity-style City Building back to life

https://www.generationamiga.com/2026/05/01/metropolis-1998-brings-classic-simcity-style-city-buil...
2•YesBox•30m ago•0 comments

Kanye West Bought an Architectural Treasure Then Gave It a Violent Remix (2024)

https://www.newyorker.com/magazine/2024/06/17/kanye-west-tadao-ando-beach-house-malibu
2•tolerance•31m ago•0 comments

Man versus Horse Marathon

https://en.wikipedia.org/wiki/Man_versus_Horse_Marathon
1•gmays•33m ago•0 comments

Credit Cards Are Vulnerable to Brute Force Kind Attacks

https://metin.nextc.org/posts/Credit_Cards_Are_Vulnerable_To_Brute_Force_Kind_Attacks.html
19•kodbraker•35m ago•6 comments

Seals Detox After a Long Deep Dive

https://nautil.us/how-seals-detox-after-a-long-deep-dive-1280367
3•Brajeshwar•35m ago•0 comments

Will Canada go for a split F-35-Gripen fighter jet fleet?

https://www.espritdecorps.ca/feature/will-canada-go-for-a-split-f-35-gripen-fighter-jet-fleet
1•cf100clunk•35m ago•0 comments

Vulkan 1.4.350 Released with Three New Extensions

https://www.phoronix.com/news/Vulkan-1.4.350
1•Bender•35m ago•0 comments