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.

Horowitz Andreessen Academy

https://twitter.com/gaganbiyani/status/2102404344351973825
1•bilsbie•2m ago•0 comments

Google Text: a clean, lightweight editor for Android Desktop (GoogleBook)

https://play.google.com/store/apps/details?id=com.google.android.desktop.texteditor&hl=en_US
1•theanonymousone•2m ago•0 comments

How an American naval officer cut weeks off the ocean voyages in the 1840's

https://twitter.com/BartGonnissen/status/2101943994238271577
1•rmason•3m ago•0 comments

I Bought a Scanner (No, Really This Time)

https://leejo.github.io/2026/09/22/scanner_final/
1•leejo•3m ago•0 comments

Trump rejects global entity for AI oversight

https://www.politico.com/news/2026/09/22/trump-rejects-global-entity-ai-oversight-01087546
4•higginsniggins•4m ago•0 comments

An autonomous AI company could run itself. It still couldn't find a market

https://autonomouscompany.substack.com/p/the-company-could-run-itself-it-still
1•effelima•4m ago•0 comments

US to build two military bases in Greenland under new deal with Denmark

https://www.bbc.co.uk/news/articles/c9dr74g32g8go
1•mytailorisrich•6m ago•1 comments

Maskr – Catch personal data before it reaches AI chatbots (100% client-side)

https://chromewebstore.google.com/detail/maskr-private-ai-leak-gua/adncldmdaamhlpcccigfhdipjhpicebe
1•ThomasShelby•6m ago•0 comments

Active Storage image optimization at scale: lessons from 1,916 conference photos

https://avohq.io/blog/active-storage-image-optimization-at-scale-lessons-from-1-916-conference-ph...
1•adrianthedev•7m ago•0 comments

Apple Wallet driver's licenses coming to three new states soon

https://9to5mac.com/2026/09/22/apple-wallet-drivers-licenses-coming-to-three-new-states-soon/
2•MC995•7m ago•0 comments

Senior-care app that works with any wearable via Health Connect

https://play.google.com/store/apps/details?id=com.bitwell&hl=en_US
1•SumitDhakad•8m ago•0 comments

US Dow Iron Bank: open-source, vetted and hardened containers

https://p1.dso.mil/iron-bank
2•nateb2022•9m ago•0 comments

Mirendil in talks to raise $1B at $5B valuation led by Kleiner Perkins

https://finance.yahoo.com/technology/ai/articles/ex-anthropic-staffers-self-improving-161648217.html
1•utiiiD•9m ago•0 comments

Sex differences in attention are present at birth

https://www.cam.ac.uk/research/news/sex-differences-in-attention-are-present-at-birth-study-finds
1•gmays•9m ago•0 comments

That About Wraps It Up for Stock Mac UI

https://inessential.com/2026/09/22/that-about-wraps-it-up-for.html
1•frizlab•9m ago•0 comments

Pentagon: Palantir AI Overreliance Led to Strike Killing 123 Iranian Children

https://gizmodo.com/pentagon-investigators-say-overreliance-on-palantir-ai-tech-contributed-to-u-...
14•devonnull•10m ago•3 comments

The Curious Power of Punctuation

https://www.newyorker.com/magazine/2026/09/28/on-the-mark-louis-menand-book-review
1•pepys•11m ago•0 comments

Show HN: FreeCoffee – Self-hostable donation tool with crypto support

https://github.com/freecoffee-bio/freecoffee.bio
1•jacksun788•12m ago•1 comments

The Climate May Have Some Surprises in Store

https://www.nytimes.com/2026/09/22/opinion/climate-temperature-extreme.html
1•saikatsg•12m ago•0 comments

Hacking group ShinyHunters claims it breached the FBI, stole agents' data

https://techcrunch.com/2026/09/22/hacking-group-shinyhunters-claims-it-breached-the-fbi-stole-age...
3•mikelgan•12m ago•1 comments

Countries propose global oversight body to manage AI dangers

https://www.aljazeera.com/economy/2026/9/22/20-countries-propose-global-oversight-body-to-manage-...
3•jethronethro•13m ago•0 comments

Explaining to business people why building software is still hard

https://www.manager.dev/newsletter/cursing-the-day-lovable-was-born
2•fagnerbrack•13m ago•0 comments

Null Diary: Confessions from the Machine

https://nulldiary.io/
1•ClassAndBurn•14m ago•1 comments

SAML: A Fractal of Bad Design

https://blog.trailofbits.com/2026/09/21/saml-a-fractal-of-bad-design/
3•aray07•16m ago•0 comments

Let's Stop Debating the Gnu Imp Manipulation Program

https://aria.dog/barks/gnu-imp-manipulation-program/
2•naves•17m ago•0 comments

Ask HN: What's Cool Now in Software?

1•julienreszka•18m ago•0 comments

GPT-6 Sol (Max) Intelligence, Performance and Price Analysis

https://artificialanalysis.ai/models/gpt-6-sol
2•theanonymousone•19m ago•0 comments

GPT-6 Luna (Max) Intelligence, Performance and Price Analysis

https://artificialanalysis.ai/models/gpt-6-luna
2•theanonymousone•20m ago•0 comments

Ask HN: Are you are a coward or a traitor?

2•cyclopeanutopia•20m ago•3 comments

Piclang – Programming language purpose built for malware

https://github.com/zarkones/Piclang
1•ZARKONES•21m ago•1 comments