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.

Air Conditioning Is Almost Universal in the US and Japan – But Not Elsewhere

https://ourworldindata.org/data-insights/air-conditioning-is-almost-universal-in-the-us-and-japan...
1•karakoram•23s ago•0 comments

War is not god, neither is AI

https://ryelang.org/blog/posts/war-is-not-god-neither-is-ai/
1•middayc•2m ago•0 comments

Why Some People Are Born with Devastating Gene Mutations–and Never Get Sick

https://www.nationalgeographic.com/health/article/genetic-mutation-inherited-disease-dna
1•bookofjoe•3m ago•1 comments

Google Buys Spirit Airlines' Emails, Files and Flight Records for $10M

https://viewfromthewing.com/google-buys-spirit-airlines-emails-files-and-flight-records-for-10-mi...
1•paulpauper•7m ago•0 comments

One Night in Uzbekistan

https://statmodeling.stat.columbia.edu/2026/08/20/we-couldnt-reproduce-their-findings-and-realize...
1•paulpauper•8m ago•0 comments

And the universe said you are the universe

https://unpublishablepapers.substack.com/p/and-the-universe-said-you-are-the
1•paulpauper•8m ago•0 comments

Mice learn to think out of the box

https://news.emory.edu/stories/2026/08/how-mice-learn-think-out-box-neuroscience-surprise
1•gmays•9m ago•0 comments

Migrate Repo to TypeScript 7

https://github.com/microsoft/TypeScript/pull/63763
1•sensanaty•10m ago•0 comments

A limit order book and matching engine in Go

https://intrepidkarthi.github.io/orderbook/
1•intrepidkarthi•10m ago•0 comments

What Happened: OpenAI and HuggingFace

https://thezvi.wordpress.com/2026/08/08/what-happened-openai-and-huggingface/
1•gmays•10m ago•0 comments

When Postgres Isn't the Process That Kills Your Database

https://clickhouse.com/blog/protect-postgres-from-supporting-processes
1•saisrirampur•11m ago•0 comments

I'm Sick of Reading AI-Written Posts

https://cyb3rops.medium.com/im-sick-of-reading-ai-written-posts-107767481fbf
1•gurjeet•12m ago•0 comments

Tumble Forth – from assembly to OS with C compiler

https://tumbleforth.hardcoded.net/
2•vicek22•14m ago•0 comments

Death to the Self-Playing Game

https://www.jank.cool/death-to-the-self-playing-game/
2•speckx•15m ago•0 comments

Does every question mark deserve a Betteridge?

https://dynomight.net/betteridge/
1•Curiositry•16m ago•0 comments

Multiple sequence alignment using WebGPU

https://github.com/ag4349/msa-webgpu
1•ag4349•17m ago•1 comments

Show HN: CSVtoTable – turn a CSV/XLSX into one self-contained HTML file

https://github.com/vividvilla/csvtotable
2•v512•21m ago•1 comments

Shenzhen Night Walk [video]

https://www.youtube.com/watch?v=JiXpYbCZyjs
1•simonebrunozzi•22m ago•0 comments

Robotics Software

1•erardaiden•22m ago•0 comments

Windmill.dev is not "fully open-sourced (AGPLv3)"

5•alpine-rockies•23m ago•0 comments

Brazilian Rank Links

https://rankbrasileiro.com.br/
1•xexeno•23m ago•0 comments

Mersenne Twister in a 15-Year-Old Game Binary

https://medium.com/@jizoskasa/i-reverse-engineered-plants-vs-zombies-to-answer-one-very-specific-...
1•birdculture•24m ago•0 comments

Bringing the cybersecurity capabilities of Claude Mythos 5 to more defenders

https://claude.com/blog/bringing-claude-mythos-5-to-more-defenders
1•garo-pro•25m ago•0 comments

Britain would be bonkers to ditch Palantir

https://www.economist.com/leaders/2026/08/20/britain-would-be-bonkers-to-ditch-palantir
1•andsoitis•25m ago•2 comments

Printing Lists

https://matklad.github.io/2026/08/14/printing-lists.html
1•chilipepperhott•27m ago•0 comments

AI is about to uncover a hidden world of animal communication

https://twitter.com/itsolelehmann/status/2090831992200020253
3•bilsbie•29m ago•2 comments

His Wedding Guests Were Arriving–Just as His $45B Fund Was Falling Apart

https://www.wsj.com/finance/leopold-aschenbrenner-situational-awareness-ai-fund-597633d3
1•simonebrunozzi•30m ago•0 comments

The Meta Chalkboard

https://christopherabalos.substack.com/p/the-meta-chalkboard
1•cabalos•32m ago•0 comments

Sharding pytest by file cut collection time from 3 minutes to 40 seconds

https://tobsecret.github.io/2026/08/20/Sharding-Tests-by-File/
1•tobsecret•32m ago•1 comments

Postgres SELECT DISTINCT does not scale

https://www.dbos.dev/blog/postgres-select-distinct-does-not-scale
2•KraftyOne•32m ago•0 comments