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.

Democratic governance of frontier AI, part II: Empowering cyber defenders

https://openai.com/index/empowering-cyber-defenders/
1•louiereederson•1m ago•0 comments

High-Priced Chips in Warehouses: Nvidia's Big Con?

https://cepr.net/publications/high-priced-chips-in-warehouses-nvidias-big-con/
1•DeepLogin•1m ago•0 comments

Hospitals Solved Agent Handoffs

https://jw.hn/agent-handoffs
1•jwpapi•3m ago•0 comments

Stay Human

https://stay-human.sofialiguori.com/
1•saikatsg•4m ago•0 comments

You Can't Solve AI Risk Without Solving the AI Evidence Problem

https://www.techpolicy.press/you-cant-solve-ai-risk-without-solving-the-ai-evidence-problem/
1•paimapi•5m ago•0 comments

Google staff resign in backlash over its AI contracts with military

https://www.bbc.com/news/articles/cmreyvepnv0po
8•saikatsg•6m ago•0 comments

Claude Duet

https://claude.com/product/claude-duet
6•kuberwastaken•6m ago•1 comments

Google's Rust Style Guide

https://google.github.io/styleguide/rustguide.html
2•kaycebasques•8m ago•0 comments

Expose only share links of a private service with caddy

https://dataswamp.org/~solene/2026-10-21-caddy-forward-auth-public-share-links.html
1•speckx•10m ago•0 comments

The explosive claim that's upended the AI world

https://www.technologyreview.com/2026/10/19/1147149/we-were-looking-at-it-wrong-the-explosive-cla...
2•digital55•11m ago•0 comments

Show HN: AI Agent Security Audit Console – offline audit in 15 min

https://theaioperatorstore.gumroad.com/l/uszyx
1•theaioperator•14m ago•0 comments

NLnet Publishes More Stringent Generative AI Policy

https://nlnet.nl/news/2026/20261020-AI-policy.html
1•enriquelop•14m ago•1 comments

Texas Continued Data Center Permitting After the Governor's Pause

https://fractracker.org/2026/10/texas-data-center-permits-after-governor-halt/
1•DeepLogin•17m ago•0 comments

Show HN: Whospair – a serverless Android messenger over Tor, with voice calls

https://github.com/Whospr/Whospair
1•whospair•18m ago•0 comments

Humans first wore clothing 170k years ago (2011)

https://www.nbcnews.com/id/wbna40965564
2•Tomte•18m ago•0 comments

AI Hasn't Spurred Widespread Layoffs Yet. Why Not?

https://www.library.hbs.edu/working-knowledge/ai-hasnt-spurred-widespread-layoffs-yet-why-not
1•password54321•18m ago•0 comments

Tech billionaires are disrupting biomedical science

https://www.nature.com/articles/d41586-026-03311-9
1•digital55•18m ago•0 comments

Show HN: I built a PHP2Shell tracker with hourly global updates

https://php2shell.uk/
1•hikerell•18m ago•0 comments

GitLab CVSS 10.0 Integer Overflow issue

https://docs.gitlab.com/releases/patches/patch-release-gitlab-19-5-1-released/
3•artooro•19m ago•0 comments

90% of My Skills Are Now Worth $0 – By Kent Beck (2023)

https://newsletter.kentbeck.com/p/90-of-my-skills-are-now-worth-0
1•fagnerbrack•20m ago•0 comments

DMS 2.0: DankMaterialShell is now Dux Shell

https://duxlabs.dev/blog/v2-0-release
3•phren0logy•20m ago•0 comments

Potential third critical PHP CVE

https://elk.zone/m.webtoo.ls/@elise@katze.sh/117479383721672027
2•mpaepper•22m ago•0 comments

Does a Form 144 filing mean the stock will drop? Evidence from 75,654 notices

https://equibles.com/research/does-a-form-144-filing-mean-the-stock-will-drop-evidence-from-75-65...
1•daniel3303•23m ago•0 comments

PHP Vulnerability – Helper Tool

https://speedbits.io/products/infinity-tools/
1•mrw381•23m ago•1 comments

Flint 40B: Frontier Local LLM (Fast 125 Tps on MacBook)

https://twitter.com/RichardSocher/status/2112944385415426249
2•debdut•23m ago•0 comments

Running ClickHouse on Nvidia Vera CPU

https://clickhouse.com/blog/clickhouse-performance-on-nvidia-vera
1•zX41ZdbW•25m ago•0 comments

xkcd: Vulnerability

https://xkcd.com/3314/
6•tnosirrah•25m ago•0 comments

Show HN: I built ESP32-S3 LED tubes for live coding

https://github.com/genbs/reactive-leds
3•genbs•25m ago•0 comments

Ask HN: How long before we use AI to hack John Deere or our Cars?

1•BizarroLand•26m ago•1 comments

Show HN: Word Press Function Trivia

https://wordpress.greg.technology/
1•gregsadetsky•26m ago•0 comments