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.

900-Page Pre-Pantone Guide to Color from 1692 (With Complete High-Res Scan)

https://www.openculture.com/2026/10/a-900-page-pre-pantone-guide-to-color-from-1692.html
2•mdp2021•9m ago•0 comments

Show HN: I made an AI free version of my directory of open-source alternatives

https://noai.openaltfinder.com/
2•woutr_be•12m ago•0 comments

The Role of Nuclear in the Energy Transition: Complementary but Limited

https://www.energy-transitions.org/publications/nuclear-in-the-energy-transition/
1•ZeroGravitas•14m ago•0 comments

I posted 100 tiktoks as introverted engineer

1•weekendViper•15m ago•0 comments

X Once Again Marks the Spot

https://daringfireball.net/2026/10/x_once_again_marks_the_spot
1•tosh•16m ago•0 comments

Fake reviews on the Google Play store

1•lo0dot0•17m ago•0 comments

Ask HN: What desk chair would you recommend for a home office?

1•ap11071•17m ago•1 comments

Slop City

https://slopcity.org/
1•logn•17m ago•0 comments

Show HN: Test UI Hypotheses for Mobile Paywalls

https://onlang.io/login?next=%2Fapp
3•sovkov•20m ago•0 comments

Building my own expense tracker

https://sungatae.com/posts/building-my-own-expense-tracker/
1•visujosh•21m ago•0 comments

Catch a Bird – I made it for my own sanity

https://catchabird.com
1•eduardsik•23m ago•0 comments

Heldearly

https://heldearly.com
1•sarcfd•26m ago•0 comments

Whacky Japanese moving keyboard may be the future or not

https://www.t3.com/tech/computers-pcs/this-whacky-japanese-moving-keyboard-may-be-the-future-or-not
1•mushstory•27m ago•0 comments

DraftKings Says It Doesn't Want Problem Gamblers. I Bet $22K to find out [video]

https://www.youtube.com/watch?v=l8IyGjdY1sg
2•xbmcuser•28m ago•0 comments

Trump Mobile hack and apparent lack of FCC authorization raise security alarms

https://arstechnica.com/tech-policy/2026/10/trump-mobile-doesnt-seem-to-have-fcc-authorization-fo...
3•rbanffy•29m ago•0 comments

Ask HN: How are you handling auth token storage in React Native in 2026?

1•smichloe01•29m ago•0 comments

Leading Chinese mathematicians unite behind use of AI in research

https://www.scmp.com/news/china/science/article/3370492/leading-chinese-mathematicians-unite-behi...
2•ChickeNES•29m ago•0 comments

Videopowers – A factory plugin for making YouTube videos with Claude Code

https://github.com/vinit-agr/videopowers
2•vinitagr•31m ago•0 comments

EU-Compliant Mobile App Paywalls

https://onlang.io/
4•sovkov•32m ago•0 comments

Interpreter spill stack on the process stack

https://xnacly.me/posts/2026/keeping-interpreter-stack-on-thread-stack/
1•xnacly•32m ago•0 comments

Show HN: ClueCDC – Open-Source UI for Managing Debezium and Kafka CDC Pipelines

https://github.com/cluedata/cluecdc
1•khanhvlq•37m ago•0 comments

Fable Took My Job

https://cendyne.dev/posts/2026-10-11-fable-took-my-jorb.html
5•jllyhill•43m ago•0 comments

Best Free AI Tools 2026: 7 Worth Using and Their Real Limits

https://thetechboom.com/2026/09/05/best-free-ai-tools-2026/
1•ninyeh•44m ago•0 comments

DocToolchain

https://doctoolchain.org/docToolchain/v2.0.x/index.html
1•saikatsg•46m ago•0 comments

What is your seafood eating? Investigation traces problems in global feed supply

https://www.cbc.ca/news/world/outlaw-ocean-fishmeal-9.7312543
3•rdmuser•51m ago•0 comments

A loophole in Canada's species-at-risk law can leave wildlife in limbo

https://www.cbc.ca/news/canada/legal-loophole-undermining-species-at-risk-act-9.7368066
2•rdmuser•52m ago•1 comments

Girl bedrooms in the era of surveillance culture

https://sitarasgarden.substack.com/p/girl-bedrooms-in-the-era-of-surveillance
2•rdmuser•53m ago•0 comments

Valar Atomics sues early backer Day One Ventures over Series B pro-rata rights

https://app.dealroom.co/news/note/valar-atomics-sues-early-backer-day-one-ventures-over-series-b-...
2•jackgavigan•54m ago•0 comments

A Memory of Pangea – Running a public-interest BBS in 1996

https://github.com/l3nz/pangea-2023/blob/main/Storia_en.md
1•kimi•55m ago•0 comments

Dgxtop v2: A Terminal Monitor for Nvidia GPUs on Linux and DGX Spark

https://dennysora.me/en/projects/tools/dgxtop/
1•dennysora-main•1h ago•1 comments