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.

NSA, military cyber forces will guard US election systems during midterms

https://apnews.com/article/nsa-hegseth-trump-midterms-election-security-2bfc1417d397db5fda4ad672c...
1•geox•1m ago•0 comments

Go Green Cleaning Services Dublin

https://www.gogreencleaning.ie/
1•AlexanderKingsm•4m ago•1 comments

Denial of Spend: New category of resource exhaustion attacks

https://paultendo.github.io/posts/denial-of-spend-gpt-6-claude-fable/
1•nikanj•5m ago•0 comments

OpenAI: Tomorrow we are re-opening the Pro $200 subscription

https://twitter.com/thsottiaux/status/2104823812042940713
2•tosh•6m ago•0 comments

Study: A lack of professional AI guidelines leads to feelings of "AI shame"

https://www.niemanlab.org/2026/09/a-lack-of-professional-ai-guidelines-leads-to-feelings-of-ai-sh...
1•giuliomagnifico•8m ago•0 comments

Show HN: Prompt Anonymization and Deanonymization

https://dataanonymiser.com
1•Lindizz•9m ago•0 comments

US Forces Exit Iraq

https://www.reuters.com/world/middle-east/us-forces-exit-iraq-after-two-decades-leaving-opening-i...
5•cod1r•10m ago•0 comments

Web Time Lapse

https://www.projectnothing.ai/experiments/web-time-lapse
2•erikrothoff•10m ago•0 comments

When can we say AI made a scientific discovery?

https://www.technologyreview.com/2026/09/28/1145230/when-can-we-say-ai-made-a-scientific-discovery/
1•joozio•13m ago•0 comments

I built a small workflow execution engine around a deliberately narrow problem

https://github.com/Varun-51/AdaptiveFlow
2•nakarvarun77•18m ago•0 comments

Show HN: Pic2svg – convert PNG/JPG to editable SVG paths in the browser

https://pic2svg.com/
1•nglsong•23m ago•0 comments

RuneBench: Agent Benchmark on RuneScape Gameplay Tasks

https://maxbittker.github.io/runebench/
1•luu•25m ago•0 comments

Towards safety cases for frontier AI training

https://openai.com/index/towards-safety-cases-for-frontier-ai-training/
1•fratellobigio•26m ago•0 comments

As AI models go rogue, do you still trust OpenAI and Anthropic to stop them?

https://www.theguardian.com/commentisfree/2026/sep/29/ai-models-security-risk-agents-openai-indep...
1•jimnotgym•27m ago•0 comments

Trump asked Xi Jinping if China would like to buy US weapons

https://www.theguardian.com/world/2026/sep/28/trump-xi-jinping-china-buy-weapons
3•vrganj•28m ago•1 comments

Mathematical Origami

https://mathigon.org/origami
1•signa11•28m ago•0 comments

The Quantum Atlas (quantum physics for non-experts)

https://quantumatlas.umd.edu/
1•rramadass•29m ago•0 comments

Britain overtaxes well-paid workers

https://www.economist.com/britain/2026/09/28/britain-overtaxes-well-paid-workers.com
2•wiseowise•29m ago•2 comments

Education Department formally rescinds Title IX protections for LGBTQ students

https://thehill.com/homenews/education/6115216-education-department-title-ix-lgbtq-trans-students/
1•Alien1Being•33m ago•0 comments

Automating eval design and hillclimbing with Claude

https://claude.dev/blog/automating-eval-design-and-hillclimbing/
2•helloplanets•34m ago•0 comments

Humans Are Reading Copilot Prompts – and They're Horrified

https://www.404media.co/humans-reading-copilot-prompts-images/
1•mikhael•36m ago•0 comments

An Open-Source Terminal UI for Azure DevOps

1•ramzthecoderhn•44m ago•1 comments

What's Behind the AI Panic

https://bombthrower.com/whats-really-behind-the-ai-panic/
2•ptidhomme•46m ago•3 comments

The dataset where fine-tuning turned actively harmful – and how we now catch it

https://www.cacheverifier.com/blog/drift-monitoring-real-customer-support-traffic
1•ChengyouXin•46m ago•0 comments

Hackers Jailbreak AI Chatbots

https://twitter.com/Hamzaonchain/status/2104494046362095669
1•soltanov•48m ago•0 comments

CVE-2026-85706 (CVSS 10.0)

https://twitter.com/EQSTLab/status/2104463962100351331
1•soltanov•49m ago•1 comments

Suicides in 5 Weeks. What's Going on at Cyber Command at Fort Meade?

https://www.thebanner.com/community/local-news/fort-meade-cyber-command-suicides-RC6YIRJO6ZBFVHAP...
2•firefax•51m ago•1 comments

What 1,350 Runs Taught Us About Prompt Guardrails

https://www.humanbound.ai/blog/prompt-guardrails-indirect-prompt-injection-1350-runs
1•Sofia_HB•55m ago•0 comments

CSV Lint update (Notepad++) text data syntax highlighting and quality validation

https://github.com/BdR76/CSVLint/
2•BdR1976•56m ago•3 comments

Uncensored and Offensive Security AI Models Benchmark

https://github.com/JoasASantos/Offensive-Security-AI-Models
2•soltanov•58m ago•0 comments