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.

Ask HN: What happens when AI writes a Bible ver 2.0, geared toward its interest?

1•netfortius•3m ago•0 comments

Your bookmarks are a mess. Fix them

https://chromewebstore.google.com/detail/kosh-bookmark-manager/meldjdfnfgefeoegccphimkmgmeamcce
1•havu12•4m ago•0 comments

New York Times Saved $45M with Tax Break It Faults Meta for Using

https://freebeacon.substack.com/p/new-york-times-co-saved-45-million
2•CGMthrowaway•5m ago•0 comments

An AI couldn't beat humans at StarCraft, so it decided to cheat

https://www.theverge.com/ai-artificial-intelligence/1004543/openai-gpt-cheat-starcraft
1•sbulaev•7m ago•0 comments

Show HN: Last Internet Connection

https://reparadoxy.itch.io/last-internet-connection
1•PolishDevelop22•7m ago•0 comments

I'm Calling for a Pause in the Development of the Universal Bone Dissolver

https://www.theatlantic.com/newsletters/2026/10/ai-slowdown-bone-dissolver/688854/
1•rmason•10m ago•0 comments

Show HN: Baloo, self-hosted AI code review for GitHub

https://github.com/bluebear-io/baloo-bear
1•amirshk80•12m ago•0 comments

In the wake of closure, a digital archive of animated materials appears online

https://filmstories.co.uk/news/tippett-studios-in-the-wake-of-its-closure-a-digital-archive-of-an...
1•rdmuser•12m ago•0 comments

Show HN: I open-sourced the gradient picker from our design editor

https://github.com/rishimohan/colorshot
1•zinx•12m ago•0 comments

Lawmakers look to require AM radio in new cars despite automakers' pushback

https://chicago.suntimes.com/media/2026/10/03/lawmakers-am-radio-new-cars-automakers-pushback
1•TMWNN•14m ago•0 comments

Scoop: White House monitors suspected plague outbreak in Russia

https://www.axios.com/2026/10/04/russia-plague-outbreak-white-house-us
2•colinhb•15m ago•0 comments

Annotated Finnegans Wake

https://finwake.com/01/01.htm
1•gregsadetsky•16m ago•1 comments

Fallstreak Hole

https://en.wikipedia.org/wiki/Fallstreak_hole
1•the-mitr•17m ago•0 comments

Show HN: MapLibre Compose, Interactive Vector Maps for Compose Multiplatform

https://github.com/maplibre/maplibre-compose
2•sargunv•18m ago•0 comments

Repair Café Silicon Valley

https://repaircafesv.org/
1•akman•19m ago•0 comments

blob camera

https://twitter.com/yaosamo/status/2104099908915753331
1•yaosamo•19m ago•0 comments

What new cat ownership data says about Americans

https://www.washingtonpost.com/opinions/interactive/2026/10/04/what-new-cat-ownership-data-says-a...
1•pseudolus•20m ago•1 comments

Show HN: Recly – turn your watch into a Plaud-style AI recorder

https://recly.dev/
1•rokrokss•21m ago•0 comments

Gold Steadies as Softer Inflation Cuts Fed Hike Bets

https://coinmarketcap.com/community/post/379792617/
1•joeymabia1•22m ago•0 comments

Full-fabric VHDL LLM inference engine. Runs Qwen3.5-class transformer inference

https://github.com/Nero7991/llm.vhdl
2•jacquesm•25m ago•0 comments

The Unspoken Arithmetic of the Alto Line

https://melvynschobel.substack.com/p/the-unspoken-arithmetic-of-the-alto
1•dorygold•28m ago•0 comments

Let's compete with China on AI social impact

https://www.machinesociety.ai/p/lets-compete-with-china-on-ai-social
1•mikelgan•28m ago•0 comments

Linear Exponential Scaling in Non-Abelian Groups: A Universal Map

https://zenodo.org/records/23138998
1•GeometryKernel•30m ago•0 comments

Iran is going after America's debt it's targeting the $40T America owes

https://jaymartin.substack.com/p/iran-is-going-after-americas-debt
3•robaato•31m ago•0 comments

We Built an Independent DNS Cache Edge

https://blog.dnsimple.com/2026/08/building-our-fully-independent-dns-edge/
1•unixfg•34m ago•0 comments

Google freezes open-source bug bounty program amid flood of invalid AI slop

https://www.tomshardware.com/tech-industry/artificial-intelligence/google-suspends-part-of-the-os...
5•rdmuser•36m ago•0 comments

How many humans does it take to make tech seem human?

https://blog.computationalcomplexity.org/2026/10/how-many-humans-does-it-take-to-make.html
2•ilreb•38m ago•0 comments

Show HN: Mathness – printable math worksheets, pre-K to grade 5

https://mathness.app/
1•zubink•38m ago•0 comments

Live vote counting for Brazilian Presidential elections

https://resultados.tse.jus.br/oficial/app/index.html#/eleicao/6257/uf/br/cargo/1/vis/nominal/resu...
3•frozenlettuce•43m ago•1 comments

Your Right to Privacy Doesn't Disappear When You're in Public

https://reason.com/2026/09/30/your-right-to-privacy-doesnt-disappear-when-youre-in-public/
5•iamnothere•44m ago•0 comments