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.

The U.N. backs a new world map showing Africa in its true relative size

https://www.npr.org/2026/09/04/nx-s1-5958611/africa-world-map-un-vote
1•croes•36s ago•0 comments

Show HN: RagLeap Core – 46 AI Employees, open-source LangChain alt

https://github.com/antonyrag/ragleap-core
1•antonyragleap•1m ago•0 comments

Microsoft says email spammers are adopting ASCII smuggling

https://arstechnica.com/security/2026/09/once-popular-for-attacking-ai-ascii-smuggling-is-embrace...
1•utiiiD•1m ago•0 comments

Show HN: map data onto a globe

https://github.com/atlaslib/globe
1•tosh•3m ago•0 comments

Show HN: Free macOS App to import photos from memory card with file naming rules

https://github.com/jianfenglin-git/photo-batch-importer
1•jianfenglin•4m ago•0 comments

Aerial Saw

https://en.wikipedia.org/wiki/Aerial_saw
1•js2•6m ago•0 comments

Show HN: Hitomaki, a memento mori measured in toilet paper rolls

https://ag3497120.github.io/hitomaki/
1•kofdai•15m ago•0 comments

El Niño Forecast to Be Strongest on Record

https://healthpolicy-watch.news/ongoing-el-nino-set-to-strongest-on-record-increasing-risks-of-ex...
1•geox•16m ago•0 comments

The Cogito – Keyboard designed for human hands

https://wattiv.nl/work/cogito/
1•TGHUvzPtTBFnxRo•18m ago•0 comments

Former Treasury Secretaries: AI is a risk of a different kind

https://www.washingtonpost.com/opinions/2026/09/03/ai-safety-security-risks-demand-new-government...
5•reasonableklout•19m ago•1 comments

Who runs the labor market? Women accounted for 98% of U.S. job gains in August

https://fortune.com/2026/09/04/jobs-report-september-women-162000-jobs/
4•littlexsparkee•19m ago•1 comments

Motivating Myself for Exercise by Arbitrarily Withholding Things I Desire

https://blog.klungo.no/2026/09/04/motivating-myself-for-exercise-by-arbitrarily-withholding-rewards/
1•danielskogly•21m ago•0 comments

Free Sewing Patterns

https://freesewing.eu/
2•gmargari•26m ago•0 comments

Could Anthropic have solved Navier–Stokes?

https://twitter.com/ElliotGlazer/status/2096076054133952516
1•marcelo-earth•27m ago•0 comments

An OS with two syscalls that runs COBOL on bare metal, no LLVM or GCC

https://github.com/AndreeSalazar/BMO-X
1•Salazar-X•32m ago•0 comments

Is AI ruining my brain?

https://thoughtbot.com/blog/is-ai-ruining-my-brain
2•signa11•32m ago•1 comments

Booz Allen Cyber Weapon Index

https://www.boozallen.com/insights/cyber/cyber-weapon-index.html
3•jonbaer•33m ago•0 comments

Why are European countries moving their gold out of North America?

https://www.bbc.com/news/articles/cvgyn8q8gqxo
44•ranit•33m ago•22 comments

LG and Samsung TVs are logging everything you say [video]

https://www.youtube.com/watch?v=w5KnFmKjFTA
3•someonebaggy•39m ago•0 comments

Cerebras CS-4: 30x Faster Than GPUs

https://www.cerebras.ai/blog/introducing-cerebras-cs-4
2•mgh2•40m ago•2 comments

Claude Fable 5.1 and Mythos 5.1: The System Card

https://thezvi.substack.com/p/claude-fable-51-and-mythos-51-the
1•paulpauper•44m ago•0 comments

Liechtenstein prince tightens grip in succession shake-up

https://www.ft.com/content/c25c1bdf-8acf-4ccc-bc67-c31bc9fb83bc
2•paulpauper•45m ago•0 comments

New Zealand is determined not to keep China's espionage a secret

https://www.lowyinstitute.org/the-interpreter/new-zealand-is-determined-not-to-keep-china-s-espio...
8•pir8life4me•53m ago•0 comments

Opinion: Religion Lowers Individual Morality

4•ReligionKills•53m ago•1 comments

Show HN: Mac Cleaner for devs

https://app.paymug.co/buy/lime-cleaner-mac
1•docuru•54m ago•1 comments

Show HN: PATM - A graphical database manager and developer toolbox

https://github.com/jamalhill12321-hash/patm
1•jamalhill•55m ago•1 comments

There's No Such Thing as an AI 'Lab'

https://www.theatlantic.com/technology/2026/09/stop-calling-ai-companies-labs/688528/
2•littlexsparkee•55m ago•0 comments

Cancer Capital: VC didn't use to work like this

https://www.anildash.com/2026/09/04/vc-didnt-use-to-work-like-this/
3•dotcoma•55m ago•0 comments

Murdoku – Murder mystery meets Sudoku

https://murdoku.com/play/
1•gmargari•56m ago•0 comments

GhostMeet – A Google Meet summarizer with no bot in your call

https://chromewebstore.google.com/detail/ghostmeet/figodpdocbgklmeglohdjomeikabfpeo
2•sahilpradhan•1h ago•0 comments