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.

New York Has Sued Kalshi for Running Illegal Gambling Operation

https://ag.ny.gov/press-release/2026/governor-hochul-and-attorney-general-james-announce-new-york...
1•cdrnsf•1m ago•0 comments

The messy politics behind Google's big AI shakeup

https://www.theverge.com/tech/976108/google-ai-leadership-shakeup-jeff-dean-demis-hassabis-deepmind
1•Anon84•2m ago•0 comments

BMS ran AI for drug discovery 3 years- what they found and why they doubled down

https://blogs.nvidia.com/blog/bristol-myers-squibb-building-life-science-industrys-most-advanced-...
1•bcaulfield•2m ago•0 comments

With software alone, one B200 beats the LPU and gets close to Cerebras

https://runinfra.ai/news/b200-beats-the-lpu
2•OsamaJaber•2m ago•0 comments

Why AI is a risk to Communist China

https://www.economist.com/leaders/2026/08/06/why-ai-is-a-risk-to-communist-china
1•petethomas•2m ago•0 comments

Several plaster noses hidden in plain sight around London's Soho neighborhood

https://www.atlasobscura.com/places/seven-noses-of-soho
1•bcaulfield•2m ago•0 comments

Google shifts AI power back to Brin as DeepMind's Hassabis steps aside

https://giftarticle.ft.com/giftarticle/actions/redeem/1313659c-650d-45f9-9f81-f9f18a7f8b69
1•nmstoker•4m ago•0 comments

Kitesurf:The agent-first browser that runs in isolates on Cloudflare

https://blog.cloudflare.com/kitesurf/
2•cebert•8m ago•1 comments

AMA: MiniMax H3 Team – Ask anything about open video generation model

https://old.reddit.com/r/StableDiffusion/comments/1vh9rtw/ama_minimax_h3_team_ask_us_anything_abo...
1•embedding-shape•11m ago•0 comments

Metabase: Unauthenticated SQL injection in password reset (CVSS 10.0)

https://github.com/metabase/metabase/security/advisories/GHSA-vwf4-m7j8-wcjf
2•thejosh•15m ago•1 comments

Beyond the Library: An Agentic Framework for Autoformalizing Research Math

https://arxiv.org/abs/2606.31134
1•matt_d•16m ago•0 comments

Atari Legacy Magazine – By Paul Lefebvre

https://www.goto10retro.com/p/atari-legacy-magazine
1•rbanffy•16m ago•0 comments

MFLUSIVA

https://www.modernatx.com/ir-insights-mflusiva
1•jawns•17m ago•0 comments

GitHub Actions suffers second-longest major outage in its history

https://www.githubstatus.com/uptime/br0l2tvcx85d
40•KernelPryanic•18m ago•7 comments

GPS and the Lost Art of Getting Lost

https://www.newyorker.com/news/annals-of-inquiry/gps-and-the-lost-art-of-getting-lost
3•fortran77•21m ago•0 comments

Show HN: Learn System Design, one campaign at a time

https://scalequest.io/
2•raaa1•22m ago•0 comments

Show HN: Higher-dimensional lattices unfolded into the 2D plane

https://number-garden.com/?@THLP@
1•unitX•24m ago•1 comments

Welcoming the Nepalese Government to Have I Been Pwned

https://www.troyhunt.com/welcoming-the-nepalese-government-to-have-i-been-pwned/
11•gnabgib•25m ago•2 comments

In Menlo Park housing fight, Bonta sends potential warning to California cities

https://www.sfchronicle.com/realestate/article/housing-fight-menlo-park-bonta-22372361.php
2•randycupertino•25m ago•0 comments

Dice, (De)Convolution and Generating Functions

https://blog.demofox.org/2025/01/05/dice-deconvolution-and-generating-functions/
1•sebg•26m ago•0 comments

China built its 'Manhattan Project' to rival the West in AI chips [video]

https://www.youtube.com/watch?v=25ttDa0eqJQ
2•binyu•26m ago•0 comments

Show HN: Tmagnet – a terminal torrent client written in C

https://codeberg.org/ivanjeka/tmagnet
1•ivanjeka•26m ago•0 comments

Show HN: Pokémon Emerald Ported to Raspberry Pi Pico 2

https://github.com/mattdeeds/pokeemerald-rp2350
7•mdeeds•28m ago•0 comments

Priormarket – a fundamentals research terminal for Kalshi/Polymarket

1•mjarard•31m ago•0 comments

Waxrunner – Discogs wantlist cost optimization with a constraint solver

https://waxrunner.com/
1•hybridtheory•33m ago•0 comments

Owner of bike maker Raleigh files for insolvency

https://www.bbc.co.uk/news/articles/c4gv45w4j8eo
2•JohnHammersley•35m ago•3 comments

OpenAI's latest math breakthroughs commit research misconduct, experts say

https://www.scientificamerican.com/article/openais-latest-math-breakthroughs-commit-research-misc...
3•beardyw•36m ago•0 comments

ATProto for Distributed Systems Engineers

https://atproto.com/articles/atproto-for-distsys-engineers
4•LelouBil•41m ago•1 comments

Hazard Pointers for the Kernel

https://lwn.net/Articles/1084015/
1•signa11•42m ago•0 comments

All Gods Must Die: Adversarially Verified Transformation

https://drive.google.com/file/d/1GYR9AikBP7B6teFMyNOyp-P606fMzfVS/view?usp=sharing
2•andrexibiza•42m ago•0 comments