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.

Show HN: Hnrepos.com, HackerTube for Repositories

https://hnrepos.com
1•richardw•24s ago•0 comments

Ondrej Surý, who saved the internet: You have to want to do something for others

https://english.elpais.com/technology/2026-11-02/ondrej-sury-the-man-who-saved-the-internet-you-h...
1•pilingual•26s ago•0 comments

UK pulls the plug on analogue phones in January and the rest of Europe is next

https://www.euronews.com/2026/11/02/alarms-and-card-machines-at-risk-as-a-million-uk-lines-yet-to...
1•geox•49s ago•0 comments

VictoriaLogs vs. Loki, Elasticsearch, OpenSearch, SigNoz and ClickStack

https://victoriametrics.com/blog/structured-log-ingestion-benchmark/index.html
1•ibobev•2m ago•0 comments

A slightly better ThreadPoolExecutor in Pystd through types

https://nibblestew.blogspot.com/2026/10/a-slightly-better-threadpoolexecutor-in.html
1•ibobev•2m ago•0 comments

Overriding Heading Levels with the Headingoffset HTML Attribute

https://blog.master.dev/overriding-heading-levels-with-the-headingoffset-html-attribute/
1•ibobev•3m ago•0 comments

PageScribe: Handwriting and offline dictionary audio for KOReader

https://aspireai.kiranadimatyam.com/builds/pagescribe/
1•seshakiran•3m ago•0 comments

IPv6-First, IPv4-Enough

https://www.ipv4.global/events/ipv6-first-ipv4-enough/
1•speckx•3m ago•0 comments

LeVJEPA 1.5 Large same performance but 5.6x less compute and less data

https://huggingface.co/galilai-group/LeVJEPA-1.5-Large
2•sheepseb•4m ago•1 comments

I Built a $5 Apple Vision Pro [video]

https://www.youtube.com/watch?v=XtNmiTohUcs
1•Audiophilip•7m ago•0 comments

Writing seen in PHerc. 306B, for the first time in 2000 years

https://scrollprize.substack.com/p/writing-seen-in-pherc-306b-for-the
1•benbreen•8m ago•0 comments

Model and reason on processes through (Scryer) Prolog, directly in the browser

https://github.com/Christopher22/bpmn_meets_prolog
1•triska•9m ago•0 comments

Personal Digital Sovereignty

https://blog.senko.net/personal-digital-sovereignty
1•taubek•9m ago•0 comments

Softly Now

https://www.marginalia.nu/log/a_140_soft_focus/
1•Curiositry•11m ago•0 comments

Ask HN: Is anyone going to use AI only to file their taxes?

1•johsole•11m ago•2 comments

Voyager 1 Is About to Reach 1 Light-Day from Earth

https://www.iflscience.com/voyager-1-is-about-to-reach-1-light-day-from-earth-what-do-we-know-abo...
3•fortran77•13m ago•0 comments

Frustrated Ranchers Want People to Quit 'Rescuing' Their Working Guardian Dogs

https://cowboystatedaily.com/2026/10/15/frustrated-ranchers-want-people-to-quit-rescuing-their-wo...
1•rdmuser•13m ago•0 comments

Show HN: Never forget what size you are in that brand again

https://sizewise.franzonlabs.se
1•sirphuzz•13m ago•0 comments

Looksmaxxing and the Quantification of Culture

https://www.ssense.com/en-ca/editorial/culture/looksmaxxing-quantification-culture
2•crescit_eundo•13m ago•0 comments

A former volunteer is attempting to sue Skyblivion and we need your help [video]

https://www.youtube.com/watch?v=cbECoFxtaI4
2•wronglebowski•14m ago•0 comments

Anthropic's growth slowed and costs jumped in the third quarter

https://fortune.com/2026/11/02/anthropics-growth-slowed-and-costs-jumped-in-the-third-quarter-upd...
2•ersinesen•16m ago•1 comments

My Me-ware (so far)

https://peter.laceybordeaux.com/blog/posts/me-ware/
2•Powdering7082•21m ago•0 comments

Reading Anthropic's S-1

https://www.tilomitra.com/blog/anthropic-s1-in-charts
4•gmays•23m ago•0 comments

The Experience of Maxing Out One's Cognitive Horsepower (2025)

https://www.justinmath.com/the-experience-of-maxing-out-cognitive-horsepower/
3•ex-aws-dude•23m ago•0 comments

From Cloud-First to AI-First: Productivity-Maxxing or Token-Maxxing?

https://www.dewanahmed.com/cloud-first-ai-first/
1•mooreds•24m ago•0 comments

Crew from NASA's simulated Mars mission emerges after 378 days in isolation

https://www.reuters.com/science/crew-nasas-simulated-mars-mission-emerges-after-378-days-isolatio...
2•Betelbuddy•25m ago•0 comments

Dogmas Begin and How You Can End Them

https://fagnerbrack.com/how-dogmas-begin-and-how-you-can-end-them-36c5ec669e4b
1•fagnerbrack•26m ago•0 comments

An outsider's perspective on Scion and Mononoke

https://typesanitizer.com/blog/scion.html
1•birdculture•28m ago•0 comments

Entire's Trail vs. the Pull Request

https://stackness.dev/blog/entire-git-forge-trail-vs-pull-request-what-changes-and-what-stays
1•gosen•29m ago•1 comments

Egoless Mathematics in the AI Era

https://terrytao.wordpress.com/2026/11/02/egoless-mathematics-in-the-ai-era/
16•smilelamp•32m ago•4 comments