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.

15% of long-form Reddit posts are AI-written (41% in R/CryptoCurrency)

https://www.subsignal.ai/blog/how-much-of-reddit-is-ai
1•patrickgerard93•3m ago•0 comments

The IPO hype machine is moving faster than the stocks

https://www.fastcompany.com/91576516/wall-streets-ipo-comeback-is-delivering-mixed-results
1•1vuio0pswjnm7•4m ago•0 comments

Hardening Rust Code for Production

https://corrode.dev/blog/hardening-rust/
1•vsgherzi•5m ago•0 comments

Moonshot AI eyes $50B valuation, Hong Kong IPO after Kimi K3 breakthrough

https://finance.yahoo.com/technology/ai/articles/moonshot-ai-eyes-50-billion-151346997.html
1•zX41ZdbW•6m ago•0 comments

A sin was committed by YouTube on the most beautiful channel [video]

https://www.youtube.com/watch?v=4vP7n-0o_UQ
1•secretslol•6m ago•0 comments

See the VCs and Family Offices at the Core of the Mega IPO Wave

https://www.wsj.com/livecoverage/spacex-ipo-stock-market-06-12-2026/card/see-the-vcs-and-family-o...
1•1vuio0pswjnm7•7m ago•0 comments

US pauses $1B in Medicaid payments to California, Minnesota

https://www.reuters.com/world/us-health-secretary-kennedy-says-cms-is-pausing-medicaid-payments-c...
3•tartoran•7m ago•0 comments

Sildenafil may reduce cancer metastasis, study shows

https://medicalxpress.com/news/2026-07-viagra-cancer-metastasis.html
1•OutOfHere•9m ago•0 comments

Show HN: Atlas – Local Dependency Graph

https://atlas-repo-wu76.vercel.app/
1•Yoavkozo•11m ago•0 comments

The AI Backlash Is Starting to Sting

https://www.wsj.com/tech/ai/the-ai-backlash-is-starting-to-sting-129a708d
2•1vuio0pswjnm7•12m ago•1 comments

Lower token usage through representation engineering

https://github.com/rkique/caveman-steer/tree/main
1•rkique•15m ago•0 comments

US civil rights agency moves to end demographic data collection after 60 years

https://apnews.com/article/eeoc-discrimination-dei-andrea-lucas-2f521d784a9d0376416499066dc9f178
2•petethomas•15m ago•1 comments

Off-the-Record Messaging Protocol

https://en.wikipedia.org/wiki/Off-the-Record_Messaging_protocol
1•gjvc•22m ago•0 comments

Hugging Face uses open-weights Z.ai GLM 5.2 to battle attacker

https://siliconangle.com/2026/07/20/hugging-face-uses-open-weights-z-ai-glm-5-2-defend-attacker-c...
3•vednig•22m ago•1 comments

Five Moments in Snapping History

https://unsung.aresluna.org/five-moments-in-snapping-history/
1•birdculture•23m ago•0 comments

Vaporlink – drop a folder or HTML file, get a shareable link that kills itself

https://www.tryvapor.link
1•TheRealCed•25m ago•1 comments

Lessons from vibe coding 30 apps – 6 still in production with real users

https://old.reddit.com/r/vibecoding/comments/1v2wgj5/i_vibe_coded_30_apps_in_2_years_6_are_still_in/
2•tastyeffectco•26m ago•0 comments

Proposed bill could make New York the first U.S. state with universal healthcare

https://www.weny.com/news/proposed-bill-could-make-new-york-the-first-u-s-state-with-universal-he...
2•thunderbong•26m ago•1 comments

Reducing LLM Costs 50% Using Best-Execution for Intelligence

https://www.thesean.ai/blog/introducing-ship
1•arbayi•29m ago•0 comments

Right-Hand Cybersecurity Is Hiring Product Engineer

https://boards.rooster.jobs/jobs/449274
1•uzair-righthand•29m ago•0 comments

Is it just me? HN:new best

2•oriettaxx•31m ago•0 comments

Show HN: Computable – Buy, sell, and redeem GPU for the exact weeks you want

https://www.getcomputable.com/
5•yuansong98•31m ago•2 comments

Sugar found in raspberries was discovered near the Milky Way's center

https://www.livescience.com/space/astronomy/sweet-sugar-found-in-raspberries-discovered-near-the-...
1•cybermango•32m ago•0 comments

Nate Parrott's dopamine-crushing metrics-driven site

https://nateparrott.com/
1•hmokiguess•35m ago•0 comments

Mad 2.0: Mutually Assured Disruption

https://www.thoughtmerchants.com/opinion/mad-2-0-mutually-assured-disruption
1•deltamidway•36m ago•0 comments

Brookmd – streaming Markdown renderer in Rust (web, RN, Swift and more)

https://github.com/siinghd/brookmd
1•siinghd•38m ago•0 comments

What Role Does Wildfire Smoke Play on Radio Signals?

https://www.radioworld.com/tech-and-gear/nicks-signal-spot/what-role-does-wildfire-smoke-play-on-...
2•RF_Enthusiast•40m ago•0 comments

Open pricing dataset for the Seedance 2.0 API, across 16 vendors

https://useapi.net/docs/articles/seedance-2-api-pricing
1•useapi•40m ago•0 comments

Zenoh Reliability, Scalability and Congestion Control

https://zenoh.io/blog/2021-06-14-zenoh-reliability/
2•Kinrany•40m ago•0 comments

IDEs are done, and they are not coming back

https://cpojer.net/notes/not-coming-back
1•coloneltcb•46m ago•1 comments