frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

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.

Ask HN: Why do we snore? And what to do about it?

1•simonebrunozzi•1m ago•0 comments

Little Things Matter: The Lost Key of the Titanic

https://sm4.global-aero.com/articles/little-things-matter-the-lost-key-of-the-titanic/
1•teleforce•1m ago•0 comments

Why birth rates are falling everywhere all at once

https://www.ft.com/content/fba35eca-df3a-4ad6-b42d-eb08eb7c9ad3
1•Anon84•2m ago•1 comments

State of the Fin 2026-05-24

https://jellyfin.org/posts/state-of-the-fin-2026-05-24/
1•Rant423•3m ago•0 comments

The Bus from Izu

https://cinemasojourns.com/2026/05/24/the-bus-from-izu/
1•jjgreen•3m ago•0 comments

Poverty Changes Your Mind-Set (2018)

https://www.chicagobooth.edu/review/how-poverty-changes-your-mind-set
2•downbad_•4m ago•0 comments

The infamous 20 year old MySQL Bug #11472 has been fixed

https://bugs.mysql.com/bug.php?id=11472
1•theanonymousone•5m ago•0 comments

European vs. American Productivity Culture: 10 Key Differences in 2026

2•marian_abz•6m ago•0 comments

Are smartphones to blame for declining birth rates?

https://unherd.com/newsroom/are-smartphones-really-to-blame-for-declining-birth-rates/
1•Anon84•7m ago•0 comments

A Finite Inventory for the Linux Inode

https://loke.dev/blog/linux-inode-exhaustion-metadata-limits
1•ankitg12•8m ago•0 comments

Show HN: Gemini Omni – A curated list of native multimodal guides and showcases

https://github.com/cnemri/awesome-gemini-omni
1•cnemri•8m ago•0 comments

Pope Leo's 'Magnifica humanitas': AI must serve humanity not concentrate power

https://www.vaticannews.va/en/pope/news/2026-05/pope-leo-xiv-encyclical-magnifica-humanitas-ai.html
1•layer8•9m ago•0 comments

Small Model, Big Brain: The 27B Parameter Model Is the New King of Code

https://beeble.com/en/blog/small-model-big-brain-why-the-27-billion-parameter-model-is-the-new-ki...
2•Akamant•9m ago•0 comments

Pathname lookup – The Linux Kernel documentation

https://docs.kernel.org/filesystems/path-lookup.html
1•ankitg12•9m ago•0 comments

Digital sovereignty, the musical: One engineer's crusade against hyperscalers

https://www.theregister.com/offbeat/2026/05/25/digital-sovereignty-the-musical-one-engineers-biza...
1•beardyw•10m ago•0 comments

Akasxh/gpucheck: pytest for GPU kernels

https://github.com/Akasxh/gpucheck
1•ankitg12•11m ago•0 comments

Every RAG-based localization pipeline has the same blind spot

https://lingo.dev/en/engineering/rag-localization-glossary-retrieval
1•maxpr•18m ago•0 comments

The AI-Native Developer – Queue

https://spawn-queue.acm.org/doi/10.1145/3807961
2•rbanffy•19m ago•0 comments

Europe Braces for Record-Breaking Late May Heatwave

https://www.severe-weather.eu/global-weather/heat-dome-europe-heatwave-may-summer-2026-forecast-mk/
2•cromka•28m ago•0 comments

Anthropic's 'Mythos 1' Keeps Appearing Despite Restricted Access Claims

https://firethering.com/claude-mythos-anthropic-claude-code-public-release/
1•steveharing1•28m ago•0 comments

Magnifica Humanitas (Encyclical Letter)

https://www.vatican.va/content/leo-xiv/en/encyclicals/documents/20260515-magnifica-humanitas.html
9•theletterf•29m ago•1 comments

Show HN: An open-source, interactive AI engineering syllabus (1,100 papers)

1•PoppingPixel•29m ago•1 comments

No Linux support on free version of Vivado 2026.1

https://www.amd.com/en/products/software/adaptive-socs-and-fpgas/vivado/vivado-licensing-options....
1•birdculture•31m ago•0 comments

Successful Launch Spurs China Toward Crucial First for Moon Landing

https://www.sciencealert.com/successful-launch-spurs-china-toward-crucial-first-for-moon-landing
2•ColinWright•33m ago•0 comments

Exploring the Therapeutic Benefits of Pranayama: A Systematic Review

https://pmc.ncbi.nlm.nih.gov/articles/PMC7336946/
1•rramadass•37m ago•0 comments

Easy (Horizontal Scrollbar) Fixes for Your Blog CSS

https://aartaka.me/easy-fixes.html
1•severine•40m ago•0 comments

The Unix Timesharing System 1974: Denis M. Ritchie and Ken Thompson

https://dl.acm.org/doi/epdf/10.1145/361011.361061
1•KnuthIsGod•40m ago•0 comments

The placenta goes viral: Retroviruses control gene expression in pregnancy [pdf]

https://pmc.ncbi.nlm.nih.gov/articles/PMC6177113/
1•thunderbong•43m ago•0 comments

What is so special about Emacs? [video]

https://www.youtube.com/watch?v=mJZDmO5yOxE
2•signa11•43m ago•0 comments

AI guardrails stripped from Meta and Google models in minutes

https://www.ft.com/content/5630ed79-a263-41ed-9a1a-321617ae310e
2•uxhacker•46m ago•2 comments