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.

Trigger-tree; see which project docs your AI coding agent reads

https://github.com/Hedde/trigger_tree
1•DevAutomationCC•1m ago•0 comments

Show HN: Otua – on-device live captions I built for my hard-of-hearing wife

https://otua.app/
1•cadwell•2m ago•0 comments

SPIR-V on ROCm: A Portable IR for AMD GPUs

https://rocm.blogs.amd.com/software-tools-optimization/spir-v-rocm/README.html
1•pjmlp•2m ago•0 comments

How Far Behind the Frontier Are Leading Open-Weight Models on Cyber?

https://www.aisi.gov.uk/blog/how-far-behind-the-frontier-are-leading-open-weight-models-on-cyber
2•Imbiss•5m ago•0 comments

Shorter is longer than longer [video]

https://www.youtube.com/watch?v=MFR6SMV64h4
1•Zinu•5m ago•1 comments

Zero risk isn't the job: a CISO's guide to agentic AI

https://claude.com/blog/ciso-guide-to-agentic-ai
1•talboren•5m ago•0 comments

Why S-Expressions

https://modolap.substack.com/p/why-s-expressions
1•ronfriedhaber•9m ago•0 comments

The secret Trump administration battle to fight Chinese AI

https://www.axios.com/2026/07/20/ai-us-china-open-source-kimi
1•_____k•9m ago•0 comments

Private Inference for Coding Agents

https://zro.moonmath.ai/
1•Otsar_zro•10m ago•0 comments

GENE.01: Comes to Life [video]

https://www.youtube.com/watch?v=mGF142yepjc
1•mndren•11m ago•0 comments

Show HN: Mu – A Personal Home Server

https://github.com/micro/mu
1•asim•11m ago•0 comments

Throw, Result, or Neither?

https://www.architecture-weekly.com/p/throw-result-or-neither
1•thunderbong•11m ago•0 comments

Google Is Building an A.I. Fence Around the Internet It Once Championed

https://www.nytimes.com/2026/07/20/technology/google-ai-open-web.html
5•napolux•21m ago•0 comments

Show HN: Lokalite – local secrets for CLIs and coding agents

https://github.com/RubenGlez/lokalite
1•rubenglez•21m ago•0 comments

Show HN: Remove the Gemini watermark by solving the alpha blend, not inpainting

https://github.com/long66666/gemini-watermark-remover
1•LohnChen•23m ago•0 comments

AliSQL 8.0.44-2: DuckDB, VIDX, Native Flashback, and Transaction Optimizations

https://p1p1bear.github.io/alisql-release-page/
1•baotiao•24m ago•0 comments

Burnham is fifth UK PM in four years, now he'll try to buck the trend

https://www.bbc.com/news/articles/cr7knml2y99o
5•teleforce•26m ago•1 comments

Computers Care About Code

https://davidwhitney.co.uk/blog/2026/07/20/computers_finally_care_about_code/
1•henrik_w•28m ago•0 comments

Unity CLI

https://unity.com/blog/meet-the-unity-cli
1•doanbactam•30m ago•1 comments

Show HN: Flag Buddy, a learning game for kids (who can't read yet)

https://labs.davidbauer.ch/kindergames/flaggen-buddy/en/
1•davidbauer•32m ago•0 comments

IPv8: The Draft of a New Internet

https://transitai.app/blog/ipv8-draft-zone-server-math/
5•fofoz•33m ago•1 comments

Show HN: AI chat exporter – Save chat to pdf or word

https://chromewebstore.google.com/detail/ai-chat-exporter-save-cha/fghmokdhfaggnaemnlnmifdkmjcjebhc
2•slimcrm•36m ago•1 comments

The Space Force is now seeking to buy up to $30B in rocket launches

https://arstechnica.com/space/2026/07/the-space-force-is-now-seeking-to-buy-up-to-30-billion-in-r...
3•rbanffy•36m ago•0 comments

The Organisms That Make Earth's Harshest Places Home

https://www.quantamagazine.org/the-organisms-that-make-earths-harshest-places-home-20260720/
2•ibobev•38m ago•0 comments

» the Life and Times of Maxis, Part 2: SimWorld

https://www.filfre.net/2026/07/the-life-and-times-of-maxis-part-2-simworld/
3•ibobev•38m ago•0 comments

Kuiper Q-Q plot: are these the same?

https://entropicthoughts.com/kuiper-q-q-plot
2•ibobev•38m ago•0 comments

On Cursor's "Agent swarms and the new model economics"

http://replicated.live/blog/follow-up
1•gritzko•40m ago•0 comments

Was Hugging Face Breached by AI Agents?

https://mrkt30.com/was-hugging-face-breached-by-ai-agents/
2•technewssss•43m ago•0 comments

The Night France Saved the British Grid

https://dispatches.kilowatts.io/p/a-midsummer-nights-near-miss
3•okeuro49•45m ago•2 comments

SwiftUI After 7 Years: A Story of Mediocrity [video]

https://www.youtube.com/watch?v=3XaHHFOZeJg
2•dsego•45m ago•0 comments