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.

Assessing carbon emissions and energy consumption of US hyperscale data centres

https://www.nature.com/articles/s41893-026-01985-7?trk=article-ssr-frontend-pulse_little-text-block
1•latentframe•45s ago•0 comments

Y Combinator: How to Build a Jet Engine from Scratch [video]

https://www.youtube.com/watch?v=-ieJwYq4j-o
1•ksec•1m ago•0 comments

Show HN: I make open-source flight test stand

https://github.com/crocone/flying-test
1•keepplain•2m ago•0 comments

Lydian Chromatic Concept of Tonal Organization

https://en.wikipedia.org/wiki/Lydian_Chromatic_Concept_of_Tonal_Organization
1•benbreen•2m ago•0 comments

Show HN: Simulusion – DreamerV3, IRIS, Genie and other world models in PyTorch

https://github.com/ParamThakkar123/simulusion
1•paramthakkar•6m ago•0 comments

Type errors cost our coding agents under 1% of their time

https://evilmartians.com/chronicles/type-errors-cost-our-coding-agents-under-one-percent-of-their...
1•ksec•8m ago•0 comments

Native Shell v0.7.0 Released

https://nsh.dev/releases/
1•ksec•10m ago•0 comments

In GTA VI, every stolen car is a music discovery machine

https://www.npr.org/2026/11/24/nx-s1-6052997/gta-vi-radio-music-discovery
2•blinding-streak•10m ago•0 comments

US Army plans to detonate an Iowa ammo plant, leading to airbourne lead plume

https://www.centredaily.com/news/nation-world/national/article318231892.html
2•illidan1000•13m ago•1 comments

Show HN: U.S. Interstate Weather

https://www.interstateweather.com/
5•projproj•14m ago•1 comments

Indian university named world’s best building

https://www.architectsjournal.co.uk/news/daring-and-confident-indian-university-named-worlds-best...
1•geox•16m ago•0 comments

Show HN: Old Nvidia and ATI tech demos, running again in the browser

https://gpu-demo-gallery.pages.dev/
2•arkits•18m ago•1 comments

Taking over US Treasury subdomains for $3 each

https://www.intruder.io/research/taking-over-us-treasury-subdomains-for-3-each
2•negura•21m ago•0 comments

Quad9 shuts down DNS service in France after piracy-blocking order – LavX News

https://news.lavx.hu/article/quad9-shuts-down-dns-service-in-france-after-piracy-blocking-order
1•abdelhousni•23m ago•0 comments

Getting Older in Tech (2016)

https://corgibytes.com/blog/2016/12/06/getting-old-er-in-tech/
1•zenincognito•29m ago•0 comments

The last time robots came for our jobs [video]

https://www.youtube.com/watch?v=yXlsaaFshYk
1•Animats•29m ago•1 comments

LoopCD: Decoding Looped Transformers Better for Almost Free

https://arxiv.org/abs/2610.02185
1•reddmachine•34m ago•0 comments

Build like a Google engineer: modern Bazel with modules, Go and Typst

https://popovicu.com/posts/build-like-a-google-engineer-modern-bazel/
2•pella•36m ago•0 comments

Marvel family calls Patrick Stewart's Xavier 'the conscience' of new Avengers

https://ew.com/patrick-stewart-avengers-doomsday-final-performance-tributes-exclusive-12262759
2•Gaishan•37m ago•0 comments

Show HN: Side-panel Chrome extension to match a resume against a job posting

https://chromewebstore.google.com/detail/resumefitting-ats-resume/hgliajcfchmgibmohangaflonhikgimp
1•dailyworkaholic•42m ago•0 comments

The other sort of tube network

https://londonreconnections.com/the-other-sort-of-tube-network/
2•zeristor•43m ago•0 comments

Strix Halo AI Toolboxes

https://strix-halo-toolboxes.com/
1•teleforce•44m ago•0 comments

Gemini refused to give me the lyrics to Twinkle Twinkle Little Star

https://www.comentr.com/technology/01M88DWQ0R4NCMYR17AFEWRG1F
5•hoodied•46m ago•0 comments

Fly.io Hacksgiving 2026

https://fly.io/hacksgiving/
1•abound•47m ago•0 comments

Finetuning models 6x cheaper than Tinker

https://nextron.physionlabs.ai/
1•ljhnick•49m ago•1 comments

Inky. Inkling 2 Mini inference on Apple Silicon

https://github.com/robotgamedevelopers/inky
1•glennfiedler•53m ago•0 comments

US Treasury Cybersecurity Incident

https://www.theverge.com/policy/1041957/fincen-treasury-cybersecurity-incident
4•negura•54m ago•0 comments

Journal proofing AI heavily alters researcher's accepted paper without tracking

https://bsky.app/profile/yungenchee.bsky.social/post/3n325cjuhxk2g
1•pelican0•58m ago•1 comments

Marginalia Search, Money, C++, Rust, AI, Stuff

https://www.marginalia.nu/log/a_141_marginalia_update/
27•Curiositry•1h ago•3 comments

Show HN: Archiver that opens every format

https://provost.unlimitedweb.space/
3•uws•1h ago•0 comments