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.

Man and the Computer by John G. Kemeny (1972 book by the co-creator of BASIC)

https://archive.org/details/mancomputerbyjoh0000john
2•MilnerRoute•2m ago•0 comments

Why Rocq is better than Lean for program verification

https://joomy.korkutblech.com/posts/2026-07-28-why-rocq-is-better.html
1•birdculture•4m ago•0 comments

LLM Honeypot

https://llm2human.pages.dev/
2•8thom•5m ago•1 comments

Swift on Windows: A Year of Refinement

https://speakinginswift.substack.com/p/swift-on-windows-a-year-of-refinement
1•wrxd•8m ago•0 comments

CherryTree Note Taker App

https://www.giuspen.net/cherrytree/
1•theMezz•9m ago•1 comments

Show HN: An AI Color Grader – Pico

https://www.perbhat.com/pico
1•perbhat•12m ago•0 comments

Microsoft keeps capex unchanged, the only datacenter giants to hold AI spending

https://www.businessinsider.com/microsoft-ai-capex-unchanged-data-centers-spending-tech-giants-20...
3•mapping365•12m ago•1 comments

Rogue OpenAI agent that hacked startup tried to attack other firms

https://www.theguardian.com/technology/2026/jul/29/rogue-openai-agent-that-hacked-startup-tried-t...
6•jethronethro•13m ago•0 comments

How HN: Vetted Startup – discover, buy, and sell startups with verified revenue

https://vettedstartup.com/
1•mattdarren•14m ago•0 comments

Chip stocks shed more than $1T as selloff hits AI companies

https://www.cnbc.com/2026/07/29/chip-selloff-sk-hynix-samsung-softbank.html
3•yogthos•14m ago•0 comments

Why agentic systems need ontologies [video]

https://www.youtube.com/watch?v=Sir59K8ZDPU
2•juanre•15m ago•0 comments

Arizona's Declining Groundwater

https://science.nasa.gov/earth/earth-observatory/arizonas-declining-groundwater-154567/
3•littlexsparkee•15m ago•0 comments

TrustZone Intermezzo: Broken OP-Tee Memory Isolation on I.mx 8M

https://sigma-star.at/blog/2026/06/trustzone-intermezzo/
1•lengfeld•21m ago•0 comments

PyTorch Tutorial for Deep Learning

https://blog.jetbrains.com/pycharm/2026/07/pytorch-tutorial-for-deep-learning/
1•smokeeaasd•23m ago•0 comments

Copilot code review: Agent skills and MCP now generally available

https://github.blog/changelog/2026-07-29-copilot-code-review-agent-skills-and-mcp-now-generally-a...
1•smokeeaasd•24m ago•0 comments

More than 12M eye drops recalled contamination could harm vision

https://www.dailymail.com/health/article-16014229/rohto-eyedrops-recall-fda-sterility.html
2•Bender•26m ago•0 comments

Three Virtues by Larry Wall

https://thethreevirtues.com/
3•gregsadetsky•28m ago•0 comments

GitHub is the wrong shape for this new world

https://depot.dev/blog/github-is-the-wrong-shape-for-this-new-world
5•emschwartz•28m ago•0 comments

Show HN: Always on visual context for your agents

https://useglass.up.railway.app/#
2•quantbagel•29m ago•0 comments

It was surprisingly hard to break CloudNativePG replication

https://coroot.com/blog/fencing-a-cnpg-replica/
2•valyala•30m ago•0 comments

Vector AI Agent

https://routinehub.co/shortcut/24957/
2•morriszdweck•30m ago•0 comments

The task is not the job

https://www.siliconcontinent.com/p/why-desk-jobs-survive-and-amodei
2•adletbalzhanov•33m ago•2 comments

Show HN: I built a Chrome extension so Claude can close my 300 tabs

https://chromewebstore.google.com/detail/tab-genie/cjbnpcocgkomljkgfhgadolphbeicddh
3•adam_carrigan•34m ago•0 comments

Ask HN: Is everybody's Claude weekly quota reset time the same?

1•0gs•36m ago•0 comments

Òrbites – el puzzle de les constel·lacions

https://orbites.cat/
1•sabatesduran•36m ago•0 comments

Microsoft Struggling with AI-Discovered Security Bugs

https://www.propublica.org/article/anthropic-mythos-microsoft-software-vulnerabilities
4•donohoe•38m ago•0 comments

AgentSwarms – self-hostable agentic AI/BI platform with sandboxed Python (ELv2)

https://github.com/AgentSwarms-fyi/agentswarms
3•agentswarms•42m ago•0 comments

The Hunt for the Counterfeiter Trying to Make the Perfect Bill

https://www.nytimes.com/2026/07/16/magazine/counterfeit-dollars.html
1•bookofjoe•42m ago•1 comments

Agentic Design

https://agentic-design.ai
2•Davcker•42m ago•0 comments

Marvelous – A Markdown editor where every save is a Git commit

https://github.com/stevenjjobson/marvelous
1•stevenjobson•45m ago•1 comments